From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7D9E1A046B for ; Tue, 23 Jul 2019 03:02:41 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 735DD1BEF8; Tue, 23 Jul 2019 03:02:41 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 1E42C1BF63 for ; Tue, 23 Jul 2019 03:02:40 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE2 (envelope-from yskoh@mellanox.com) with ESMTPS (AES256-SHA encrypted); 23 Jul 2019 04:02:38 +0300 Received: from scfae-sc-2.mti.labs.mlnx (scfae-sc-2.mti.labs.mlnx [10.101.0.96]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id x6N11HfV026580; Tue, 23 Jul 2019 04:02:36 +0300 From: Yongseok Koh To: Kevin Traynor Cc: Aaron Conole , dpdk stable Date: Mon, 22 Jul 2019 18:00:12 -0700 Message-Id: <20190723010115.6446-45-yskoh@mellanox.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190723010115.6446-1-yskoh@mellanox.com> References: <20190723010115.6446-1-yskoh@mellanox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'eal/linux: fix log levels for pagemap reading failure' has been queued to LTS release 17.11.7 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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 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 Acked-by: Aaron Conole --- 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 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@dpdk.org Signed-off-by: Kevin Traynor Acked-by: Aaron Conole --- - 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