mem: hide physical address error in VA mode
authorThomas Monjalon <thomas@monjalon.net>
Sat, 4 Nov 2017 22:09:03 +0000 (23:09 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 6 Nov 2017 21:20:29 +0000 (22:20 +0100)
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@monjalon.net>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
lib/librte_eal/linuxapp/eal/eal_memory.c

index ab287aa..10b42d2 100644 (file)
@@ -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;
        }
 }