]> mj.ucw.cz Git - pciutils.git/commitdiff
Improve MSI and MSI-X display
authorMatthew Wilcox <matthew@wil.cx>
Wed, 13 May 2009 21:43:53 +0000 (15:43 -0600)
committerMartin Mares <mj@ucw.cz>
Sat, 4 Jul 2009 13:30:02 +0000 (15:30 +0200)
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>
ls-caps.c

index 3e01f2c30e2bc554427d260d7059f72deffba7f7..1a35d61bc4ff8a4eea72e96fb29204766e17571d 100644 (file)
--- 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;