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 394C946468 for ; Mon, 24 Mar 2025 17:18:57 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2F21740DF5; Mon, 24 Mar 2025 17:18:57 +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 39D2D40A71 for ; Mon, 24 Mar 2025 17:18:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1742833134; 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=ZCEacXzgyFAIiG2N7Bjp7PGvB+Svp8eJI0cJd2K5JUE=; b=XfDhSsKaM3IWtakYdUWtnp4gYd2+yYrYHCI9WQbKkLRiBDz3iUG7IVQ5CAKIMPr43Wc+74 8lGINclEe3rShHNaFRXCcQx677LIEre7ltENZ8+9HKe0gb4jr3+fVea3Z5/Z8hEQcD2c6R EXV0uq8WpA4rF0NeB6xe1Ji84RhyoV0= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-662-YV_qCoyuNAy7RJ67BySf_w-1; Mon, 24 Mar 2025 12:18:52 -0400 X-MC-Unique: YV_qCoyuNAy7RJ67BySf_w-1 X-Mimecast-MFC-AGG-ID: YV_qCoyuNAy7RJ67BySf_w_1742833131 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id AA3F019560BB; Mon, 24 Mar 2025 16:18:51 +0000 (UTC) Received: from rh.redhat.com (unknown [10.44.32.16]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 69EA730001A1; Mon, 24 Mar 2025 16:18:50 +0000 (UTC) From: Kevin Traynor To: Bruce Richardson Cc: dpdk stable Subject: patch 'eal: fix undetected NUMA nodes' has been queued to stable release 24.11.2 Date: Mon, 24 Mar 2025 16:16:38 +0000 Message-ID: <20250324161731.63950-31-ktraynor@redhat.com> In-Reply-To: <20250324161731.63950-1-ktraynor@redhat.com> References: <20250324161731.63950-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: lW3hxdfdXKQXWRNeCd-jq18dkDtq_RlsAc-U4jXoE64_1742833131 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true 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 Hi, FYI, your patch has been queued to stable release 24.11.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 03/28/25. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/c77400b42630fc568e99d7565dbe2b75b5081373 Thanks. Kevin --- >From c77400b42630fc568e99d7565dbe2b75b5081373 Mon Sep 17 00:00:00 2001 From: Bruce Richardson Date: Wed, 5 Mar 2025 16:24:58 +0000 Subject: [PATCH] eal: fix undetected NUMA nodes [ upstream commit ef41b96461703c766e4a39ecf4bf7cb731d9617d ] 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=0@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") Signed-off-by: Bruce Richardson --- 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_common_lcore.c index 2ff9252c52..820a6534b1 100644 --- a/lib/eal/common/eal_common_lcore.c +++ b/lib/eal/common/eal_common_lcore.c @@ -145,5 +145,9 @@ rte_eal_cpu_init(void) unsigned count = 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] = {0}; +#else + int lcore_to_socket_id[RTE_MAX_LCORE] = {0}; +#endif /* @@ -184,7 +188,9 @@ rte_eal_cpu_init(void) if (eal_cpu_detected(lcore_id) == 0) continue; + socket_id = eal_cpu_socket_id(lcore_id); + lcore_to_socket_id[lcore_id] = socket_id; EAL_LOG(DEBUG, "Skipped lcore %u as core %u on socket %u", lcore_id, eal_cpu_core_id(lcore_id), - eal_cpu_socket_id(lcore_id)); + socket_id); } @@ -202,10 +208,11 @@ rte_eal_cpu_init(void) prev_socket_id = -1; config->numa_node_count = 0; - for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) { + for (lcore_id = 0; lcore_id < RTE_DIM(lcore_to_socket_id); lcore_id++) { socket_id = lcore_to_socket_id[lcore_id]; if (socket_id != prev_socket_id) - config->numa_nodes[config->numa_node_count++] = - socket_id; + config->numa_nodes[config->numa_node_count++] = socket_id; prev_socket_id = socket_id; + if (config->numa_node_count >= RTE_MAX_NUMA_NODES) + break; } EAL_LOG(INFO, "Detected NUMA nodes: %u", config->numa_node_count); -- 2.48.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2025-03-24 16:15:15.913985309 +0000 +++ 0031-eal-fix-undetected-NUMA-nodes.patch 2025-03-24 16:15:14.860844031 +0000 @@ -1 +1 @@ -From ef41b96461703c766e4a39ecf4bf7cb731d9617d Mon Sep 17 00:00:00 2001 +From c77400b42630fc568e99d7565dbe2b75b5081373 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit ef41b96461703c766e4a39ecf4bf7cb731d9617d ] + @@ -18 +19,0 @@ -Cc: stable@dpdk.org