render / rpms / libvirt

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