ff0b67d1c8
Adding code to support VFIO mapping (primary processes only). Most of the things are done via ioctl() calls on either /dev/vfio/vfio (the container) or a /dev/vfio/$GROUP_NR (IOMMU group). In a nutshell, the code does the following: 1. creates a VFIO container (an entity that allows sharing IOMMU DMA mappings between devices) 2. checks if a given PCI device is a member of an IOMMU group (if it's not, this indicates that the device isn't bound to VFIO) 3. calls open() the group file to obtain a group fd 4. checks if the group is viable (that is, if all the devices in the same IOMMU group are either bound to VFIO or not bound to anything) 5. adds the group to a container 6. sets up DMA mappings (only done once, mapping whole DPDK hugepage memory for DMA, with a 1:1 correspondence of IOVA to PA) 7. gets the actual PCI device fd from the group fd (can fail, which simply means that this particular device is not bound to VFIO) 8. maps BARs (MSI-X BAR cannot be mmaped, so skipping it) 9. sets up interrupt structures (but not enables them!) 10. enables PCI bus mastering Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com> Tested-by: HuilongX Xu <huilongx.xu@intel.com> Tested-by: Waterman Cao <waterman.cao@intel.com> Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com> |
||
---|---|---|
.. | ||
librte_acl | ||
librte_cmdline | ||
librte_distributor | ||
librte_eal | ||
librte_ether | ||
librte_hash | ||
librte_ivshmem | ||
librte_kni | ||
librte_kvargs | ||
librte_lpm | ||
librte_malloc | ||
librte_mbuf | ||
librte_mempool | ||
librte_meter | ||
librte_net | ||
librte_pmd_e1000 | ||
librte_pmd_ixgbe | ||
librte_pmd_pcap | ||
librte_pmd_ring | ||
librte_pmd_virtio | ||
librte_pmd_vmxnet3 | ||
librte_pmd_xenvirt | ||
librte_power | ||
librte_ring | ||
librte_sched | ||
librte_timer | ||
Makefile |