summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorSachin Saxena <sachin.saxena@nxp.com>2018-05-28 14:54:47 +0530
committerDamjan Marion <dmarion.lists@gmail.com>2018-05-28 12:02:30 +0000
commitd3b3baa4f8e9e4d95264aff16fe85434ef8061bd (patch)
treed0b5bc2f28a3c5925620eeda609e3f01421bb397 /src/plugins
parentacba9f794be8aa97e51fef6fd2dc0fe339349d22 (diff)
dpdk: set dmamap iova address value according to eal_iova_mode
- Fix the issue where eal iova mode is Virtual Address (RTE_IOVA_VA) but setting DMA iova address to Physical address value always. Change-Id: Ib1e9c1596d95885c7eff11723338121627203e61 Signed-off-by: Sachin Saxena <sachin.saxena@nxp.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/dpdk/buffer.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/plugins/dpdk/buffer.c b/src/plugins/dpdk/buffer.c
index 11d8cd7962b..59015ff7d3d 100644
--- a/src/plugins/dpdk/buffer.c
+++ b/src/plugins/dpdk/buffer.c
@@ -541,7 +541,10 @@ dpdk_pool_create (vlib_main_t * vm, u8 * pool_name, u32 elt_size,
{
dm.vaddr = pointer_to_uword (pr->mem) + (i << pr->log2_page_size);
dm.size = 1 << pr->log2_page_size;
- dm.iova = pr->page_table[i];
+ if (rte_eal_iova_mode() == RTE_IOVA_PA)
+ dm.iova = pr->page_table[i];
+ else
+ dm.iova = dm.vaddr;
if ((rv = ioctl (dbm->vfio_container_fd, VFIO_IOMMU_MAP_DMA, &dm)))
break;
}