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 1A41E45D13; Fri, 15 Nov 2024 17:38:44 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B967842FEB; Fri, 15 Nov 2024 17:38:43 +0100 (CET) Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) by mails.dpdk.org (Postfix) with ESMTP id CD60242F95 for ; Fri, 15 Nov 2024 17:38:41 +0100 (CET) Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-20c7ee8fe6bso22509955ad.2 for ; Fri, 15 Nov 2024 08:38:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1731688721; x=1732293521; 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=gxM4zaspfX8bxQT0jgJpIjgXk7o70QqqVLNaA0x97BU=; b=z0xxWBK/A2hWtedX29UGiJMT/4ugjKcfOg7yG+3sab4yWNkB3UoD19tDdlDmTJ+26Z pDuhVGw/lg6673JX3fEAKHTKxY5EkVV86hdKKh3RnCgGbbVDDY+d1a4cT0xtvc9vD/WH 2FAxcT+e3IG5dd2nHXrEiPbKkOxAeMEz/wtMtdDwi70dzECPpZZWkvpneP7BPczDiIGM NdA5OAwiP4cmb9DHnPAHv34Gz2+VS1crSQHlj8FKn4KRf3una53W2vt6qOHVw9cjBdrG CRVM7V/mH8w1AzJOKhNa8L9SinQ2E2tPYjETYV/L3QKfWfrWuqjmvys0fzH8JgKyjgw3 1TMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731688721; x=1732293521; 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=gxM4zaspfX8bxQT0jgJpIjgXk7o70QqqVLNaA0x97BU=; b=Qtk3Ou2olnvaKq0k94PJgGXfGu9JgVDOQphDqFbVFqTrTOysTCCB3qiq+3teG7VenA bSZPNW0ESnekSnKnyOyPlraxIjHBm9/thT8IykNCYAbmTiOu8czQZsB+1+MmXHB8R+Nl zQn8Xltzx70ryBeLQh/LrOU8O2aK2JiUzyA9R9DeAg7+ginsTaqgdMMwkSvpNsInZJIh WfJZN89xNzLPb88aQ5qVXeCUC9nPpMaWcDhV5MZbqRf0rG0c4cFF6bRARI7PAGD9siPy YLpxtvQC2olfr0ebTFzY2V1Yey5pUK4D/vihvCETTeLx5WgKUymD0gZtz0caUAgGHHeg GfSQ== X-Gm-Message-State: AOJu0YwK0Xf6apr+FgJrgjrB1hAqSDkgygSEMPKzpM5FQCiLSpZD/Dvo J0oJS0+1oINkJSYT0u+E58Si15VEXszujG2/wRnbwoEweV2QKZmtKPhsNPprM9A= X-Google-Smtp-Source: AGHT+IHJ5UIxKez9DVB31XpEjfQcfi6X1PaJjzGKkXy5cckqMgh3wRo7MIRxZoZP0gWq/gchTqtlkg== X-Received: by 2002:a17:902:e852:b0:20c:98f8:e0fa with SMTP id d9443c01a7336-211d0d62aeemr45217115ad.11.1731688720856; Fri, 15 Nov 2024 08:38:40 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-211d0f53b57sm14086285ad.235.2024.11.15.08.38.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2024 08:38:40 -0800 (PST) Date: Fri, 15 Nov 2024 08:38:39 -0800 From: Stephen Hemminger To: Congjie Zhou Cc: dev@dpdk.org, anatoly.burakov@intel.com Subject: Re: [PATCH v2] eal/linux: fix fbarray name with multiple secondary processes Message-ID: <20241115083839.58e32d8e@hermes.local> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 On Fri, 15 Nov 2024 15:50:08 +0800 Congjie Zhou wrote: > 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()); > Worst case name is now: 'memseg-1048576k-128-128-1234567890-ffffffffffffffff' = 51 characters Acked-by: Stephen Hemminger