When a VM has been assigned a number of PCIe devices behind a common PCIe switch and the VM intends to use peer-to-peer (P2P) transfers between the devices, it is useful to be able to more report the apparent PCIe bandwidth so it reflects the real handwidth of the underlying hardware. This allows software in the VM (such as NCCL[1]) to make better decisions about whether to use P2P or not. The future QEMU 11.2[1] will support new upstream and downstream port models that have configurable speed and width properties and extend the existing root port model to support the same options. If supported by QEMU, prefer the new upstream and downstream port models, and support new attributes to set the speed and width. Patch 1 (tests: Update QEMU 11.2.0 x86_64 caps for generic PCIe switch ports qemu: add capabilities for generic PCIe switch port devices) should be replaced with a more comprehensive refresh of the QEMU capabilities, and is only included here so tests continue to pass. David [1] See QEMU commits 432b3f707a3c (hw/pci-bridge: Make speed and width for PCIe ports non-experimental) and 73962cc5f06a (hw/pci-bridge: Add generic PCIe switch upstream and downstream ports). David Vrabel (6): tests: Update QEMU 11.2.0 x86_64 caps for generic PCIe switch ports qemu: add capabilities for generic PCIe switch port devices qemu: support generic PCIe switch port models qemu: add capabilities for pcie-root-port speed and width properties qemu: add PCIe link speed and width attributes NEWS: mention generic PCIe switch ports and link speed/width NEWS.rst | 16 ++++ docs/formatdomain.rst | 28 ++++++ src/conf/domain_conf.c | 42 +++++++++ src/conf/domain_conf.h | 32 +++++++ src/conf/schemas/domaincommon.rng | 26 ++++++ src/libvirt_private.syms | 4 + src/qemu/qemu_capabilities.c | 10 ++ src/qemu/qemu_capabilities.h | 6 ++ src/qemu/qemu_command.c | 32 +++++++ src/qemu/qemu_domain_address.c | 10 +- src/qemu/qemu_validate.c | 80 +++++++++++++++- .../caps_11.2.0_x86_64.replies | 12 ++- .../caps_11.2.0_x86_64.xml | 4 + .../autoindex.x86_64-latest.args | 22 ++--- .../autoindex.x86_64-latest.xml | 22 ++--- .../pci-bridge-speed.x86_64-latest.err | 1 + tests/qemuxmlconfdata/pci-bridge-speed.xml | 18 ++++ .../pcie-expander-bus.x86_64-latest.args | 66 +++++++------- .../pcie-expander-bus.x86_64-latest.xml | 66 +++++++------- ...cie-root-port-nohotplug.x86_64-latest.args | 8 +- ...pcie-root-port-nohotplug.x86_64-latest.xml | 8 +- ...-root-port-speed-ioh3420.x86_64-latest.err | 1 + .../pcie-root-port-speed-ioh3420.xml | 19 ++++ ...ie-root-port-speed-width.x86_64-11.0.0.err | 1 + ...e-root-port-speed-width.x86_64-latest.args | 37 ++++++++ ...ie-root-port-speed-width.x86_64-latest.xml | 48 ++++++++++ .../pcie-root-port-speed-width.xml | 23 +++++ ...tream-port-model-generic.x86_64-11.1.0.err | 1 + ...ream-port-model-generic.x86_64-latest.args | 47 ++++++++++ ...tream-port-model-generic.x86_64-latest.xml | 91 +++++++++++++++++++ ...e-switch-downstream-port-model-generic.xml | 44 +++++++++ ...tream-port-width-xio3130.x86_64-latest.err | 1 + ...e-switch-downstream-port-width-xio3130.xml | 23 +++++ ...-switch-downstream-port.x86_64-11.1.0.args | 47 ++++++++++ ...e-switch-downstream-port.x86_64-11.1.0.xml | 91 +++++++++++++++++++ ...-switch-downstream-port.x86_64-latest.args | 16 ++-- ...e-switch-downstream-port.x86_64-latest.xml | 16 ++-- ...tream-port-model-generic.x86_64-11.1.0.err | 1 + ...ream-port-model-generic.x86_64-latest.args | 42 +++++++++ ...tream-port-model-generic.x86_64-latest.xml | 67 ++++++++++++++ ...cie-switch-upstream-port-model-generic.xml | 38 ++++++++ ...ie-switch-upstream-port.x86_64-11.1.0.args | 42 +++++++++ ...cie-switch-upstream-port.x86_64-11.1.0.xml | 66 ++++++++++++++ ...ie-switch-upstream-port.x86_64-latest.args | 2 +- ...cie-switch-upstream-port.x86_64-latest.xml | 2 +- tests/qemuxmlconftest.c | 11 +++ 46 files changed, 1170 insertions(+), 120 deletions(-) create mode 100644 tests/qemuxmlconfdata/pci-bridge-speed.x86_64-latest.err create mode 100644 tests/qemuxmlconfdata/pci-bridge-speed.xml create mode 100644 tests/qemuxmlconfdata/pcie-root-port-speed-ioh3420.x86_64-latest.err create mode 100644 tests/qemuxmlconfdata/pcie-root-port-speed-ioh3420.xml create mode 100644 tests/qemuxmlconfdata/pcie-root-port-speed-width.x86_64-11.0.0.err create mode 100644 tests/qemuxmlconfdata/pcie-root-port-speed-width.x86_64-latest.args create mode 100644 tests/qemuxmlconfdata/pcie-root-port-speed-width.x86_64-latest.xml create mode 100644 tests/qemuxmlconfdata/pcie-root-port-speed-width.xml create mode 100644 tests/qemuxmlconfdata/pcie-switch-downstream-port-model-generic.x86_64-11.1.0.err create mode 100644 tests/qemuxmlconfdata/pcie-switch-downstream-port-model-generic.x86_64-latest.args create mode 100644 tests/qemuxmlconfdata/pcie-switch-downstream-port-model-generic.x86_64-latest.xml create mode 100644 tests/qemuxmlconfdata/pcie-switch-downstream-port-model-generic.xml create mode 100644 tests/qemuxmlconfdata/pcie-switch-downstream-port-width-xio3130.x86_64-latest.err create mode 100644 tests/qemuxmlconfdata/pcie-switch-downstream-port-width-xio3130.xml create mode 100644 tests/qemuxmlconfdata/pcie-switch-downstream-port.x86_64-11.1.0.args create mode 100644 tests/qemuxmlconfdata/pcie-switch-downstream-port.x86_64-11.1.0.xml create mode 100644 tests/qemuxmlconfdata/pcie-switch-upstream-port-model-generic.x86_64-11.1.0.err create mode 100644 tests/qemuxmlconfdata/pcie-switch-upstream-port-model-generic.x86_64-latest.args create mode 100644 tests/qemuxmlconfdata/pcie-switch-upstream-port-model-generic.x86_64-latest.xml create mode 100644 tests/qemuxmlconfdata/pcie-switch-upstream-port-model-generic.xml create mode 100644 tests/qemuxmlconfdata/pcie-switch-upstream-port.x86_64-11.1.0.args create mode 100644 tests/qemuxmlconfdata/pcie-switch-upstream-port.x86_64-11.1.0.xml -- 2.43.0