numam-dpdk/lib
Shahaf Shuler c33a675b62 bus: introduce device level DMA memory mapping
The DPDK APIs expose 3 different modes to work with memory used for DMA:

1. Use the DPDK owned memory (backed by the DPDK provided hugepages).
This memory is allocated by the DPDK libraries, included in the DPDK
memory system (memseg lists) and automatically DMA mapped by the DPDK
layers.

2. Use memory allocated by the user and register to the DPDK memory
systems. Upon registration of memory, the DPDK layers will DMA map it
to all needed devices. After registration, allocation of this memory
will be done with rte_*malloc APIs.

3. Use memory allocated by the user and not registered to the DPDK memory
system. This is for users who wants to have tight control on this
memory (e.g. avoid the rte_malloc header).
The user should create a memory, register it through rte_extmem_register
API, and call DMA map function in order to register such memory to
the different devices.

The scope of the patch focus on #3 above.

Currently the only way to map external memory is through VFIO
(rte_vfio_dma_map). While VFIO is common, there are other vendors
which use different ways to map memory (e.g. Mellanox and NXP).

The work in this patch moves the DMA mapping to vendor agnostic APIs.
Device level DMA map and unmap APIs were added. Implementation of those
APIs was done currently only for PCI devices.

For PCI bus devices, the pci driver can expose its own map and unmap
functions to be used for the mapping. In case the driver doesn't provide
any, the memory will be mapped, if possible, to IOMMU through VFIO APIs.

Application usage with those APIs is quite simple:
* allocate memory
* call rte_extmem_register on the memory chunk.
* take a device, and query its rte_device.
* call the device specific mapping function for this device.

Future work will deprecate the rte_vfio_dma_map and rte_vfio_dma_unmap
APIs, leaving the rte device APIs as the preferred option for the user.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
2019-03-30 16:48:56 +01:00
..
librte_acl acl: fix compiler flags with meson and AVX2 runtime 2019-03-27 10:38:06 +01:00
librte_bbdev
librte_bitratestats
librte_bpf
librte_cfgfile
librte_cmdline
librte_compressdev compressdev: add flag to specify where processing is done 2019-03-22 15:54:24 +01:00
librte_cryptodev cryptodev: remove XTS comment duplication 2019-03-22 15:54:24 +01:00
librte_distributor
librte_eal bus: introduce device level DMA memory mapping 2019-03-30 16:48:56 +01:00
librte_efd
librte_ethdev ethdev: check for invalid device name 2019-03-21 19:27:51 +01:00
librte_eventdev doc: add notes about eventdev producer/consumer dependency 2019-03-15 06:46:50 +01:00
librte_flow_classify
librte_gro
librte_gso
librte_hash hash: optimize signature compare for Arm NEON 2019-03-28 19:54:21 +01:00
librte_ip_frag
librte_ipsec ipsec: support 3DES-CBC 2019-03-22 15:54:24 +01:00
librte_jobstats
librte_kni
librte_kvargs
librte_latencystats
librte_lpm
librte_mbuf
librte_member
librte_mempool use appropriate EAL macro for constructors 2019-03-27 23:10:57 +01:00
librte_meter
librte_metrics
librte_net
librte_pci
librte_pdump
librte_pipeline
librte_port
librte_power power: fix frequency list buffer validation 2019-03-29 14:58:27 +01:00
librte_rawdev
librte_reorder
librte_ring ring: enforce reading tail before slots 2019-03-28 01:22:04 +01:00
librte_sched
librte_security
librte_table
librte_telemetry
librte_timer
librte_vhost vhost: support requests only handled by external backend 2019-03-20 18:15:42 +01:00
Makefile
meson.build