patch 'eal/windows: fix core count for more cores per NUMA' has been queued to stable release 25.11.3

Kevin Traynor ktraynor at redhat.com
Thu Jul 23 19:15:57 CEST 2026


Hi,

FYI, your patch has been queued to stable release 25.11.3

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 07/27/26. 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/ce62206692310992142980b44f7157766fddaa57

Thanks.

Kevin

---
>From ce62206692310992142980b44f7157766fddaa57 Mon Sep 17 00:00:00 2001
From: Gena Tertychnyi <genter at microsoft.com>
Date: Wed, 13 May 2026 16:55:18 -0700
Subject: [PATCH] eal/windows: fix core count for more cores per NUMA

[ upstream commit 76f5aaac5898a7acea94c3b3e5e2ab8b24e5f054 ]

Fix specific to Windows NUMA machines with more than 64 cores per node
(e.g. 2 NUMAs with 128 cores each):

- NumaNode.GroupMasks[] array is used instead of NumaNode.GroupMask.
- RelationAll is used instead of RelationNumaNode when calling
GetLogicalProcessorInformationEx because RelationAll returns the full
multi-group NUMA affinity as RelationNumaNode returns only the NUMA
node's primary group.

Fixes: b70a9b788625 ("eal: get/set thread affinity per thread identifier")

Signed-off-by: Gena Tertychnyi <genter at microsoft.com>
Signed-off-by: Andre Muezerie <andremue at linux.microsoft.com>
Acked-by: Dmitry Kozlyuk <dmitry.kozliuk at gmail.com>
---
 .mailmap                    |  1 +
 lib/eal/windows/eal_lcore.c | 68 +++++++++++++++++++++++++++----------
 2 files changed, 52 insertions(+), 17 deletions(-)

diff --git a/.mailmap b/.mailmap
index 1f12a4cb46..3e787a785a 100644
--- a/.mailmap
+++ b/.mailmap
@@ -513,4 +513,5 @@ Gavin Hu <gahu at nvidia.com> <gavin.hu at arm.com>
 Gavin Hu <gahu at nvidia.com> <gavin.hu at linaro.org>
 Gavin Li <gavinl at nvidia.com>
+Gena Tertychnyi <genter at microsoft.com>
 Geoff Thorpe <geoff.thorpe at nxp.com>
 Geoffrey Le Gourriérec <geoffrey.le_gourrierec at 6wind.com>
diff --git a/lib/eal/windows/eal_lcore.c b/lib/eal/windows/eal_lcore.c
index a498044620..d2a2c2d091 100644
--- a/lib/eal/windows/eal_lcore.c
+++ b/lib/eal/windows/eal_lcore.c
@@ -18,11 +18,25 @@
 #define EAL_PROCESSOR_GROUP_SIZE (sizeof(KAFFINITY) * CHAR_BIT)
 
+/*
+ * NUMA_NODE_RELATIONSHIP layout differs:
+ *  - MSVC + modern SDK: GroupCount + GroupMasks[]
+ *  - MinGW-w64: only GroupMask (MinGW headers lag behind Windows SDK ABI changes)
+ */
+#ifdef RTE_TOOLCHAIN_GCC
+#define EAL_NUMA_GROUP_COUNT(numa) (RTE_SET_USED(numa), 1)
+#define EAL_NUMA_GROUP_MASKS(numa) (&((numa).GroupMask))
+#else
+#define EAL_NUMA_GROUP_COUNT(numa) ((numa).GroupCount)
+#define EAL_NUMA_GROUP_MASKS(numa) ((numa).GroupMasks)
+#endif
+
 struct lcore_map {
-	uint8_t socket_id;
-	uint8_t core_id;
+	unsigned int socket_id;
+	unsigned int core_id;
 };
 
 struct socket_map {
 	uint16_t node_id;
+	unsigned int lcore_count;
 };
 
