[PATCH] vircpi: Add PCIe 5.0 and 6.0 link speeds

Michal Privoznik posted 1 patch 1 year, 9 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/26bae2f36a9c76a6f78ea68d91370b62e9d1b317.1657284163.git.mprivozn@redhat.com
src/util/virpci.c | 2 +-
src/util/virpci.h | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
[PATCH] vircpi: Add PCIe 5.0 and 6.0 link speeds
Posted by Michal Privoznik 1 year, 9 months ago
The PCIe 5.0 and PCIe 6.0 standards define new link speeds:
32GT/s and 64GT/s, respectively. Update our internal enum to
include these new speeds. Otherwise we format incorrect XML:

  <pci-express>
    <link validity='cap' port='0' speed='(null)' width='16'/>
    <link validity='sta' speed='16' width='16'/>
  </pci-express>

Like all "good" specifications, these are also locked behind a
login portal. But we can look at pciutils' source code: [1] and
[2].

1: https://git.kernel.org/pub/scm/utils/pciutils/pciutils.git/commit/ls-caps.c?id=caca31a0eea41c7b051705704c1158fddc02fbd2
2: https://git.kernel.org/pub/scm/utils/pciutils/pciutils.git/commit/ls-caps.c?id=5bdf63b6b1bc35b59c4b3f47f7ca83ca1868155b

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2105231
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
 src/util/virpci.c | 2 +-
 src/util/virpci.h | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/util/virpci.c b/src/util/virpci.c
index 03d1d7b074..7800966963 100644
--- a/src/util/virpci.c
+++ b/src/util/virpci.c
@@ -45,7 +45,7 @@ VIR_LOG_INIT("util.pci");
 
 VIR_ENUM_IMPL(virPCIELinkSpeed,
               VIR_PCIE_LINK_SPEED_LAST,
-              "", "2.5", "5", "8", "16",
+              "", "2.5", "5", "8", "16", "32", "64"
 );
 
 VIR_ENUM_IMPL(virPCIStubDriver,
diff --git a/src/util/virpci.h b/src/util/virpci.h
index b9b9cd7b34..4d9193f24e 100644
--- a/src/util/virpci.h
+++ b/src/util/virpci.h
@@ -83,6 +83,8 @@ typedef enum {
     VIR_PCIE_LINK_SPEED_5,
     VIR_PCIE_LINK_SPEED_8,
     VIR_PCIE_LINK_SPEED_16,
+    VIR_PCIE_LINK_SPEED_32,
+    VIR_PCIE_LINK_SPEED_64,
     VIR_PCIE_LINK_SPEED_LAST
 } virPCIELinkSpeed;
 
-- 
2.35.1
Re: [PATCH] vircpi: Add PCIe 5.0 and 6.0 link speeds
Posted by Ján Tomko 1 year, 9 months ago
On a Friday in 2022, Michal Privoznik wrote:
>The PCIe 5.0 and PCIe 6.0 standards define new link speeds:
>32GT/s and 64GT/s, respectively. Update our internal enum to
>include these new speeds. Otherwise we format incorrect XML:
>
>  <pci-express>
>    <link validity='cap' port='0' speed='(null)' width='16'/>
>    <link validity='sta' speed='16' width='16'/>
>  </pci-express>
>
>Like all "good" specifications, these are also locked behind a
>login portal. But we can look at pciutils' source code: [1] and
>[2].
>
>1: https://git.kernel.org/pub/scm/utils/pciutils/pciutils.git/commit/ls-caps.c?id=caca31a0eea41c7b051705704c1158fddc02fbd2
>2: https://git.kernel.org/pub/scm/utils/pciutils/pciutils.git/commit/ls-caps.c?id=5bdf63b6b1bc35b59c4b3f47f7ca83ca1868155b
>
>Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2105231
>Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
>---
> src/util/virpci.c | 2 +-
> src/util/virpci.h | 2 ++
> 2 files changed, 3 insertions(+), 1 deletion(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano