DevStack¶
pci-sim is built into the Cyborg DevStack plugin. To enable it, assign each
PF a personality and an owning service in PCI_SIM_SERVICE_MAP:
enable_plugin cyborg https://opendev.org/openstack/cyborg
PCI_SIM_SERVICE_MAP=0:uart:nova,1:uart:cyborg
A ready-to-use sample configuration is provided in the Cyborg repository at
devstack/local-conf.pci-sim.sample.
Plugin settings¶
PCI_SIM_BUILDBuild and install the module during the DevStack
installphase. Defaults toTrue.PCI_SIM_LOADLoad
fake_pci_sriovafter building it. Defaults toTrue.PCI_SIM_ALLOW_UNSAFE_INTERRUPTSAllow VFIO on hosts without interrupt remapping support by setting
vfio_iommu_type1.allow_unsafe_interruptsbefore probing the fake VFs. Defaults toTruefor nested/devstack test environments.PCI_SIM_NUM_VFSNumber of virtual functions to enable on each
uartPF (0through7, default4). This count does not select the personality.PCI_SIM_SERVICE_MAPAn empty or unset map disables pci-sim (the default). A nonempty map enables pci-sim and creates one PF per entry. For example, to create two PFs, set this in
local.conf:PCI_SIM_SERVICE_MAP=0:uart:nova,1:mdev:cyborg
Nova receives the UART VFs from PF0 and Cyborg manages the mdev parent on PF1. Use one
index:personality:serviceentry per configured PF, separated by commas without spaces. Indices must be consecutive starting at zero, with at most 16 PFs. PF0 has the lowest PCI address; the entries themselves may appear in any order. Supported assignments areuart:nova,uart:cyborgandmdev:cyborg.For
uart:nova, the plugin writes Nova’s[pci] device_specandaliasoptions using exact VF addresses andmanaged="no". Foruart:cyborg, it enables Cyborg’spci_driverand adds the VF addresses to[pci] passthrough_whitelist.PCI_SIM_MDEV_TYPEThe type Cyborg configures on each
mdev:cyborgparent. Defaults tofake_pci_sriov_pf-sim_accel_small.PCI_SIM_MDEV_INSTANCESMaximum number of small-type mdev instances per
mdev:cyborgPF. Set this to a positive integer (default8). The large-type limit is one quarter of this value, rounded down, with a minimum of one. With the default setting, each parent advertises 8 small or 2 large instances.PCI_SIM_NOVA_PCI_IN_PLACEMENTWhen Nova PCI configuration is enabled, configure
[pci] report_in_placementand[filter_scheduler] pci_in_placement. Defaults toTrue.PCI_SIM_CREATE_TEST_FLAVORSCreate convenience test resources during
stack/test-config. Defaults toTrue. When Nova PCI configuration is enabled, the plugin creates a flavor named byPCI_SIM_NOVA_FLAVOR_NAMEwithpci_passthrough:alias. When Cyborg PCI configuration is enabled, the plugin creates a Cyborg device profile named byPCI_SIM_CYBORG_DEVICE_PROFILE_NAMEand a flavor named byPCI_SIM_CYBORG_FLAVOR_NAMEwithaccel:device_profile.PCI_SIM_MODULE_ARGSOptional extra arguments passed to
modprobe fake_pci_sriovwhenPCI_SIM_LOAD=True. Do not includenum_pfshere; the plugin derives it fromPCI_SIM_SERVICE_MAP.