[dpdk-stable] patch 'eal/linux: fix log levels for pagemap reading failure' has been queued to LTS release 17.11.7

Yongseok Koh yskoh at mellanox.com
Tue Jul 23 03:00:12 CEST 2019


Hi,

FYI, your patch has been queued to LTS release 17.11.7

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objection by 07/27/19. So please
shout if anyone has objection.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Thanks.

Yongseok

---
>From 1aea12c0f929b8b73b11e0866d1a6eef865e3ba3 Mon Sep 17 00:00:00 2001
From: Kevin Traynor <ktraynor at redhat.com>
Date: Thu, 14 Feb 2019 17:56:56 +0000
Subject: [PATCH] eal/linux: fix log levels for pagemap reading failure

[ backported from upstream commit c0d9052afbc711d85350c6e1252affda66e2f88b ]

Commit cdc242f260e7 says:
    For Linux kernel 4.0 and newer, the ability to obtain
    physical page frame numbers for unprivileged users from
    /proc/self/pagemap was removed. Instead, when an IOMMU
    is present, simply choose our own DMA addresses instead.

In this case the user still sees error messages, so adjust
the log levels. Later, other checks will ensure that errors
are logged in the appropriate cases.

Fixes: cdc242f260e7 ("eal/linux: support running as unprivileged user")

Signed-off-by: Kevin Traynor <ktraynor at redhat.com>
Acked-by: Aaron Conole <aconole at redhat.com>
---
 lib/librte_eal/linuxapp/eal/eal_memory.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c
