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 13FCB45CFF; Thu, 14 Nov 2024 06:19:47 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A1FF84066C; Thu, 14 Nov 2024 06:19:46 +0100 (CET) Received: from out162-62-57-210.mail.qq.com (out162-62-57-210.mail.qq.com [162.62.57.210]) by mails.dpdk.org (Postfix) with UTF8SMTP id 22628400D5 for ; Thu, 14 Nov 2024 06:19:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512; t=1731561575; bh=6a5TzhxTPhELe6HZ/8qGZHd60XwWOievVqFm/tc+EYY=; h=From:To:Cc:Subject:Date; b=DC1142qGezxpzsTnp0b0+N2lqldei3kVDbOzCoFNn+aBlYuQPggUW+rnHkShOzlgh V34+FoUEPm0Txm3mRTA4L/KcYqvaWXfMnjHCd0hqBpMbvGCN87IFHuInXH42+dkrRC ET7h4+WIdBNVjLzT7rVBusuYboDonxcLXD+/f5Ss= Received: from ubuntu.localdomain ([175.167.129.43]) by newxmesmtplogicsvrszb20-0.qq.com (NewEsmtp) with SMTP id 4E1104D9; Thu, 14 Nov 2024 13:19:33 +0800 X-QQ-mid: xmsmtpt1731561573t88au18pz Message-ID: X-QQ-XMAILINFO: NMGzQWUSIfvT7BEY4xv2G14q4MwAAdILen9jiaYCEL08ZCgiNxAl4N6UpwLICu Kz+NRbC6FyRf8IVLJwa2e+owJxbxv3fEDLFpR9698x3rr3No6U9PUxlP9PVwTrKPKRYJjjcTLcMR Ojxk7okOfUYjt8YNw8xbsVEJ3PQKmF7Gj58xbN+dJXAyBFOA68XHslAcDAHbfd5hP7ejPB2Jhi/W 1rbQGFizVU+73fNCgBVi3XWxWToI8MNqvA8nO3YDql81Hy1b92okp+dut2q4rvb9l6A6ndUsLt9T aRidh8MklgPfCyo0aBVj8gJw29BI7JqzS8Zh5usNevQdHP8w4wQ7dL0isXGWtLG2wxxghRMiWSiZ qLbDjfn/NFXiSrgDkW9/dydkRQ6E9jCAhQFx9bTEzWhlhyNmr3TA8+Gr7psvXshoBN3ePOrIGL4X VhdGnWYZRjLaRRHJZIKaoe2JwDe8gqBUM5Mdizs0/uBSy8qvwti8F7a42Gccl/jCSG+0YVez3std QCU0UzrNdINORdSoqvyWKmZPi94Xxx7kEKJATlIHqKKds1EYlfIgPdSovvFY5hy58NWfGkAh6Esz U6UolxvOIBWLSvcBfDBu+lzP3+z/sM3UCzxS41SPwoMCRAF6BbWYxQkUcGFH1Y8+soF/a6gLVSAa GEziWgF9Nfzd645++codM8yxC8QUV1uIAHEYhFZZNIefJ/TRdZtVOYMAa6I8wSCiEJf5xGmvNRvZ fRanUD98r9zCXh1A0LfcES7vRhz9saiSEdSWqdWFcYZCdkyEA39lLHjTXJ75dClsT7ypNp/XjKwB UrnGWtD/F3GPnKZX4ZgXNRCt62e53uQvNAavM1nYr8vE2J49NJCEW2/X5WSWpuMF6Pi1FkMPZeIY uInHndaEgw89fCvTZ/LpSX6IlOjqzzVb3V6CEv37sbLIVvhcSV+tfN4kIrhT/O+sG/+bY8UdhPtw GfuYA59pvof8zLFMjhheQUeIsMKwxR00KodrO8WIs= X-QQ-XMRINFO: MSVp+SPm3vtS1Vd6Y4Mggwc= From: Congjie Zhou To: dev@dpdk.org Cc: anatoly.burakov@intel.com, Congjie Zhou Subject: [PATCH] lib/eal: redefine the name for rte_fbarray_init() Date: Thu, 14 Nov 2024 13:19:22 +0800 X-OQ-MSGID: <20241114051922.4699-1-zcjie0802@qq.com> X-Mailer: git-send-email 2.34.1 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. 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. Add tsc to redefine a unique 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..e683115 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_rdtsc()); ret = rte_fbarray_init(&local_msl->memseg_arr, name, primary_msl->memseg_arr.len, -- 2.34.1