feat: DWC MSI and SR-IOV support#321
Merged
Merged
Conversation
…region only when enable bit is 1'b1)
…des, will be restricted to dwc_pcie in future commits)
…-port each using dwc-msi in imx8mp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PCIe device vbdf-bdf remap setting
The mapping between vbdf and bdf can be specified in the configuration file:
bdf => vbdf, Note that VBDF must comply with the current PCIe system specification; otherwise, the device may not be detected by the virtual machine.DWC PCIe MSI support
#232
Two features related to DWC PCIe support:
dwc_msi: enables PCI-MSI virtualization for DesignWare (DWC) PCIe controllers, allowing multiple VMs to share a single DWC controller.pci_init_delay: defers PCI initialization in hvisor when firmware (e.g. U-Boot) does not perform PCI enumeration.Feature 1:
dwc_msiThis feature enables MSI support for DWC PCIe controllers and allows multiple VMs to share a single DWC controller using PCI-MSI.
Usage
When enabling
dwc_msi, the physical interrupt number used for PCI-MSI must be specified in the corresponding board.rs:Feature 2:
pci_init_delayThis feature is intended for platforms where:
When enabled, hvisor will defer PCI initialization until zone0 completes board-level initialization.
Note
Please ensure that the PCI BAR regions are included in
BOARD_PHYSMEM_LISTin board.rs.This is required because:
mmio_perform_accessmust be able to access these memory regionsSR-IOV support
When
sriovfeature is enabledhvisor_pci_initscans device ext caps, records SR-IOV related information, and adds VFs to the device list if any SR-IOV capable device is present.directmode, for the root VM, ensure PF's VBDF equals its BDF (this is the original system setting), and similarly, ensure VFs' VBDF equals BDF (based on this convention, without modifying the VF's BDF offset in the cap). When assigning VFs to other VMs, make sure VBDF complies with the current PCIe specification.General procedure
Assume the system has a PF NIC (eth1) that supports SR-IOV and two VFs are enabled: one assigned to a non-root VM (eth2), and one assigned to the root VM (eth3).
Before starting the non-root VM, the eth2 VF must be unbound from its driver and bound to
pci-stub.Additionally, to allow communication between the two VFs, it is recommended to place eth3 in a separate network namespace:
When
sriovfeature is disabledhvisor_pci_initdoes not scan or record VF information.