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. Newer versions[1] of QEMU 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. David [1] See patches here: https://patchew.org/QEMU/20260908155223.164787-1-david.vrabel@nutanix.com/ David Vrabel (2): qemu: support generic PCIe switch port models qemu: add PCIe link speed and width attributes docs/formatdomain.rst | 12 + src/conf/domain_conf.c | 24 ++ src/conf/domain_conf.h | 5 + src/conf/schemas/domaincommon.rng | 12 + src/qemu/qemu_capabilities.c | 256 +++++++++--------- src/qemu/qemu_capabilities.h | 252 ++++++++--------- src/qemu/qemu_command.c | 46 ++++ src/qemu/qemu_domain_address.c | 10 +- src/qemu/qemu_validate.c | 91 ++++++- .../caps_11.1.0_x86_64.replies | 4 +- .../caps_11.1.0_x86_64.xml | 2 + ...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 ++ ...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 +++ ...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 +++ tests/qemuxmlconftest.c | 3 + 21 files changed, 902 insertions(+), 252 deletions(-) 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-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-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 -- 2.43.0