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 635BC46426 for ; Wed, 19 Mar 2025 17:32:03 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 433694026B; Wed, 19 Mar 2025 17:32:03 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id BD6794026B for ; Wed, 19 Mar 2025 17:32:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1742401921; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VbnVcWNfsQy6MMCNPknP6Wu/tHncINeijQcghFj0FqU=; b=Uh+iKDW94nURHm4EN6k0YsSU1Ae6i5DB/BbGbAp58GrutMSbQHfJ6DzemvapryCBpq6nBD bArK+k57Ql68nAWPWy0McQOyG4C9uARDcQ7FkLj6myqYQPRjtcPekQmayK2SA20Gno40on G0jxEpaCxxmgRFfDfWwg9NEW1JFDzfI= Received: from mail-lf1-f69.google.com (mail-lf1-f69.google.com [209.85.167.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-674-rbcoeuDpP12W_A14t9fZvQ-1; Wed, 19 Mar 2025 12:31:59 -0400 X-MC-Unique: rbcoeuDpP12W_A14t9fZvQ-1 X-Mimecast-MFC-AGG-ID: rbcoeuDpP12W_A14t9fZvQ_1742401918 Received: by mail-lf1-f69.google.com with SMTP id 2adb3069b0e04-5498ec88462so3400089e87.2 for ; Wed, 19 Mar 2025 09:31:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742401918; x=1743006718; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VbnVcWNfsQy6MMCNPknP6Wu/tHncINeijQcghFj0FqU=; b=liBXC+1w0247LNXdwx3lQckHgWtKafBoebW8I8nmuOKPenkewsiZA7NW22QWSVSIAT P13tYQYA6T6M/eT4/qjavlhRGUF4jWuBeIVaP6gGW/LskZBdqNE+KPMPPOiRlnDPl8Kk 6ixllE8L/B9UHBcMUXRDKQW2zOs+kB1DfH5zT/kJ5qLreGAx4ALOI3i6g2RkB/wioZBF +cIRjDmsB8NSEjfxrmpj+z6g9eVLfIS/LwXfJHKPd0uJZHsjSfAS1SF95kM25E+P+278 H7s/3QN3hQ2Gao3sxe4bt1n4F2Ib6LQUOW9ESRqiDLo+QFUUm/187tS1HKHuN6aPbg3w ISDQ== X-Forwarded-Encrypted: i=1; AJvYcCW/EHO8GW7RPrOdvOC7obsOI6cg3rWAJwg7qGltAD6q9IgUOPxjSTl5TnygA8J1I13pY2DZNRg=@dpdk.org X-Gm-Message-State: AOJu0YxCB6mhwwcLy/WR48llmIN5NiccvqwRtNU4uOIaRIXUIV5m8j+u RgLl3amE+iYlJPFaVHJIilzmj8h9Z890L1VrWhWuQBxVVkoXpoLuSKob19NnNwj8B98+F4ukDxx 594TmKhBfmqXMDuzzLSCcGzLu3CRNk/TS3qOgyNTxZ76Pdg0+Hu+036UC7/1IPPFamTzTuH6VgD 0WWnOYHMSFqV5+SZ6/+iM= X-Gm-Gg: ASbGncuS86SuJ0Zdr3Q3QRS9GX5qfmc8ctdpQ/cXe5dzMk0oQ/B9+ntFlokZnvowleg /mg389ZJ9EBHKRoupXxsDjZl8jQJ20iGG+vnmHcnsHwds7sMnI7s2Nnq8Cu0oHfv70fvwRtQkAy GYviHUMUO0g9HdVf+baVftCXGPIktjLA== X-Received: by 2002:a05:6512:3a8c:b0:549:91dc:22cf with SMTP id 2adb3069b0e04-54acb193440mr1152080e87.2.1742401917981; Wed, 19 Mar 2025 09:31:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEBCZVAcIdRbQQXBaBN20/ONp9zD007uxzuNHu/VnipDig+ly1i1HE+2/6tnoTG2Yjo/y5NNFxOs6e+GrPhGvI= X-Received: by 2002:a05:6512:3a8c:b0:549:91dc:22cf with SMTP id 2adb3069b0e04-54acb193440mr1152061e87.2.1742401917517; Wed, 19 Mar 2025 09:31:57 -0700 (PDT) MIME-Version: 1.0 References: <20250305134720.907347-1-bruce.richardson@intel.com> <20250305162458.1059282-1-bruce.richardson@intel.com> In-Reply-To: <20250305162458.1059282-1-bruce.richardson@intel.com> From: David Marchand Date: Wed, 19 Mar 2025 17:31:45 +0100 X-Gm-Features: AQ5f1Jpxi_vEB1EvFAGn4wfFFQ0bZzpuMCBtfKqJpEiwQgV_hnDxBEd3_pVONCs Message-ID: Subject: Re: [PATCH v2] eal: fix undetected NUMA nodes To: Bruce Richardson Cc: dev@dpdk.org, Anatoly Burakov , stable@dpdk.org X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: V2XtUZopkJwuyPx08GnR9Hxoev1DaCjK6OFG4wUjoOc_1742401918 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org On Wed, Mar 5, 2025 at 5:25=E2=80=AFPM Bruce Richardson wrote: > > In cases where the number of cores on a given socket is greater than > RTE_MAX_LCORES, then EAL will be unaware of all the sockets/numa nodes > on a system. Fix this limitation by having the EAL probe the NUMA node > for cores it isn't going to use, and recording that for completeness. > > This is necessary as memory is tracked per node, and with the --lcores > parameters our app lcores may be on different sockets than the lcore ids > may imply. For example, lcore 0 is on socket zero, but if app is run > with --lcores=3D0@64, then DPDK lcore 0 may be on socket one, so DPDK > needs to be aware of that socket. > > Fixes: 952b20777255 ("eal: provide API for querying valid socket ids") > Cc: stable@dpdk.org > > Signed-off-by: Bruce Richardson On the principle, the fix lgtm. I have one comment. > > --- > v2: handle case where RTE_MAX_LCORE > CPU_SETSIZE (i.e. >1024) > --- > lib/eal/common/eal_common_lcore.c | 17 ++++++++++++----- > 1 file changed, 12 insertions(+), 5 deletions(-) > > diff --git a/lib/eal/common/eal_common_lcore.c b/lib/eal/common/eal_commo= n_lcore.c > index 2ff9252c52..820a6534b1 100644 > --- a/lib/eal/common/eal_common_lcore.c > +++ b/lib/eal/common/eal_common_lcore.c > @@ -144,7 +144,11 @@ rte_eal_cpu_init(void) > unsigned lcore_id; > unsigned count =3D 0; > unsigned int socket_id, prev_socket_id; > - int lcore_to_socket_id[RTE_MAX_LCORE]; > +#if CPU_SETSIZE > RTE_MAX_LCORE > + int lcore_to_socket_id[CPU_SETSIZE] =3D {0}; > +#else > + int lcore_to_socket_id[RTE_MAX_LCORE] =3D {0}; > +#endif This initialisation was unneeded so far because, in the next loop (on each possible lcore), eal_cpu_socket_id() (returning 0 even for errors) was called regardless of eal_cpu_detected(). Moving this call after eal_cpu_detected() would be consistent with the rest of this patch. It is unrelated to this patch itself, but I also have some doubt about the socket_id value stored per lcore, as no check against RTE_MAX_NUMA_NODES is done afterwards. (it is probably never hit since the default value for RTE_MAX_NUMA_NODES is= 32). --=20 David Marchand