diff options
author | Matias Elo <matias.elo@nokia.com> | 2023-02-24 09:39:16 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-24 09:39:16 +0200 |
commit | 0f2f3271f64b25d7ce101b7a5c82b7fc17ba2d32 (patch) | |
tree | 5d4df86a452c52b1421b8039835ec793ac4019c7 /platform/linux-generic/pktio/dpdk.c | |
parent | 282188e33695bb6863e289df61e0dfbd87ca205c (diff) | |
parent | c7c99cfd5635da8c0afc7f3803ce6e1c82c3465b (diff) |
Merge ODP v1.40.0.0v1.40.0.0_DPDK_19.11
Merge ODP linux-generic v1.40.0.0 into linux-dpdk.
Diffstat (limited to 'platform/linux-generic/pktio/dpdk.c')
-rw-r--r-- | platform/linux-generic/pktio/dpdk.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/platform/linux-generic/pktio/dpdk.c b/platform/linux-generic/pktio/dpdk.c index 7e9db90ce..fa40d1bde 100644 --- a/platform/linux-generic/pktio/dpdk.c +++ b/platform/linux-generic/pktio/dpdk.c @@ -49,6 +49,7 @@ #include <rte_tcp.h> #include <rte_udp.h> #include <rte_version.h> +#include <rte_vfio.h> /* NUMA is not supported on all platforms */ #ifdef _ODP_HAVE_NUMA_LIBRARY @@ -438,6 +439,15 @@ static struct rte_mempool *mbuf_pool_create(const char *name, goto fail; } + /* Map pages for DMA access to enable VFIO usage */ + for (uint64_t i = 0; i < pool_entry->shm_size; i += page_size) { + addr = pool_entry->base_addr + i; + + rte_vfio_container_dma_map(RTE_VFIO_DEFAULT_CONTAINER_FD, + (uint64_t)(uintptr_t)addr, + rte_mem_virt2iova(addr), page_size); + } + rte_mempool_obj_iter(mp, pktmbuf_init, NULL); return mp; |