patch 'mem: fix hugepage info mapping' has been queued to stable release 22.11.2

Xueming Li xuemingl at nvidia.com
Mon Feb 27 07:59:44 CET 2023


Hi,

FYI, your patch has been queued to stable release 22.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/01/23. So please
shout if anyone has objections.

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.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=22.11-staging&id=08019befc3dfa3fe24081ed86ff6e5bbd00192f0

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 08019befc3dfa3fe24081ed86ff6e5bbd00192f0 Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen at huawei.com>
Date: Mon, 6 Feb 2023 10:53:10 +0000
Subject: [PATCH] mem: fix hugepage info mapping
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 66e7ac416f3d62c5ee773ff02c115a24da9f1991 ]

The map_shared_memory() function should treat mmap MAP_FAILED as NULL
because callers compare it with NULL to determine whether the map is
failed.

Fixes: 764bf26873b9 ("add FreeBSD support")
Fixes: cb97d93e9d3b ("mem: share hugepage info primary and secondary")

Signed-off-by: Chengwen Feng <fengchengwen at huawei.com>
Reviewed-by: David Marchand <david.marchand at redhat.com>
---
 lib/eal/freebsd/eal_hugepage_info.c | 2 +-
 lib/eal/linux/eal_hugepage_info.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/eal/freebsd/eal_hugepage_info.c b/lib/eal/freebsd/eal_hugepage_info.c
index 9dbe375bd3..e58e618469 100644
--- a/lib/eal/freebsd/eal_hugepage_info.c
+++ b/lib/eal/freebsd/eal_hugepage_info.c
@@ -33,7 +33,7 @@ map_shared_memory(const char *filename, const size_t mem_size, int flags)
 	}
 	retval = mmap(NULL, mem_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
 	close(fd);
-	return retval;
+	return retval == MAP_FAILED ? NULL : retval;
 }

 static void *
diff --git a/lib/eal/linux/eal_hugepage_info.c b/lib/eal/linux/eal_hugepage_info.c
index a1b6cb31ff..24411d9c5b 100644
--- a/lib/eal/linux/eal_hugepage_info.c
+++ b/lib/eal/linux/eal_hugepage_info.c
@@ -50,7 +50,7 @@ map_shared_memory(const char *filename, const size_t mem_size, int flags)
 	retval = mmap(NULL, mem_size, PROT_READ | PROT_WRITE,
 			MAP_SHARED, fd, 0);
 	close(fd);
-	return retval;
+	return retval == MAP_FAILED ? NULL : retval;
 }

 static void *
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:43.355949200 +0800
+++ 0077-mem-fix-hugepage-info-mapping.patch	2023-02-27 14:08:40.799237000 +0800
@@ -1 +1 @@
-From 66e7ac416f3d62c5ee773ff02c115a24da9f1991 Mon Sep 17 00:00:00 2001
+From 08019befc3dfa3fe24081ed86ff6e5bbd00192f0 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 66e7ac416f3d62c5ee773ff02c115a24da9f1991 ]
@@ -12 +14,0 @@
-Cc: stable at dpdk.org


More information about the stable mailing list