Check iova mode and accordingly return phy addr.
Signed-off-by: Santosh Shukla <[email protected]>
Signed-off-by: Jerin Jacob <[email protected]>
---
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 9c9baf628..1261efda0 100644
--- a/lib/librte_eal/linuxapp/eal/eal_memory.c
+++ b/lib/librte_eal/linuxapp/eal/eal_memory.c
@@ -140,6 +140,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.11.0