diff --git a/doc/source/contributor/index.rst b/doc/source/contributor/index.rst index 5b6e0b8f9292..437b468e209a 100644 --- a/doc/source/contributor/index.rst +++ b/doc/source/contributor/index.rst @@ -116,6 +116,8 @@ be Python code. All new code needs to be validated somehow. * :doc:`/contributor/testing/down-cell` + * :doc:`/contributor/testing/pci-passthrough-sriov` + * **Profiling Guides**: These are guides to profiling nova. * :doc:`/contributor/testing/eventlet-profiling` @@ -131,6 +133,7 @@ be Python code. All new code needs to be validated somehow. testing/zero-downtime-upgrade testing/down-cell testing/eventlet-profiling + testing/pci-passthrough-sriov The Nova API ============ diff --git a/doc/source/contributor/testing/pci-passthrough-sriov.rst b/doc/source/contributor/testing/pci-passthrough-sriov.rst new file mode 100644 index 000000000000..f453c262c009 --- /dev/null +++ b/doc/source/contributor/testing/pci-passthrough-sriov.rst @@ -0,0 +1,65 @@ +======================================================== +Testing PCI passthrough and SR-IOV with emulated PCI NIC +======================================================== +Testing nova PCI and SR-IOV device handling in devstack in general requires +special hardware available in the devstack machine or VM. + +Since libvirt 9.3.0 and qemu 8.0.0 the situation is a lot simpler as qemu +is now capable of emulating and intel igb NIC that supports SR-IOV. So +devstack can be run in a VM that has one or more SR-IOV capable NIC while the +host running the devstack VM does not require any special hardware just recent +libvirt and qemu installed. + +.. note:: + The emulated igb device used in this doc only useful for testing purposes. + While network connectivity will work through both the PF and the VF + interfaces the networking performance will be limited by the qemu + emulation. + +Add SR-IOV capable igb NIC to a devstack VM +------------------------------------------- +You can add an igb NIC to the devstack VM definition: + +.. code-block:: bash + + virsh attach-interface --type network --source --model igb --config + +The SR-IOV capability also requires an IOMMU device and split APIC defined in +the domain as well as the q35 machine type. +So make sure you have the following sections: + +.. code-block:: xml + + + ... + + + + + +.. code-block:: xml + + + .. + + + +.. code-block:: xml + + + ... + hvm + + +Then enable IOMMU in the devstack VM by adding ``intel_iommu=on`` to the kernel +command line. + +Using nova to get a VM with SR-IOV capable igb NICs +--------------------------------------------------- +If you are using nova 2025.1 (Epoxy) or newer then you can use the +``hw_machine_type=q35``, ``hw_vif_model=igb``, and ``hw_iommu_model=intel`` +image properties to request a VM with igb NICs. + +Configuring your devstack VM for SR-IOV +--------------------------------------- +Follow the `guide `_;