diff mbox

[pciutils] Improve MSI and MSI-X display

Message ID 20090513214353.GM15360@parisc-linux.org (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Matthew Wilcox May 13, 2009, 9:43 p.m. UTC
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 <willy@linux.intel.com>

Comments

Martin Mareš July 4, 2009, 1:30 p.m. UTC | #1
Hello!

> There are several ways I think the MSI and MSI-X capabilities could be
> reported better in lspci.

Thanks, applied.

				Have a nice fortnight
diff mbox

Patch

diff --git a/ls-caps.c b/ls-caps.c
index 3e01f2c..c06bcb0 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;