From 680f6c12600f5d341c5968a1daeef7c5a055451b Mon Sep 17 00:00:00 2001 From: Santosh Shukla Date: Fri, 6 Oct 2017 16:33:45 +0530 Subject: [PATCH] mem: honor IOVA mode in virt2phy Check iova mode and accordingly return phy addr. Signed-off-by: Santosh Shukla Signed-off-by: Jerin Jacob Reviewed-by: Maxime Coquelin Reviewed-by: Anatoly Burakov Tested-by: Hemant Agrawal --- lib/librte_eal/linuxapp/eal/eal_memory.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c index 52791282f3..2d9d7c2dc6 100644 --- a/lib/librte_eal/linuxapp/eal/eal_memory.c +++ b/lib/librte_eal/linuxapp/eal/eal_memory.c @@ -139,6 +139,9 @@ rte_mem_virt2phy(const void *virtaddr) int page_size; off_t offset; + if (rte_eal_iova_mode() == RTE_IOVA_VA) + return (uintptr_t)virtaddr; + /* when using dom0, /proc/self/pagemap always returns 0, check in * dpdk memory by browsing the memsegs */ if (rte_xen_dom0_supported()) { -- 2.20.1