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 807FF45D0D; Fri, 15 Nov 2024 08:50:50 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 59D86402B5; Fri, 15 Nov 2024 08:50:50 +0100 (CET) Received: from out203-205-221-231.mail.qq.com (out203-205-221-231.mail.qq.com [203.205.221.231]) by mails.dpdk.org (Postfix) with UTF8SMTP id 1D8EE40278 for ; Fri, 15 Nov 2024 08:50:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512; t=1731657044; bh=kN/oqEzxvrvWIhhoQORLwF2Ej9slYGtsxJ3mBAZmft4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=hQLqeITAmbItbaZLxUPVB7gBdjS+/6sni88aGe9sJWxvWWTrorbCp2r4yRtOEDSod 0rX+g+Bg+3ShSDqTOAkQ+4GaooxLzYJSCR764K8pDQCA4Vi4pk1Fp5th4JcNs90Svz V5vnphVKUgJbIDDf3MgW6NzSf2MlEHqtD2da/mzo= Received: from ubuntu.localdomain ([175.167.145.196]) by newxmesmtplogicsvrszc25-0.qq.com (NewEsmtp) with SMTP id CA38ECF7; Fri, 15 Nov 2024 15:50:35 +0800 X-QQ-mid: xmsmtpt1731657035tx9s9mhzy Message-ID: X-QQ-XMAILINFO: NvxNySBpH0Ql0TyGvWil7xJtJ+BgfA8NZtCBimSMHXGRJApcpN3py2sntrGExg E0QDWIerm9GwOyY8/hzDDsc5OPO1TC2xg0CS/7AhLYXGllpJH/R+qtFBQd+Huoq6+OwxzO36XQ/N WYsPJv8rkybTaXSx0fbidki3jNItgp1vDit12XRp9J/A4m5QguY6z02RqLQww5acacxE/e7ZK8mc f00LTrf90t3TfXKll8hQdswyNPhrQ9yh1sbsA+lmafXNz8bI5YBO1ShTBAfyMjHoRGdueHlKibiC 07qHM2mDVHibU1UKpfz14Vsaiq/lJmsfpP6BjYm8jn+tvni4rmwZtemrFamx3GDcCR6KXombIzDV E6Z6X5To69ntj2LKnb9V1jaZ2SLlLjRb481zkU2/L8JSfgPNsqPzgKl4F+bunQvsIMgNm+itfhBk QsPp3kaKI/hvSHK3EsQHLYougpRRqnPU6EbOQ0uEeza0Aq026HeLiSv82Sghimp+oGZYwVRQeIVu 4Y4kfNFydI3o+NHavWKuC5/tbrJv7Umqv9LV0EmmfuTojOXuYGwzUAVDgCBK2hCLu/tA3RjcS5Yi IkeRa/nM8quRdHPU0YRhqMQK0HHq7YeTqg313tb3+pnfGb3nn+Dab/N/pAJnzxxh5d5AA2SkPgEO 6dJA+uye/Sqrqak+qpz9xcKovqFqOkk3J/Ktgd6/CpyJqIEt+BH7Hqx0cG25LrTgKxaloKA7cFIR XxLTJScd/LnCAn8fhJqSW7+VQN+rxxY5MqGeDlgxAtSUZhU9RVjIOuOw61PXz6JFHeZzOoW9duSf YAA6LEdkb0CPd9FvAl39OcLMmL+y5ePBiD6m96dhJCtvKi55aE7Edb51kcjdeYIa1SFEi2XG7Lqz W0P/BEUz012XKKvAnnzyvMeqHJhfzCNRNo2EoTFD+DytWEhUyPvJZKqBYcSfzBJxYpcdxtTWuu3p 5hLqgKTIA= X-QQ-XMRINFO: M/715EihBoGSf6IYSX1iLFg= From: Congjie Zhou To: dev@dpdk.org Cc: anatoly.burakov@intel.com, stephen@networkplumber.org, Congjie Zhou Subject: [PATCH v2] eal/linux: fix fbarray name with multiple secondary processes Date: Fri, 15 Nov 2024 15:50:08 +0800 X-OQ-MSGID: <20241115075008.7810-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 lib/eal/linux/eal_memalloc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/eal/linux/eal_memalloc.c b/lib/eal/linux/eal_memalloc.c index e354efc..367d401 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 @@ -1447,8 +1448,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