From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id A2527A04C1; Wed, 20 Nov 2019 03:47:52 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 669DD343C; Wed, 20 Nov 2019 03:47:52 +0100 (CET) Received: from mxct.zte.com.cn (out1.zte.com.cn [202.103.147.172]) by dpdk.org (Postfix) with ESMTP id AC33D2C6D for ; Wed, 20 Nov 2019 03:47:50 +0100 (CET) Received: from mse-fl1.zte.com.cn (unknown [10.30.14.238]) by Forcepoint Email with ESMTPS id 3B13A2F83082C9752067; Wed, 20 Nov 2019 10:47:49 +0800 (CST) Received: from notes_smtp.zte.com.cn (notessmtp.zte.com.cn [10.30.1.239]) by mse-fl1.zte.com.cn with ESMTP id xAK2kPM2024194; Wed, 20 Nov 2019 10:46:25 +0800 (GMT-8) (envelope-from han.li1@zte.com.cn) Received: from localhost.localdomain.localdomain ([10.43.166.165]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2019112010464426-608265 ; Wed, 20 Nov 2019 10:46:44 +0800 From: Li Han To: anatoly.burakov@intel.com Cc: dev@dpdk.org, Li Han Date: Wed, 20 Nov 2019 09:55:17 +0800 Message-Id: <1574214917-7700-1-git-send-email-han.li1@zte.com.cn> X-Mailer: git-send-email 1.8.3.1 X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2019-11-20 10:46:44, Serialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17, 2016) at 2019-11-20 10:46:29, Serialize complete at 2019-11-20 10:46:29 X-MAIL: mse-fl1.zte.com.cn xAK2kPM2024194 Subject: [dpdk-dev] [PATCH] eal/linux: fix muti-secondary msl create issue X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" when we run dpdk in docker, process pid may the same. add rte_rdtsc() to ensure all the names used in rte_fbarray_init are different. Signed-off-by: Li Han --- lib/librte_eal/linux/eal/eal_memalloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/librte_eal/linux/eal/eal_memalloc.c b/lib/librte_eal/linux/eal/eal_memalloc.c index af6d0d0..65a7183 100644 --- a/lib/librte_eal/linux/eal/eal_memalloc.c +++ b/lib/librte_eal/linux/eal/eal_memalloc.c @@ -1374,8 +1374,8 @@ struct rte_memseg * 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, -- 1.8.3.1