From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3900745D1A; Sat, 16 Nov 2024 05:09:13 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B590040270; Sat, 16 Nov 2024 05:09:12 +0100 (CET) Received: from out203-205-221-164.mail.qq.com (out203-205-221-164.mail.qq.com [203.205.221.164]) by mails.dpdk.org (Postfix) with UTF8SMTP id 8603C40270 for ; Sat, 16 Nov 2024 05:09:10 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512; t=1731730147; bh=VZy1gwxXjzYWVzL0X2vsuIeLXSjBl9UgjAZJ6brvJb8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=OUVvCvJHix3fH3G7TLehfogEDqmmdKPN/79ogmto7CnZXYpM9e6w+DF3BntRsdRLZ 6RRSvunSSej2DRSCl/3Hqn4t8TDqnE0V0uA/HdcLQC0sRQjUxNNZNjbOBtq0/eb5/d tEMmt9SwgeS3M2lRHMNkvG4l0y64lOt04D8LTCWs= Received: from ubuntu.localdomain ([175.167.145.196]) by newxmesmtplogicsvrsza15-1.qq.com (NewEsmtp) with SMTP id 1EC8820E; Sat, 16 Nov 2024 12:07:44 +0800 X-QQ-mid: xmsmtpt1731730064tdl85qd4n Message-ID: X-QQ-XMAILINFO: NafziRg7Bx693fGt0NKpKE+MTZQ6Rd9eXtx8/hc8KHbveqnSw4KSQauXkbfOLt aMfb5vP18ycyEYZesNjKxRjV6oXD0BrRcPKN1yNfNezw/tx8ZI4wU/T3UBn4/QxfR5y7f4MsLK5+ 9sswqTfPNKem16X12mofqrnUAZVS7pjnCtDrkNthzfDdA+TNj1bXk7fS62agHl6xTfHlKIg9oU3W RU/tW0a846W4vWjC4zFh4i9bPYbgKoSQ7KE2MOWidqFA9B3C75SHrD/SZlorJ1aaJdjnFFbBY3eu 7y8nsNe1pDiOVzllAYiJCQpUwTW/1wI1/eKNsYSGVGzZSYaxe5Rv3XUG5c8pos2UQqi6FBEaVxpW n5u63XKvgxqiU6kqWWnPNORehKNvJ0wO8i7/Ov1T+pRkqCb9a3NOayVdGEselwFZL++/g0S32lkH QfsghACJvOrXcFxBeZ3yvaxR2IwXXEjwuGD58yiI9awyoqRTAHe8p3fyzlIIlp9uKkuMdLHg4QoR lSaWgXN77K9gHJf5IBcoMkl0QJBJsk/jsaJAJriN2giI2sbUmZEZPqBD5TAWfAkfaRdcm6iJbDlt 0/3kxUFGU9GQ6Ipk1Z/d4Z2y+YajVmrMvGEYjXcJpqFmoHLBeFvkoqnBhg5NXoMt+H+LTbXHkH8G mQpNKRmk0kAjuARgFpSIN2b4GduVPqom0zGLh/S/hS7yRV6hLNhEM2eqF+yS7wa2ghYwo3FtAALC ob1m76KJKfOi5xnFY4bxQrZBxYTTPw9x4YUM/WN+8gESnHnGEa9HeA4Kn5uUrn+9GsKXowPMfoeg 96kG6ns3pD0pmlypl8nh09hEc5QNkD1V0PYQrUllVAhvpUrzVhCcGQFQmmCs34T0FudAbWxfIAw1 U0XbUX1fvPUseLL7dmile6jiKR9H5veJCEJqPgNCnGLvKn7lt++JjvSuqfNJCdtAOHHbgps/H7W2 OhJAyFEW0= X-QQ-XMRINFO: Nq+8W0+stu50PRdwbJxPCL0= From: Congjie Zhou To: dev@dpdk.org Cc: anatoly.burakov@intel.com, stephen@networkplumber.org, Congjie Zhou Subject: [PATCH v3] eal/linux: fix fbarray name with multiple secondary processes Date: Sat, 16 Nov 2024 12:07:41 +0800 X-OQ-MSGID: <20241116040741.9349-1-zcjie0802@qq.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org add the tsc into the name. Suggested-by: Stephen Hemminger Signed-off-by: Congjie Zhou --- When multiple secondary processes run in different containers, names identified by PIDs are not unique due to the pid namespace. So Add tsc to redefine a unique name. v1: use monotonic time to redefine the name v2: use tsc to redefine the name v3: include to support all architectures lib/eal/linux/eal_memalloc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/eal/linux/eal_memalloc.c b/lib/eal/linux/eal_memalloc.c index e354efc..ae1e024 100644 --- a/lib/eal/linux/eal_memalloc.c +++ b/lib/eal/linux/eal_memalloc.c @@ -16,6 +16,7 @@ #include #include #include +#include #ifdef F_ADD_SEALS /* if file sealing is supported, so is memfd */ #include #define MEMFD_SUPPORTED @@ -31,6 +32,7 @@ #include #include #include +#include #include "eal_filesystem.h" #include "eal_internal_cfg.h" @@ -1447,8 +1449,8 @@ secondary_msl_create_walk(const struct rte_memseg_list *msl, local_msl = &local_memsegs[msl_idx]; /* create distinct fbarrays for each secondary */ - snprintf(name, RTE_FBARRAY_NAME_LEN, "%s_%i", - primary_msl->memseg_arr.name, getpid()); + snprintf(name, RTE_FBARRAY_NAME_LEN, "%s_%i_%"PRIx64, + primary_msl->memseg_arr.name, getpid(), rte_get_tsc_cycles()); ret = rte_fbarray_init(&local_msl->memseg_arr, name, primary_msl->memseg_arr.len, -- 2.34.1