Files
cyborg/doc/dictionary.txt
Sean Mooney 7b1fc570bd devstack: add pci-sim fake SR-IOV PCI passthrough test fixture
Testing Cyborg's pci_driver and Nova PCI passthrough normally requires
physical SR-IOV hardware. This change introduces pci-sim, an out-of-tree
Linux kernel module (fake_pci_sriov) that creates fake SR-IOV PCI devices
whose virtual functions can be bound to VFIO and assigned to QEMU guests.
This makes it possible to exercise the full Nova and Cyborg PCI passthrough
control plane, including device enumeration, VF assignment, and VFIO
passthrough to CirrOS guests, in a standard devstack VM with no physical
SR-IOV hardware present.

pci-sim/
  Source for the fake_pci_sriov out-of-tree kernel module. The module
  creates one fake PCI host bridge per PF, each with software-emulated
  VFs backed by a 16550-style UART loopback payload. Build artifacts are
  excluded via .gitignore. The directory is excluded from Python wheels
  and sdists via [tool.setuptools.packages.find].

devstack/
  lib/pci_sim provides functions to build, load, configure, and unload
  the module. All paths are expressed relative to CYBORG_DIR so they
  resolve correctly within the cyborg checkout.

  devstack/settings gains a new ENABLE_PCI_SIM master toggle
  (default False) and the full set of PCI_SIM_* variables to control
  the fake PCI topology and service integration.
  PCI_SIM_CONFIGURE_NOVA_PCI and PCI_SIM_CONFIGURE_CYBORG_PCI are both
  defaulted to ENABLE_PCI_SIM but provide a explicy opt out if required.

  plugin.sh drives the pci-sim lifecycle alongside cyborg's own phases.
  The pci-sim cyborg service configuration is applied before start_cyborg
  in the extra phase so the agent picks up pci_driver and
  passthrough_whitelist on first start.

  devstack/local-conf.pci-sim.sample provides a ready-to-use local.conf
  for a two-PF, four-VF-per-PF topology with both Nova and Cyborg
  integrations enabled.

tools/
  check-kernel-config.sh validates the running kernel's config against
  the requirements for fake_pci_sriov before attempting a build.
  run-devstack-serial-echo-test.sh creates test VMs using the pci-sim
  flavors and validates the UART echo path inside a CirrOS guest.

doc/source/contributor/pci-sim/
  New contributor documentation covering build instructions, devstack
  setup, plugin settings, testing procedures, and kernel config
  requirements. Linked from the contributor index.

Assisted-By: pi gpt-5.5
Assisted-By: pi sonnet-4.6
Change-Id: I14dba5d0de833c9f2df28478daacbf8250de2127
Signed-off-by: Sean Mooney <work@seanmooney.info>
2026-06-15 10:49:23 +01:00

3 lines
9 B
Plaintext