From: Matthew Wilcox Date: Wed, 13 May 2009 21:43:53 +0000 (-0600) Subject: Improve MSI and MSI-X display X-Git-Tag: v3.1.3~11 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=04885ef71099072b54bba3a6f47e3fd6590e3a23;p=pciutils.git Improve MSI and MSI-X display There are several ways I think the MSI and MSI-X capabilities could be reported better in lspci. Enable is at the beginning of the MSI-X report, but the end of the MSI report. Because Enabled is perhaps the most important thing, I moved it to the start. The TabSize reported for MSI-X is perhaps a little obscure. I feel 'Count' works better (and is then the same as MSI). We can't readily tell which of the MSI-X capabilities have been programmed, so we can't report how many have been enabled. Both capabilities report 'Mask'. Unfortunately, in MSI, it indicates whether the device supports per-vector masking, and in MSI-X it indicates whether all the vectors are masked. This patch changes both; MSI reports 'Maskable' and MSI-X reports 'Masked'. All these changes combine to turn the report from this: Capabilities: [60] MSI: Mask+ 64bit+ Count=1/8 Enable- Capabilities: [78] MSI-X: Enable+ Mask- TabSize=8 to this: Capabilities: [60] MSI: Enable- Count=1/8 Maskable+ 64bit+ Capabilities: [78] MSI-X: Enable+ Count=8 Masked- which I find much less confusing when juxtaposed. Signed-off-by: Matthew Wilcox --- diff --git a/ls-caps.c b/ls-caps.c index 3e01f2c..1a35d61 100644 --- a/ls-caps.c +++ b/ls-caps.c @@ -591,12 +591,12 @@ cap_msi(struct device *d, int where, int cap) u32 t; u16 w; - printf("MSI: Mask%c 64bit%c Count=%d/%d Enable%c\n", - FLAG(cap, PCI_MSI_FLAGS_MASK_BIT), - FLAG(cap, PCI_MSI_FLAGS_64BIT), + printf("MSI: Enable%c Count=%d/%d Maskable%c 64bit%c\n", + FLAG(cap, PCI_MSI_FLAGS_ENABLE), 1 << ((cap & PCI_MSI_FLAGS_QSIZE) >> 4), 1 << ((cap & PCI_MSI_FLAGS_QMASK) >> 1), - FLAG(cap, PCI_MSI_FLAGS_ENABLE)); + FLAG(cap, PCI_MSI_FLAGS_MASK_BIT), + FLAG(cap, PCI_MSI_FLAGS_64BIT)); if (verbose < 2) return; is64 = cap & PCI_MSI_FLAGS_64BIT; @@ -1095,10 +1095,10 @@ cap_msix(struct device *d, int where, int cap) { u32 off; - printf("MSI-X: Enable%c Mask%c TabSize=%d\n", + printf("MSI-X: Enable%c Count=%d Masked%c\n", FLAG(cap, PCI_MSIX_ENABLE), - FLAG(cap, PCI_MSIX_MASK), - (cap & PCI_MSIX_TABSIZE) + 1); + (cap & PCI_MSIX_TABSIZE) + 1, + FLAG(cap, PCI_MSIX_MASK)); if (verbose < 2 || !config_fetch(d, where + PCI_MSIX_TABLE, 8)) return;