@@ -113,9 +127,13 @@ eal_create_lcore_map(const SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX *info)
 {
 	const unsigned int node_id = info->NumaNode.NodeNumber;
-	const GROUP_AFFINITY *cores = &info->NumaNode.GroupMask;
+	const GROUP_AFFINITY *group_masks = EAL_NUMA_GROUP_MASKS(info->NumaNode);
 	struct lcore_map *lcore;
 	unsigned int socket_id;
+	unsigned int group_count;
+	unsigned int group_no;
 	unsigned int i;
 
+	group_count = EAL_NUMA_GROUP_COUNT(info->NumaNode);
+
 	/*
 	 * NUMA node may be reported multiple times if it includes
@@ -133,18 +151,31 @@ eal_create_lcore_map(const SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX *info)
 
 		cpu_map.sockets[socket_id].node_id = node_id;
+		cpu_map.sockets[socket_id].lcore_count = 0;
 		cpu_map.socket_count++;
 	}
 
-	for (i = 0; i < EAL_PROCESSOR_GROUP_SIZE; i++) {
-		if ((cores->Mask & ((KAFFINITY)1 << i)) == 0)
-			continue;
+	/* Old Windows versions report NUMA nodes with GroupCount == 0 */
+	if (group_count == 0) {
+		group_count = 1;
+		group_masks = &info->NumaNode.GroupMask;
+	}
 
-		if (cpu_map.lcore_count == RTE_DIM(cpu_map.lcores))
-			return true;
+	for (group_no = 0; group_no < group_count; group_no++) {
+		const GROUP_AFFINITY *cores = &group_masks[group_no];
+		for (i = 0; i < EAL_PROCESSOR_GROUP_SIZE; i++) {
+			if ((cores->Mask & ((KAFFINITY)1 << i)) == 0)
+				continue;
 
-		lcore = &cpu_map.lcores[cpu_map.lcore_count];
-		lcore->socket_id = socket_id;
-		lcore->core_id = cores->Group * EAL_PROCESSOR_GROUP_SIZE + i;
-		cpu_map.lcore_count++;
+			if (cpu_map.lcore_count == RTE_DIM(cpu_map.lcores))
+				return true;
+
+			lcore = &cpu_map.lcores[cpu_map.lcore_count];
+			lcore->socket_id = socket_id;
+
+			/* core_id within the socket */
+			lcore->core_id = cpu_map.sockets[socket_id].lcore_count;
+			cpu_map.sockets[socket_id].lcore_count++;
+			cpu_map.lcore_count++;
+		}
 	}
 	return false;
@@ -161,6 +192,7 @@ eal_create_cpu_map(void)
 	infos = NULL;
 	infos_size = 0;
+	/* RelationAll is needed to get full multi-group NUMA affinity */
 	if (!GetLogicalProcessorInformationEx(
-			RelationNumaNode, NULL, &infos_size)) {
+			RelationAll, NULL, &infos_size)) {
 		DWORD error = GetLastError();
 		if (error != ERROR_INSUFFICIENT_BUFFER) {
@@ -182,5 +214,5 @@ eal_create_cpu_map(void)
 
 	if (!GetLogicalProcessorInformationEx(
-			RelationNumaNode, infos, &infos_size)) {
+			RelationAll, infos, &infos_size)) {
 		log_early("Cannot get NUMA node information, error %lu\n",
 			GetLastError());
@@ -192,7 +224,9 @@ eal_create_cpu_map(void)
 	info = infos;
 	while ((uint8_t *)info - (uint8_t *)infos < infos_size) {
-		if (eal_create_lcore_map(info)) {
-			full = true;
-			break;
+		if (info->Relationship == RelationNumaNode) {
+			if (eal_create_lcore_map(info)) {
+				full = true;
+				break;
+			}
 		}
 
-- 
2.55.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-07-23 17:58:01.342889960 +0100
+++ 0094-eal-windows-fix-core-count-for-more-cores-per-NUMA.patch	2026-07-23 17:57:58.715933763 +0100
@@ -1 +1 @@
-From 76f5aaac5898a7acea94c3b3e5e2ab8b24e5f054 Mon Sep 17 00:00:00 2001
+From ce62206692310992142980b44f7157766fddaa57 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 76f5aaac5898a7acea94c3b3e5e2ab8b24e5f054 ]
+
@@ -16 +17,0 @@
-Cc: stable at dpdk.org
@@ -27 +28 @@
-index d1d9cd1743..889b22eabb 100644
+index 1f12a4cb46..3e787a785a 100644
@@ -30 +31 @@
-@@ -516,4 +516,5 @@ Gavin Hu <gahu at nvidia.com> <gavin.hu at arm.com>
+@@ -513,4 +513,5 @@ Gavin Hu <gahu at nvidia.com> <gavin.hu at arm.com>



More information about the stable mailing list