index 8d0456b560..f1938ecfcb 100644
--- a/lib/librte_eal/linuxapp/eal/eal_memory.c
+++ b/lib/librte_eal/linuxapp/eal/eal_memory.c
@@ -154,7 +154,7 @@ rte_mem_virt2phy(const void *virtaddr)
 
 	fd = open("/proc/self/pagemap", O_RDONLY);
 	if (fd < 0) {
-		RTE_LOG(ERR, EAL, "%s(): cannot open /proc/self/pagemap: %s\n",
+		RTE_LOG(INFO, EAL, "%s(): cannot open /proc/self/pagemap: %s\n",
 			__func__, strerror(errno));
 		return RTE_BAD_IOVA;
 	}
@@ -162,8 +162,9 @@ rte_mem_virt2phy(const void *virtaddr)
 	virt_pfn = (unsigned long)virtaddr / page_size;
 	offset = sizeof(uint64_t) * virt_pfn;
 	if (lseek(fd, offset, SEEK_SET) == (off_t) -1) {
-		RTE_LOG(ERR, EAL, "%s(): seek error in /proc/self/pagemap: %s\n",
-				__func__, strerror(errno));
+		RTE_LOG(INFO, EAL,
+			"%s(): seek error in /proc/self/pagemap: %s\n",
+			__func__, strerror(errno));
 		close(fd);
 		return RTE_BAD_IOVA;
 	}
@@ -171,13 +172,14 @@ rte_mem_virt2phy(const void *virtaddr)
 	retval = read(fd, &page, PFN_MASK_SIZE);
 	close(fd);
 	if (retval < 0) {
-		RTE_LOG(ERR, EAL, "%s(): cannot read /proc/self/pagemap: %s\n",
+		RTE_LOG(INFO, EAL, "%s(): cannot read /proc/self/pagemap: %s\n",
 				__func__, strerror(errno));
 		return RTE_BAD_IOVA;
 	} else if (retval != PFN_MASK_SIZE) {
-		RTE_LOG(ERR, EAL, "%s(): read %d bytes from /proc/self/pagemap "
-				"but expected %d:\n",
-				__func__, retval, PFN_MASK_SIZE);
+		RTE_LOG(INFO, EAL,
+			"%s(): read %d bytes from /proc/self/pagemap "
+			"but expected %d:\n",
+			__func__, retval, PFN_MASK_SIZE);
 		return RTE_BAD_IOVA;
 	}
 
-- 
2.21.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2019-07-22 17:55:08.951312246 -0700
+++ 0045-eal-linux-fix-log-levels-for-pagemap-reading-failure.patch	2019-07-22 17:55:06.084470000 -0700
@@ -1,8 +1,10 @@
-From c0d9052afbc711d85350c6e1252affda66e2f88b Mon Sep 17 00:00:00 2001
+From 1aea12c0f929b8b73b11e0866d1a6eef865e3ba3 Mon Sep 17 00:00:00 2001
 From: Kevin Traynor <ktraynor at redhat.com>
 Date: Thu, 14 Feb 2019 17:56:56 +0000
 Subject: [PATCH] eal/linux: fix log levels for pagemap reading failure
 
+[ backported from upstream commit c0d9052afbc711d85350c6e1252affda66e2f88b ]
+
 Commit cdc242f260e7 says:
     For Linux kernel 4.0 and newer, the ability to obtain
     physical page frame numbers for unprivileged users from
@@ -14,19 +16,18 @@
 are logged in the appropriate cases.
 
 Fixes: cdc242f260e7 ("eal/linux: support running as unprivileged user")
-Cc: stable at dpdk.org
 
 Signed-off-by: Kevin Traynor <ktraynor at redhat.com>
 Acked-by: Aaron Conole <aconole at redhat.com>
 ---
- lib/librte_eal/linux/eal/eal_memory.c | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
+ lib/librte_eal/linuxapp/eal/eal_memory.c | 16 +++++++++-------
+ 1 file changed, 9 insertions(+), 7 deletions(-)
 
-diff --git a/lib/librte_eal/linux/eal/eal_memory.c b/lib/librte_eal/linux/eal/eal_memory.c
-index 1b96b576e0..f6ee403ad6 100644
---- a/lib/librte_eal/linux/eal/eal_memory.c
-+++ b/lib/librte_eal/linux/eal/eal_memory.c
-@@ -114,7 +114,7 @@ rte_mem_virt2phy(const void *virtaddr)
+diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c
+index 8d0456b560..f1938ecfcb 100644
+--- a/lib/librte_eal/linuxapp/eal/eal_memory.c
++++ b/lib/librte_eal/linuxapp/eal/eal_memory.c
+@@ -154,7 +154,7 @@ rte_mem_virt2phy(const void *virtaddr)
  
  	fd = open("/proc/self/pagemap", O_RDONLY);
  	if (fd < 0) {
@@ -35,16 +36,19 @@
  			__func__, strerror(errno));
  		return RTE_BAD_IOVA;
  	}
-@@ -122,7 +122,7 @@ rte_mem_virt2phy(const void *virtaddr)
+@@ -162,8 +162,9 @@ rte_mem_virt2phy(const void *virtaddr)
  	virt_pfn = (unsigned long)virtaddr / page_size;
  	offset = sizeof(uint64_t) * virt_pfn;
  	if (lseek(fd, offset, SEEK_SET) == (off_t) -1) {
 -		RTE_LOG(ERR, EAL, "%s(): seek error in /proc/self/pagemap: %s\n",
-+		RTE_LOG(INFO, EAL, "%s(): seek error in /proc/self/pagemap: %s\n",
- 				__func__, strerror(errno));
+-				__func__, strerror(errno));
++		RTE_LOG(INFO, EAL,
++			"%s(): seek error in /proc/self/pagemap: %s\n",
++			__func__, strerror(errno));
  		close(fd);
  		return RTE_BAD_IOVA;
-@@ -131,11 +131,11 @@ rte_mem_virt2phy(const void *virtaddr)
+ 	}
+@@ -171,13 +172,14 @@ rte_mem_virt2phy(const void *virtaddr)
  	retval = read(fd, &page, PFN_MASK_SIZE);
  	close(fd);
  	if (retval < 0) {
@@ -54,10 +58,15 @@
  		return RTE_BAD_IOVA;
  	} else if (retval != PFN_MASK_SIZE) {
 -		RTE_LOG(ERR, EAL, "%s(): read %d bytes from /proc/self/pagemap "
-+		RTE_LOG(INFO, EAL, "%s(): read %d bytes from /proc/self/pagemap "
- 				"but expected %d:\n",
- 				__func__, retval, PFN_MASK_SIZE);
+-				"but expected %d:\n",
+-				__func__, retval, PFN_MASK_SIZE);
++		RTE_LOG(INFO, EAL,
++			"%s(): read %d bytes from /proc/self/pagemap "
++			"but expected %d:\n",
++			__func__, retval, PFN_MASK_SIZE);
  		return RTE_BAD_IOVA;
+ 	}
+ 
 -- 
 2.21.0
 


More information about the stable mailing list