patch 'eal/linux: fix fbarray name collision in containers' has been queued to stable release 25.11.1

Kevin Traynor ktraynor at redhat.com
Thu Feb 26 14:10:39 CET 2026


Hi,

FYI, your patch has been queued to stable release 25.11.1

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/02/26. 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://github.com/kevintraynor/dpdk-stable

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/dadfd116fb93ea682a8407184bd4dc91dc177023

Thanks.

Kevin

---
>From dadfd116fb93ea682a8407184bd4dc91dc177023 Mon Sep 17 00:00:00 2001
From: Congjie Zhou <zcjie0802 at qq.com>
Date: Fri, 13 Feb 2026 14:00:23 -0800
Subject: [PATCH] eal/linux: fix fbarray name collision in containers

[ upstream commit 9b1eae94b3e40b5829b36a30f1d07b79899224ce ]

When multiple secondary processes run in different containers that
share the same hugetlbfs mount, the fbarray names can collide.
This happens because containers use separate PID namespaces, so
different processes in different containers can have the same PID.

Fix by replacing the PID with a timestamp-based value. The TSC
(timestamp counter) provides sufficient uniqueness since containers
starting at the same CPU cycle is practically impossible - even 1ms
of startup time difference means millions of cycles apart at GHz
frequencies.

Also, reduce the name buffer from PATH_MAX to RTE_FBARRAY_NAME_LEN
since it is only used for the fbarray name.

Fixes: 524e43c2ad9a ("mem: prepare memseg lists for multiprocess sync")

Signed-off-by: Congjie Zhou <zcjie0802 at qq.com>
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
---
 .mailmap                     |  1 +
 lib/eal/linux/eal_memalloc.c | 27 ++++++++++++++++++++-------
 2 files changed, 21 insertions(+), 7 deletions(-)

diff --git a/.mailmap b/.mailmap
index 89dd37bdf4..91c01cb0d9 100644
--- a/.mailmap
+++ b/.mailmap
@@ -294,4 +294,5 @@ Claire Murphy <claire.k.murphy at intel.com>
 Clemens Famulla-Conrad <cfamullaconrad at suse.com>
 Cody Doucette <doucette at bu.edu>
+Congjie Zhou <zcjie0802 at qq.com>
 Congwen Zhang <zhang.congwen at zte.com.cn>
 Conor Fogarty <conor.fogarty at intel.com>
diff --git a/lib/eal/linux/eal_memalloc.c b/lib/eal/linux/eal_memalloc.c
index 840efab244..57fb40deb0 100644
--- a/lib/eal/linux/eal_memalloc.c
+++ b/lib/eal/linux/eal_memalloc.c
@@ -8,4 +8,5 @@
 #include <stdio.h>
 #include <stdint.h>
+#include <inttypes.h>
 #include <string.h>
 #include <sys/mman.h>
@@ -29,4 +30,5 @@
 #include <rte_eal.h>
 #include <rte_memory.h>
+#include <rte_cycles.h>
 
 #include "eal_filesystem.h"
@@ -1381,6 +1383,8 @@ secondary_msl_create_walk(const struct rte_memseg_list *msl,
 	struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;
 	struct rte_memseg_list *primary_msl, *local_msl;
-	char name[PATH_MAX];
+	char name[RTE_FBARRAY_NAME_LEN];
 	int msl_idx, ret;
+	uint64_t tsc;
+	pid_t pid;
 
 	if (msl->external)
@@ -1391,10 +1395,19 @@ secondary_msl_create_walk(const struct rte_memseg_list *msl,
 	local_msl = &local_memsegs[msl_idx];
 
-	/* create distinct fbarrays for each secondary */
-	ret = snprintf(name, RTE_FBARRAY_NAME_LEN, "%s_%i",
-		primary_msl->memseg_arr.name, getpid());
-	if (ret >= RTE_FBARRAY_NAME_LEN) {
-		EAL_LOG(ERR, "fbarray name %s_%i is too long",
-				primary_msl->memseg_arr.name, getpid());
+	/*
+	 * Create distinct fbarrays for each secondary using TSC for uniqueness,
+	 * since PID is not unique across containers (different PID namespaces).
+	 * The worst case name length is:
+	 * Base name: "memseg-1048576k-99-99" ~21 chars
+	 * Suffix "_<pid>_<16hex>" +24
+	 * Total = ~45 < RTE_FBARRAY_NAME_LEN 64
+	 */
+	tsc = rte_get_tsc_cycles();
+	pid = getpid();
+	ret = snprintf(name, sizeof(name), "%s_%d_%"PRIx64,
+		primary_msl->memseg_arr.name, pid, tsc);
+	if (ret >= (int)sizeof(name)) {
+		EAL_LOG(ERR, "fbarray name \"%s_%d_%"PRIx64"\" is too long",
+			primary_msl->memseg_arr.name, pid, tsc);
 		return -1;
 	}
-- 
2.53.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-02-26 10:16:53.130432316 +0000
+++ 0157-eal-linux-fix-fbarray-name-collision-in-containers.patch	2026-02-26 10:16:47.228460448 +0000
@@ -1 +1 @@
-From 9b1eae94b3e40b5829b36a30f1d07b79899224ce Mon Sep 17 00:00:00 2001
+From dadfd116fb93ea682a8407184bd4dc91dc177023 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 9b1eae94b3e40b5829b36a30f1d07b79899224ce ]
+
@@ -21 +22,0 @@
-Cc: stable at dpdk.org
@@ -31 +32 @@
-index 8bbfcc1703..1a587eb4fb 100644
+index 89dd37bdf4..91c01cb0d9 100644
@@ -41 +42 @@
-index 4dee224ac5..a39bc31c7b 100644
+index 840efab244..57fb40deb0 100644
@@ -56 +57 @@
-@@ -1388,6 +1390,8 @@ secondary_msl_create_walk(const struct rte_memseg_list *msl,
+@@ -1381,6 +1383,8 @@ secondary_msl_create_walk(const struct rte_memseg_list *msl,
@@ -66 +67 @@
-@@ -1398,10 +1402,19 @@ secondary_msl_create_walk(const struct rte_memseg_list *msl,
+@@ -1391,10 +1395,19 @@ secondary_msl_create_walk(const struct rte_memseg_list *msl,



More information about the stable mailing list