numam-dpdk/lib
Anatoly Burakov ff0b67d1c8 vfio: DMA mapping
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>
2014-06-16 15:02:10 +02:00
..
librte_acl acl: new library 2014-06-14 01:29:45 +02:00
librte_cmdline remove trailing whitespaces 2014-06-11 00:29:34 +02:00
librte_distributor distributor: new packet distributor library 2014-06-12 15:47:04 +02:00
librte_eal vfio: DMA mapping 2014-06-16 15:02:10 +02:00
librte_ether ethdev: Tx rate limitation for queue and VF 2014-06-11 15:56:19 +02:00
librte_hash remove trailing whitespaces 2014-06-11 00:29:34 +02:00
librte_ivshmem remove trailing whitespaces 2014-06-11 00:29:34 +02:00
librte_kni remove trailing whitespaces 2014-06-11 00:29:34 +02:00
librte_kvargs devargs: use a comma instead of semicolon to separate key/values 2014-04-10 15:50:11 +02:00
librte_lpm lpm: introduce rte_lpm_lookupx4 2014-06-12 12:11:39 +02:00
librte_malloc remove trailing whitespaces 2014-06-11 00:29:34 +02:00
librte_mbuf remove trailing whitespaces 2014-06-11 00:29:34 +02:00
librte_mempool remove trailing whitespaces 2014-06-11 00:29:34 +02:00
librte_meter remove trailing whitespaces 2014-06-11 00:29:34 +02:00
librte_net remove trailing whitespaces 2014-06-11 00:29:34 +02:00
librte_pmd_e1000 pci: rename RTE_PCI_DRV_NEED_IGB_UIO to RTE_PCI_DRV_NEED_MAPPING 2014-06-16 15:02:10 +02:00
librte_pmd_ixgbe pci: rename RTE_PCI_DRV_NEED_IGB_UIO to RTE_PCI_DRV_NEED_MAPPING 2014-06-16 15:02:10 +02:00
librte_pmd_pcap remove trailing whitespaces 2014-06-11 00:29:34 +02:00
librte_pmd_ring remove trailing whitespaces 2014-06-11 00:29:34 +02:00
librte_pmd_virtio pci: rename RTE_PCI_DRV_NEED_IGB_UIO to RTE_PCI_DRV_NEED_MAPPING 2014-06-16 15:02:10 +02:00
librte_pmd_vmxnet3 pci: rename RTE_PCI_DRV_NEED_IGB_UIO to RTE_PCI_DRV_NEED_MAPPING 2014-06-16 15:02:10 +02:00
librte_pmd_xenvirt remove trailing whitespaces 2014-06-11 00:29:34 +02:00
librte_power remove trailing whitespaces 2014-06-11 00:29:34 +02:00
librte_ring remove trailing whitespaces 2014-06-11 00:29:34 +02:00
librte_sched remove trailing whitespaces 2014-06-11 00:29:34 +02:00
librte_timer remove trailing whitespaces 2014-06-11 00:29:34 +02:00
Makefile acl: new library 2014-06-14 01:29:45 +02:00