[dpdk-dev] [PATCH v4 01/15] mem: hide physical address error in VA mode

Thomas Monjalon thomas at monjalon.net
Mon Nov 6 02:41:27 CET 2017


If the IOVA mode is not using physical addresses,
no need to log an error about physical address issue.

Signed-off-by: Thomas Monjalon <thomas at monjalon.net>
---
 lib/librte_eal/linuxapp/eal/eal_memory.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c
index ab287aa24..10b42d2fe 100644
--- a/lib/librte_eal/linuxapp/eal/eal_memory.c
+++ b/lib/librte_eal/linuxapp/eal/eal_memory.c
@@ -107,10 +107,11 @@ test_phys_addrs_available(void)
 
 	physaddr = rte_mem_virt2phy(&tmp);
 	if (physaddr == RTE_BAD_PHYS_ADDR) {
-		RTE_LOG(ERR, EAL,
-			"Cannot obtain physical addresses: %s. "
-			"Only vfio will function.\n",
-			strerror(errno));
+		if (rte_eal_iova_mode() == RTE_IOVA_PA)
+			RTE_LOG(ERR, EAL,
+				"Cannot obtain physical addresses: %s. "
+				"Only vfio will function.\n",
+				strerror(errno));
 		phys_addrs_available = false;
 	}
 }
-- 
2.14.2



More information about the dev mailing list