]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
pci: recognize/report GEN4 (PCIe 4.0) card 16GT/s Link speed
authorShivaprasad G Bhat <sbhat@linux.vnet.ibm.com>
Wed, 1 Mar 2017 09:55:58 +0000 (03:55 -0600)
committerLaine Stump <laine@laine.org>
Thu, 13 Apr 2017 17:23:56 +0000 (13:23 -0400)
Without this added enum value, nodedev-dumpxml of a GEN4 (PCIe 4.0)
card will fail (due to the unrecognized link speed), and since
nodedev-detach and nodedev-reattach internally do a dumpxml+parse,
they will also fail. With this patch, all those operations succeed.

Signed-off-by: Shivaprasad G Bhat <sbhat@linux.vnet.ibm.com>
src/util/virpci.c
src/util/virpci.h

index 65c108f2e59f197a49ec6af1d3e3f23f6512b5c9..c89b94b5f177d120f3f92957c9a596dad7db3b76 100644 (file)
@@ -53,7 +53,7 @@ VIR_LOG_INIT("util.pci");
 #define PCI_ADDR_LEN 13 /* "XXXX:XX:XX.X" */
 
 VIR_ENUM_IMPL(virPCIELinkSpeed, VIR_PCIE_LINK_SPEED_LAST,
-              "", "2.5", "5", "8")
+              "", "2.5", "5", "8", "16")
 
 VIR_ENUM_IMPL(virPCIStubDriver, VIR_PCI_STUB_DRIVER_LAST,
               "none",
@@ -147,7 +147,7 @@ struct _virPCIDeviceList {
 #define PCI_EXP_DEVCAP          0x4     /* Device capabilities */
 #define PCI_EXP_DEVCAP_FLR     (1<<28)  /* Function Level Reset */
 #define PCI_EXP_LNKCAP          0xc     /* Link Capabilities */
-#define PCI_EXP_LNKCAP_SPEED    0x0000f /* Maximum Link Speed */
+#define PCI_EXP_LNKCAP_SPEED    0x0001f /* Maximum Link Speed */
 #define PCI_EXP_LNKCAP_WIDTH    0x003f0 /* Maximum Link Width */
 #define PCI_EXP_LNKSTA          0x12    /* Link Status */
 #define PCI_EXP_LNKSTA_SPEED    0x000f  /* Negotiated Link Speed */
index 8637c2c68513e4a06f367da0667d95e2495ddbed..570684e750284bc8a85053e6b76f3c73a1fc11d0 100644 (file)
@@ -58,6 +58,7 @@ typedef enum {
     VIR_PCIE_LINK_SPEED_25,
     VIR_PCIE_LINK_SPEED_5,
     VIR_PCIE_LINK_SPEED_8,
+    VIR_PCIE_LINK_SPEED_16,
     VIR_PCIE_LINK_SPEED_LAST
 } virPCIELinkSpeed;