[PATCH 6/8] lspci: Print PCIe Interrupt Message Numbers consistently

From: Bjorn Helgaas
Date: Wed Oct 18 2023 - 12:09:12 EST


From: Bjorn Helgaas <bhelgaas@xxxxxxxxxx>

Several Capabilities include MSI/MSI-X Interrupt Message Numbers, which
were decoded in various ways:

- MSI %02x PCIe Capability
- IntMsg %d AER Capability
- INT Msg #%d DPC Capability
- Interrupt Message Number %03x SR-IOV Capability
- Interrupt Message Number %03x DOE Capability

Print them all using the same format:

+ IntMsgNum %d

This better matches the "Interrupt Message Number" terminology used in the
spec, e.g., PCIe r6.0, sec 7.5.3.2.

Signed-off-by: Bjorn Helgaas <bhelgaas@xxxxxxxxxx>
Cc: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx>
---
ls-caps.c | 2 +-
ls-ecaps.c | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/ls-caps.c b/ls-caps.c
index 6c5b73bf2dca..fce9502bd29a 100644
--- a/ls-caps.c
+++ b/ls-caps.c
@@ -1436,7 +1436,7 @@ cap_express(struct device *d, int where, int cap)
default:
printf("Unknown type %d", type);
}
- printf(", MSI %02x\n", (cap & PCI_EXP_FLAGS_IRQ) >> 9);
+ printf(", IntMsgNum %d\n", (cap & PCI_EXP_FLAGS_IRQ) >> 9);
if (verbose < 2)
return type;

diff --git a/ls-ecaps.c b/ls-ecaps.c
index 6028607e8217..5bc7a6907349 100644
--- a/ls-ecaps.c
+++ b/ls-ecaps.c
@@ -191,7 +191,7 @@ cap_aer(struct device *d, int where, int type)

l = get_conf_long(d, where + PCI_ERR_ROOT_STATUS);
printf("\t\tRootSta: CERcvd%c MultCERcvd%c UERcvd%c MultUERcvd%c\n"
- "\t\t\t FirstFatal%c NonFatalMsg%c FatalMsg%c IntMsg %d\n",
+ "\t\t\t FirstFatal%c NonFatalMsg%c FatalMsg%c IntMsgNum %d\n",
FLAG(l, PCI_ERR_ROOT_COR_RCV),
FLAG(l, PCI_ERR_ROOT_MULTI_COR_RCV),
FLAG(l, PCI_ERR_ROOT_UNCOR_RCV),
@@ -221,7 +221,7 @@ static void cap_dpc(struct device *d, int where)
return;

l = get_conf_word(d, where + PCI_DPC_CAP);
- printf("\t\tDpcCap:\tINT Msg #%d, RPExt%c PoisonedTLP%c SwTrigger%c RP PIO Log %d, DL_ActiveErr%c\n",
+ printf("\t\tDpcCap:\tIntMsgNum %d, RPExt%c PoisonedTLP%c SwTrigger%c RP PIO Log %d, DL_ActiveErr%c\n",
PCI_DPC_CAP_INT_MSG(l), FLAG(l, PCI_DPC_CAP_RP_EXT), FLAG(l, PCI_DPC_CAP_TLP_BLOCK),
FLAG(l, PCI_DPC_CAP_SW_TRIGGER), PCI_DPC_CAP_RP_LOG(l), FLAG(l, PCI_DPC_CAP_DL_ACT_ERR));

@@ -371,7 +371,7 @@ cap_sriov(struct device *d, int where)
return;

l = get_conf_long(d, where + PCI_IOV_CAP);
- printf("\t\tIOVCap:\tMigration%c 10BitTagReq%c Interrupt Message Number: %03x\n",
+ printf("\t\tIOVCap:\tMigration%c 10BitTagReq%c IntMsgNum %d\n",
FLAG(l, PCI_IOV_CAP_VFM), FLAG(l, PCI_IOV_CAP_VF_10BIT_TAG_REQ), PCI_IOV_CAP_IMN(l));
w = get_conf_word(d, where + PCI_IOV_CTRL);
printf("\t\tIOVCtl:\tEnable%c Migration%c Interrupt%c MSE%c ARIHierarchy%c 10BitTagReq%c\n",
@@ -1394,7 +1394,7 @@ cap_doe(struct device *d, int where)
printf("\t\tDOECap: IntSup%c\n",
FLAG(l, PCI_DOE_CAP_INT_SUPP));
if (l & PCI_DOE_CAP_INT_SUPP)
- printf("\t\t\tInterrupt Message Number %03x\n",
+ printf("\t\t\tIntMsgNum %d\n",
PCI_DOE_CAP_INT_MSG(l));

l = get_conf_long(d, where + PCI_DOE_CTL);
--
2.34.1