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

Message ID 20171106014141.13266-2-thomas@monjalon.net (mailing list archive)
State Accepted, archived
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Thomas Monjalon Nov. 6, 2017, 1:41 a.m. UTC
  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>
---
 lib/librte_eal/linuxapp/eal/eal_memory.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
  

Comments

Santosh Shukla Nov. 6, 2017, 5:39 a.m. UTC | #1
On Monday 06 November 2017 07:11 AM, Thomas Monjalon wrote:
> 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>
  

Patch

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;
 	}
 }