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 A49E745D07; Thu, 14 Nov 2024 18:06:32 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8C9DA4025D; Thu, 14 Nov 2024 18:06:32 +0100 (CET) Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) by mails.dpdk.org (Postfix) with ESMTP id C40404021F for ; Thu, 14 Nov 2024 18:06:30 +0100 (CET) Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-20cbca51687so9765285ad.1 for ; Thu, 14 Nov 2024 09:06:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1731603990; x=1732208790; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=qu21XNz6bnPmYYV/dNtsTt+ujZz/qLS62gpuE2D42Jw=; b=UjV+b9M9MAWhEW3beFhf4EDwwUqAj7TI6QNylh5lo7IJP+oke3Lbk/LCzNGNPwKLlv YX4cugyyXoUs8AbDY8Fhu+tDmZ9N54Y97zQ/zZnhSmpu3b0BDACoCjIuZZuoa6Eirz56 f9sKJUXQuU2tSSffEF3fxiyHWG0b5rZtwZ85KwK9veoGFo/pLEhcZB1DIeMnX3iDkrXH CvzX7Gw+wwoowkU7nCt+uu3afLRxKrscdxKVCKD+QbjO02NEuZTjVXwiYVUHtv6rSb1r 3ZLm5oGMUVJQ+OSTkZjcWwGXy+Vu8+oyfQx+BTmBvX5k/SrxBgXZ29HVjyYgbD5Z9crm 6OYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731603990; x=1732208790; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qu21XNz6bnPmYYV/dNtsTt+ujZz/qLS62gpuE2D42Jw=; b=O138nvqY3Ut1syOlq+hgCMCv4JR5YfnIKp0GNm0iSIcEGC7rtvENLGOwps18O0V+b6 4skd9AQA30g69lj8vECKDV6CV+louxAQISV4xffwrMKClgkvUbYNbzLELVYikG1Tw0XV paR4NYDuhhy9akoC/8A03AVRZfFkiGyjCV+Mzq5v95QLXIdr1OH/2hBxu2Ir3xkfHHj3 H9uMLD0drw+k4/d2pqGVoanik10tGFa7fZB8JteDudsf1XzYojEBt1U2O+EZBiDhFGp3 tllgZAtuxp2sx/xab8hObFEf2neIMMvxPtH2CIGxgjiDzQbkLwOKZUP+dyV3/peY3n7W 59Wg== X-Gm-Message-State: AOJu0Yzw4O+TYTOYXjEKdwou1WbRRMO0/b7F+b0rtrKWAMzlwfPoI++V 18xqxE0CJgXZwY/WZcJc4OJRGSVqp0+cOScEABwVfvGn+Iz4anwEqYMw6hizgTA= X-Google-Smtp-Source: AGHT+IHS9ou5QnF4u8rLP0K7A9JhyFrAw1yI2qfRn2ELY2KJmzeL8gYIVTjNREi9zfy1BanTyYB6dQ== X-Received: by 2002:a17:903:1111:b0:205:8407:6321 with SMTP id d9443c01a7336-211c4f9abb7mr31058765ad.9.1731603989857; Thu, 14 Nov 2024 09:06:29 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-211c7d357e2sm12897875ad.256.2024.11.14.09.06.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Nov 2024 09:06:29 -0800 (PST) Date: Thu, 14 Nov 2024 09:06:27 -0800 From: Stephen Hemminger To: Congjie Zhou Cc: dev@dpdk.org, anatoly.burakov@intel.com Subject: Re: [PATCH] eal/linux: redefine the name for rte_fbarray_init() Message-ID: <20241114090627.65265a75@hermes.local> In-Reply-To: <20241114082459.10a991aa@hermes.local> References: <20241114082459.10a991aa@hermes.local> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable 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 What about using thread id instead? =46rom d1687ffbf865ba0b2d64c35acd602ca43329691e Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Thu, 14 Nov 2024 08:48:54 -0800 Subject: [PATCH] eal: fix fbarray name with multiple secondary processes When multiple secondary processes run in different containers, names identified by PIDs are not unique due to the pid namespace. Add current thread id to the name to be unique. Fixes: 046aa5c4477b ("mem: add memalloc init stage") Cc: anatoly.burakov@intel.com Reported-by: Congjie Zhou Signed-off-by: Stephen Hemminger --- lib/eal/linux/eal_memalloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/eal/linux/eal_memalloc.c b/lib/eal/linux/eal_memalloc.c index e354efc95d..776260e14f 100644 --- a/lib/eal/linux/eal_memalloc.c +++ b/lib/eal/linux/eal_memalloc.c @@ -1447,8 +1447,8 @@ secondary_msl_create_walk(const struct rte_memseg_lis= t *msl, local_msl =3D &local_memsegs[msl_idx]; =20 /* 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_%i", + primary_msl->memseg_arr.name, getpid(), rte_sys_gettid()); =20 ret =3D rte_fbarray_init(&local_msl->memseg_arr, name, primary_msl->memseg_arr.len, --=20 2.45.2