6d3351
From 7cdf18b541dfdbbbe4ed1e35179dd41c0d473648 Mon Sep 17 00:00:00 2001
6d3351
Message-Id: <7cdf18b541dfdbbbe4ed1e35179dd41c0d473648@dist-git>
6d3351
From: Shivaprasad G Bhat <sbhat@linux.vnet.ibm.com>
6d3351
Date: Mon, 17 Apr 2017 17:16:44 -0400
6d3351
Subject: [PATCH] pci: recognize/report GEN4 (PCIe 4.0) card 16GT/s Link speed
6d3351
6d3351
Without this added enum value, nodedev-dumpxml of a GEN4 (PCIe 4.0)
6d3351
card will fail (due to the unrecognized link speed), and since
6d3351
nodedev-detach and nodedev-reattach internally do a dumpxml+parse,
6d3351
they will also fail. With this patch, all those operations succeed.
6d3351
6d3351
Resolves: https://bugzilla.redhat.com/1442831
6d3351
6d3351
Signed-off-by: Shivaprasad G Bhat <sbhat@linux.vnet.ibm.com>
6d3351
(cherry picked from commit 8e09663f7ff70b10a560746f17897d2c67c8460d)
6d3351
---
6d3351
 src/util/virpci.c | 4 ++--
6d3351
 src/util/virpci.h | 1 +
6d3351
 2 files changed, 3 insertions(+), 2 deletions(-)
6d3351
6d3351
diff --git a/src/util/virpci.c b/src/util/virpci.c
6d3351
index 65c108f2e..c89b94b5f 100644
6d3351
--- a/src/util/virpci.c
6d3351
+++ b/src/util/virpci.c
6d3351
@@ -53,7 +53,7 @@ VIR_LOG_INIT("util.pci");
6d3351
 #define PCI_ADDR_LEN 13 /* "XXXX:XX:XX.X" */
6d3351
 
6d3351
 VIR_ENUM_IMPL(virPCIELinkSpeed, VIR_PCIE_LINK_SPEED_LAST,
6d3351
-              "", "2.5", "5", "8")
6d3351
+              "", "2.5", "5", "8", "16")
6d3351
 
6d3351
 VIR_ENUM_IMPL(virPCIStubDriver, VIR_PCI_STUB_DRIVER_LAST,
6d3351
               "none",
6d3351
@@ -147,7 +147,7 @@ struct _virPCIDeviceList {
6d3351
 #define PCI_EXP_DEVCAP          0x4     /* Device capabilities */
6d3351
 #define PCI_EXP_DEVCAP_FLR     (1<<28)  /* Function Level Reset */
6d3351
 #define PCI_EXP_LNKCAP          0xc     /* Link Capabilities */
6d3351
-#define PCI_EXP_LNKCAP_SPEED    0x0000f /* Maximum Link Speed */
6d3351
+#define PCI_EXP_LNKCAP_SPEED    0x0001f /* Maximum Link Speed */
6d3351
 #define PCI_EXP_LNKCAP_WIDTH    0x003f0 /* Maximum Link Width */
6d3351
 #define PCI_EXP_LNKSTA          0x12    /* Link Status */
6d3351
 #define PCI_EXP_LNKSTA_SPEED    0x000f  /* Negotiated Link Speed */
6d3351
diff --git a/src/util/virpci.h b/src/util/virpci.h
6d3351
index 8637c2c68..570684e75 100644
6d3351
--- a/src/util/virpci.h
6d3351
+++ b/src/util/virpci.h
6d3351
@@ -58,6 +58,7 @@ typedef enum {
6d3351
     VIR_PCIE_LINK_SPEED_25,
6d3351
     VIR_PCIE_LINK_SPEED_5,
6d3351
     VIR_PCIE_LINK_SPEED_8,
6d3351
+    VIR_PCIE_LINK_SPEED_16,
6d3351
     VIR_PCIE_LINK_SPEED_LAST
6d3351
 } virPCIELinkSpeed;
6d3351
 
6d3351
-- 
6d3351
2.12.2
6d3351