Skip to contentSkip to conversation

buildtools: ensure the NUMA nodes are counted correct

PATCH In review Chaoyong He 4 participants 10 messages Aug 2, 2022 – Oct 10, 2022 3 messages not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 buildtools: ensure the NUMA nodes are counted correct

From: Peng Zhang <[email protected]>

Sorting a list of strings with the format "node[0-9]+" in order to find the largest integer by looking at the last item after the sort breaks. But if there are more then 10 items as a string sort will sort "node10" before "node2", it will get the error NUMA nodes.

Solve this by sorting the list based on the integer part of the string.

Fixes 8ef09fdc506b ("build: add optional NUMA and CPU counts detection")
---
 buildtools/get-numa-count.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
buildtools/get-numa-count.py +2 -1
index 1b7787787f..2f243886cd 100644
@@ -6,11 +6,12 @@
 import glob
 import os
 import subprocess
+import re
 
 if os.name == 'posix':
     if os.path.isdir('/sys/devices/system/node'):
         numa_nodes = glob.glob('/sys/devices/system/node/node*')
-        numa_nodes.sort()
+        numa_nodes.sort(key=lambda l: int(re.findall('\d+', l)[0]))
         print(int(os.path.basename(numa_nodes[-1])[4:]) + 1)
     else:
         subprocess.run(['sysctl', '-n', 'vm.ndomains'], check=False)
Signature · 1 line
2.27.0
#1 lore raw

02/08/2022 09:54, Chaoyong He:

Quoted 6 lines

From: Peng Zhang <[email protected]>

Sorting a list of strings with the format "node[0-9]+" in order to find the largest integer by looking at the last item after the sort breaks. But if there are more then 10 items as a string sort will sort "node10" before "node2", it will get the error NUMA nodes.

What is the error you are seeing?

A message that is not in the archive (sent off-list or not yet received): MWHPR1301MB1997EA5A5CF4A320A13493E4EF769@MWHPR1301MB1997.namprd13.prod.outlook.com

A message that is not in the archive (sent off-list or not yet received): 3155813.0WQXIW03uk@thomas

A message that is not in the archive (sent off-list or not yet received): MWHPR1301MB1997910EB07FA86DE33053C2EF799@MWHPR1301MB1997.namprd13.prod.outlook.com

#5 lore raw

PATCH 1/1 buildtools: ensure the NUMA nodes are counted correct

Quoted 24 lines

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: 2022年8月29日 21:15
To: Nole Zhang <[email protected]>; Chaoyong He <[email protected]>
Subject: Re: [PATCH v1] buildtools: ensure the NUMA nodes are counted correct

29/08/2022 13:17, Nole Zhang:

Quoted 12 lines

From: Thomas Monjalon <[email protected]>

Quoted 11 lines

02/08/2022 09:54, Chaoyong He:

Quoted 6 lines

From: Peng Zhang <[email protected]>

Sorting a list of strings with the format "node[0-9]+" in order to find the largest integer by looking at the last item after the sort breaks. But if there are more then 10 items as a string sort will sort "node10" before "node2", it will get the error NUMA nodes.

What is the error you are seeing?

Quoted 9 lines
Quoted 2 lines

We get the error NUMA, in this example, we get the NUMA nodes is 10, But at fact, it has 11 NUMA.

Please give more details, where do you see this error? We should know how to reproduce and check we have the same issue. Thanks

Please reply with a detailed answer on the mailing list.

In the China Phytium S2500 CPU + INSPUR server, it has 16 NUMA. The details are as follows:

~#: lscpu

Architecture:        aarch64
CPU op-mode(s):      64-bit
Byte Order:          Little Endian
CPU(s):              128
On-line CPU(s) list: 0-127
Thread(s) per core:  1
Core(s) per socket:  64
Socket(s):           2
NUMA node(s):        16
Vendor ID:           0x70
Model:               3
Model name:          S2500
Stepping:            0x1
BogoMIPS:            100.00
L1d cache:           4 MiB
L1i cache:           4 MiB
L2 cache:            64 MiB
L3 cache:            128 MiB
NUMA node0 CPU(s):   0-7
NUMA node1 CPU(s):   8-15
NUMA node2 CPU(s):   16-23
NUMA node3 CPU(s):   24-31
NUMA node4 CPU(s):   32-39
NUMA node5 CPU(s):   40-47
NUMA node6 CPU(s):   48-55
NUMA node7 CPU(s):   56-63
NUMA node8 CPU(s):   64-71
NUMA node9 CPU(s):   72-79
NUMA node10 CPU(s):  80-87
NUMA node11 CPU(s):  88-95
NUMA node12 CPU(s):  96-103
NUMA node13 CPU(s):  104-111
NUMA node14 CPU(s):  112-119
NUMA node15 CPU(s):  120-127
Flags:               half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt lpae evtstrm

I use meson build -Dmax_lcores=detect -Dmax_numa_nodes=detect to compile, then dpdk initialization only shows 10 numa.

#6 lore raw

Hi Thomas,

Have you checked if this address the same issue you where seeing? Do you think we can move forward with this fix?

Quoted 76 lines · Nole Zhang
Quoted 24 lines

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: 2022年8月29日 21:15
To: Nole Zhang <[email protected]>; Chaoyong He <[email protected]>
Subject: Re: [PATCH v1] buildtools: ensure the NUMA nodes are counted correct

29/08/2022 13:17, Nole Zhang:

Quoted 12 lines

From: Thomas Monjalon <[email protected]>

Quoted 11 lines

02/08/2022 09:54, Chaoyong He:

Quoted 6 lines

From: Peng Zhang <[email protected]>

Sorting a list of strings with the format "node[0-9]+" in order to find the largest integer by looking at the last item after the sort breaks. But if there are more then 10 items as a string sort will sort "node10" before "node2", it will get the error NUMA nodes.

What is the error you are seeing?

Quoted 9 lines
Quoted 2 lines

We get the error NUMA, in this example, we get the NUMA nodes is 10, But at fact, it has 11 NUMA.

Please give more details, where do you see this error? We should know how to reproduce and check we have the same issue. Thanks

Please reply with a detailed answer on the mailing list.

In the China Phytium S2500 CPU + INSPUR server, it has 16 NUMA. The details are as follows:

~#: lscpu

Architecture:        aarch64
CPU op-mode(s):      64-bit
Byte Order:          Little Endian
CPU(s):              128
On-line CPU(s) list: 0-127
Thread(s) per core:  1
Core(s) per socket:  64
Socket(s):           2
NUMA node(s):        16
Vendor ID:           0x70
Model:               3
Model name:          S2500
Stepping:            0x1
BogoMIPS:            100.00
L1d cache:           4 MiB
L1i cache:           4 MiB
L2 cache:            64 MiB
L3 cache:            128 MiB
NUMA node0 CPU(s):   0-7
NUMA node1 CPU(s):   8-15
NUMA node2 CPU(s):   16-23
NUMA node3 CPU(s):   24-31
NUMA node4 CPU(s):   32-39
NUMA node5 CPU(s):   40-47
NUMA node6 CPU(s):   48-55
NUMA node7 CPU(s):   56-63
NUMA node8 CPU(s):   64-71
NUMA node9 CPU(s):   72-79
NUMA node10 CPU(s):  80-87
NUMA node11 CPU(s):  88-95
NUMA node12 CPU(s):  96-103
NUMA node13 CPU(s):  104-111
NUMA node14 CPU(s):  112-119
NUMA node15 CPU(s):  120-127
Flags:               half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt lpae evtstrm

I use meson build -Dmax_lcores=detect -Dmax_numa_nodes=detect to compile, then dpdk initialization only shows 10 numa.

Signature · 2 lines
Kind Regards,
Niklas Söderlund
#7 lore raw

Hi,

20/09/2022 12:11, Niklas Soderlund:

Quoted 4 lines

Hi Thomas,

Have you checked if this address the same issue you where seeing? Do you think we can move forward with this fix?

Yes. No need to show lscpu output,
but the output of the DPDK initialization would be more interesting.

Quoted 79 lines · Nole Zhang
Quoted 76 lines
Quoted 24 lines

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: 2022年8月29日 21:15
To: Nole Zhang <[email protected]>; Chaoyong He <[email protected]>
Subject: Re: [PATCH v1] buildtools: ensure the NUMA nodes are counted correct

29/08/2022 13:17, Nole Zhang:

Quoted 12 lines

From: Thomas Monjalon <[email protected]>

Quoted 11 lines

02/08/2022 09:54, Chaoyong He:

Quoted 6 lines

From: Peng Zhang <[email protected]>

Sorting a list of strings with the format "node[0-9]+" in order to find the largest integer by looking at the last item after the sort breaks. But if there are more then 10 items as a string sort will sort "node10" before "node2", it will get the error NUMA nodes.

What is the error you are seeing?

Quoted 9 lines
Quoted 2 lines

We get the error NUMA, in this example, we get the NUMA nodes is 10, But at fact, it has 11 NUMA.

Please give more details, where do you see this error? We should know how to reproduce and check we have the same issue. Thanks

Please reply with a detailed answer on the mailing list.

In the China Phytium S2500 CPU + INSPUR server, it has 16 NUMA. The details are as follows:

~#: lscpu

Architecture:        aarch64
CPU op-mode(s):      64-bit
Byte Order:          Little Endian
CPU(s):              128
On-line CPU(s) list: 0-127
Thread(s) per core:  1
Core(s) per socket:  64
Socket(s):           2
NUMA node(s):        16
Vendor ID:           0x70
Model:               3
Model name:          S2500
Stepping:            0x1
BogoMIPS:            100.00
L1d cache:           4 MiB
L1i cache:           4 MiB
L2 cache:            64 MiB
L3 cache:            128 MiB
NUMA node0 CPU(s):   0-7
NUMA node1 CPU(s):   8-15
NUMA node2 CPU(s):   16-23
NUMA node3 CPU(s):   24-31
NUMA node4 CPU(s):   32-39
NUMA node5 CPU(s):   40-47
NUMA node6 CPU(s):   48-55
NUMA node7 CPU(s):   56-63
NUMA node8 CPU(s):   64-71
NUMA node9 CPU(s):   72-79
NUMA node10 CPU(s):  80-87
NUMA node11 CPU(s):  88-95
NUMA node12 CPU(s):  96-103
NUMA node13 CPU(s):  104-111
NUMA node14 CPU(s):  112-119
NUMA node15 CPU(s):  120-127
Flags:               half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt lpae evtstrm

I use meson build -Dmax_lcores=detect -Dmax_numa_nodes=detect to compile, then dpdk initialization only shows 10 numa.

#8 lore raw
Quoted 13 lines

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: 2022年9月20日 21:23
To: Niklas Soderlund <[email protected]>
Cc: Nole Zhang <[email protected]>; [email protected]; Chaoyong He <[email protected]>; oss-drivers <[email protected]>
Subject: Re: FW: [PATCH v1] buildtools: ensure the NUMA nodes are counted correct

Hi,

Quoted 9 lines

20/09/2022 12:11, Niklas Soderlund:

Quoted 4 lines

Hi Thomas,

Have you checked if this address the same issue you where seeing? Do you think we can move forward with this fix?

Yes. No need to show lscpu output,
but the output of the DPDK initialization would be more interesting.

OK, this is the DPDK initialization.

The original code, the dpdkd initialized info:
EAL: Detected CPU lcores: 128
EAL: Detected NUMA nodes: 10
EAL: Static memory layout is selected, amount of reserved memory can be adjusted with -m or --socket-mem
EAL: Detected static linkage of DPDK
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: Selected IOVA mode 'VA'
EAL: VFIO support initialized

Revised code, the dpdkd initialized info:
EAL: Detected CPU lcores: 128
EAL: Detected NUMA nodes: 16
EAL: Static memory layout is selected, amount of reserved memory can be adjusted with -m or --socket-mem
EAL: Detected static linkage of DPDK
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: Selected IOVA mode 'VA'
EAL: VFIO support initialized

Quoted 87 lines
Quoted 14 lines · Nole Zhang
Quoted 12 lines
Quoted 12 lines

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: 2022年8月29日 21:15
To: Nole Zhang <[email protected]>; Chaoyong He <[email protected]>
Subject: Re: [PATCH v1] buildtools: ensure the NUMA nodes are counted correct

29/08/2022 13:17, Nole Zhang:

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

From: Thomas Monjalon <[email protected]>

Quoted 7 lines

02/08/2022 09:54, Chaoyong He:

Quoted 6 lines

From: Peng Zhang <[email protected]>

Sorting a list of strings with the format "node[0-9]+" in order to find the largest integer by looking at the last item after the sort breaks. But if there are more then 10 items as a string sort will sort "node10" before "node2", it will get

the error NUMA nodes.

Quoted 45 lines
Quoted 45 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

What is the error you are seeing?

Quoted 9 lines
Quoted 2 lines

We get the error NUMA, in this example, we get the NUMA nodes is 10, But at fact, it has 11 NUMA.

Please give more details, where do you see this error? We should know how to reproduce and check we have the same issue. Thanks

Please reply with a detailed answer on the mailing list.

In the China Phytium S2500 CPU + INSPUR server, it has 16 NUMA. The details are as follows:

~#: lscpu

Architecture:        aarch64
CPU op-mode(s):      64-bit
Byte Order:          Little Endian
CPU(s):              128
On-line CPU(s) list: 0-127
Thread(s) per core:  1
Core(s) per socket:  64
Socket(s):           2
NUMA node(s):        16
Vendor ID:           0x70
Model:               3
Model name:          S2500
Stepping:            0x1
BogoMIPS:            100.00
L1d cache:           4 MiB
L1i cache:           4 MiB
L2 cache:            64 MiB
L3 cache:            128 MiB
NUMA node0 CPU(s):   0-7
NUMA node1 CPU(s):   8-15
NUMA node2 CPU(s):   16-23
NUMA node3 CPU(s):   24-31
NUMA node4 CPU(s):   32-39
NUMA node5 CPU(s):   40-47
NUMA node6 CPU(s):   48-55
NUMA node7 CPU(s):   56-63
NUMA node8 CPU(s):   64-71
Quoted 8 lines
Quoted 8 lines
NUMA node9 CPU(s):   72-79
NUMA node10 CPU(s):  80-87
NUMA node11 CPU(s):  88-95
NUMA node12 CPU(s):  96-103
NUMA node13 CPU(s):  104-111
NUMA node14 CPU(s):  112-119
NUMA node15 CPU(s):  120-127
Flags:               half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt

lpae evtstrm

Quoted 3 lines
Quoted 3 lines

I use meson build -Dmax_lcores=detect -Dmax_numa_nodes=detect to

compile, then dpdk initialization only shows 10 numa.

Quoted 2 lines
#9 lore raw

Please send a v2 with the proper explanations.

21/09/2022 09:19, Nole Zhang:

Quoted 131 lines
Quoted 12 lines

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: 2022年9月20日 21:23
To: Niklas Soderlund <[email protected]>
Cc: Nole Zhang <[email protected]>; [email protected]; Chaoyong He <[email protected]>; oss-drivers <[email protected]>
Subject: Re: FW: [PATCH v1] buildtools: ensure the NUMA nodes are counted correct

Hi,

Quoted 9 lines

20/09/2022 12:11, Niklas Soderlund:

Quoted 4 lines

Hi Thomas,

Have you checked if this address the same issue you where seeing? Do you think we can move forward with this fix?

Yes. No need to show lscpu output,
but the output of the DPDK initialization would be more interesting.

OK, this is the DPDK initialization.

The original code, the dpdkd initialized info:
EAL: Detected CPU lcores: 128
EAL: Detected NUMA nodes: 10
EAL: Static memory layout is selected, amount of reserved memory can be adjusted with -m or --socket-mem
EAL: Detected static linkage of DPDK
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: Selected IOVA mode 'VA'
EAL: VFIO support initialized

Revised code, the dpdkd initialized info:
EAL: Detected CPU lcores: 128
EAL: Detected NUMA nodes: 16
EAL: Static memory layout is selected, amount of reserved memory can be adjusted with -m or --socket-mem
EAL: Detected static linkage of DPDK
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: Selected IOVA mode 'VA'
EAL: VFIO support initialized

Quoted 87 lines
Quoted 14 lines · Nole Zhang
Quoted 12 lines
Quoted 12 lines

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: 2022年8月29日 21:15
To: Nole Zhang <[email protected]>; Chaoyong He <[email protected]>
Subject: Re: [PATCH v1] buildtools: ensure the NUMA nodes are counted correct

29/08/2022 13:17, Nole Zhang:

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

From: Thomas Monjalon <[email protected]>

Quoted 7 lines

02/08/2022 09:54, Chaoyong He:

Quoted 6 lines

From: Peng Zhang <[email protected]>

Sorting a list of strings with the format "node[0-9]+" in order to find the largest integer by looking at the last item after the sort breaks. But if there are more then 10 items as a string sort will sort "node10" before "node2", it will get

the error NUMA nodes.

Quoted 45 lines
Quoted 45 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

What is the error you are seeing?

Quoted 9 lines
Quoted 2 lines

We get the error NUMA, in this example, we get the NUMA nodes is 10, But at fact, it has 11 NUMA.

Please give more details, where do you see this error? We should know how to reproduce and check we have the same issue. Thanks

Please reply with a detailed answer on the mailing list.

In the China Phytium S2500 CPU + INSPUR server, it has 16 NUMA. The details are as follows:

~#: lscpu

Architecture:        aarch64
CPU op-mode(s):      64-bit
Byte Order:          Little Endian
CPU(s):              128
On-line CPU(s) list: 0-127
Thread(s) per core:  1
Core(s) per socket:  64
Socket(s):           2
NUMA node(s):        16
Vendor ID:           0x70
Model:               3
Model name:          S2500
Stepping:            0x1
BogoMIPS:            100.00
L1d cache:           4 MiB
L1i cache:           4 MiB
L2 cache:            64 MiB
L3 cache:            128 MiB
NUMA node0 CPU(s):   0-7
NUMA node1 CPU(s):   8-15
NUMA node2 CPU(s):   16-23
NUMA node3 CPU(s):   24-31
NUMA node4 CPU(s):   32-39
NUMA node5 CPU(s):   40-47
NUMA node6 CPU(s):   48-55
NUMA node7 CPU(s):   56-63
NUMA node8 CPU(s):   64-71
Quoted 8 lines
Quoted 8 lines
NUMA node9 CPU(s):   72-79
NUMA node10 CPU(s):  80-87
NUMA node11 CPU(s):  88-95
NUMA node12 CPU(s):  96-103
NUMA node13 CPU(s):  104-111
NUMA node14 CPU(s):  112-119
NUMA node15 CPU(s):  120-127
Flags:               half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt

lpae evtstrm

Quoted 3 lines
Quoted 3 lines

I use meson build -Dmax_lcores=detect -Dmax_numa_nodes=detect to

compile, then dpdk initialization only shows 10 numa.

Quoted 2 lines
#10 lore raw

PATCH v2 1/1 buildtools: ensure the NUMA nodes are counted correct

In reply to Chaoyong He

From: Peng Zhang <[email protected]>

The method to fetch, sort and read the last entry of a list to figure out the total number of NUMA nodes in the system fails with 10 or more nodes. The reason being the usage of string compare while sorting, hence node 'node10' will be sorted before 'node2'.

Solve this by sorting the list based on integer comparison of the numerical part of the node name.

Before this change on a system with 16 NUMA nodes,

EAL: Detected CPU lcores: 128
EAL: Detected NUMA nodes: 10
EAL: Static memory layout is selected, amount of reserved memory can
be adjusted with -m or --socket-mem
EAL: Detected static linkage of DPDK
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: Selected IOVA mode 'VA'
EAL: VFIO support initialized

With this change on the same system,

EAL: Detected CPU lcores: 128
EAL: Detected NUMA nodes: 16
EAL: Static memory layout is selected, amount of reserved memory can
be adjusted with -m or --socket-mem
EAL: Detected static linkage of DPDK
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: Selected IOVA mode 'VA'
EAL: VFIO support initialized

Fixes 8ef09fdc506b ("build: add optional NUMA and CPU counts detection")
---
 buildtools/get-numa-count.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
buildtools/get-numa-count.py +2 -1
index 1b7787787f71..2f243886cd21 100644
@@ -6,11 +6,12 @@
 import glob
 import os
 import subprocess
+import re
 
 if os.name == 'posix':
     if os.path.isdir('/sys/devices/system/node'):
         numa_nodes = glob.glob('/sys/devices/system/node/node*')
-        numa_nodes.sort()
+        numa_nodes.sort(key=lambda l: int(re.findall('\d+', l)[0]))
         print(int(os.path.basename(numa_nodes[-1])[4:]) + 1)
     else:
         subprocess.run(['sysctl', '-n', 'vm.ndomains'], check=False)
Signature · 1 line
2.37.3
#11 lore raw

Hi,

Genteel ping on this.

Quoted 63 lines · Niklas Söderlund

From: Peng Zhang <[email protected]>

The method to fetch, sort and read the last entry of a list to figure out the total number of NUMA nodes in the system fails with 10 or more nodes. The reason being the usage of string compare while sorting, hence node 'node10' will be sorted before 'node2'.

Solve this by sorting the list based on integer comparison of the numerical part of the node name.

Before this change on a system with 16 NUMA nodes,

EAL: Detected CPU lcores: 128
EAL: Detected NUMA nodes: 10
EAL: Static memory layout is selected, amount of reserved memory can
be adjusted with -m or --socket-mem
EAL: Detected static linkage of DPDK
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: Selected IOVA mode 'VA'
EAL: VFIO support initialized

With this change on the same system,

EAL: Detected CPU lcores: 128
EAL: Detected NUMA nodes: 16
EAL: Static memory layout is selected, amount of reserved memory can
be adjusted with -m or --socket-mem
EAL: Detected static linkage of DPDK
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: Selected IOVA mode 'VA'
EAL: VFIO support initialized

Fixes 8ef09fdc506b ("build: add optional NUMA and CPU counts detection")
---
 buildtools/get-numa-count.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
buildtools/get-numa-count.py +2 -1
index 1b7787787f71..2f243886cd21 100644
@@ -6,11 +6,12 @@
 import glob
 import os
 import subprocess
+import re
 
 if os.name == 'posix':
     if os.path.isdir('/sys/devices/system/node'):
         numa_nodes = glob.glob('/sys/devices/system/node/node*')
-        numa_nodes.sort()
+        numa_nodes.sort(key=lambda l: int(re.findall('\d+', l)[0]))
         print(int(os.path.basename(numa_nodes[-1])[4:]) + 1)
     else:
         subprocess.run(['sysctl', '-n', 'vm.ndomains'], check=False)
Signature · 1 line
2.37.3
Signature · 2 lines
Kind Regards,
Niklas Söderlund
#12 lore raw
In reply to Niklas Söderlund

22/09/2022 10:06, Niklas Söderlund:

Quoted 32 lines

From: Peng Zhang <[email protected]>

The method to fetch, sort and read the last entry of a list to figure out the total number of NUMA nodes in the system fails with 10 or more nodes. The reason being the usage of string compare while sorting, hence node 'node10' will be sorted before 'node2'.

Solve this by sorting the list based on integer comparison of the numerical part of the node name.

Before this change on a system with 16 NUMA nodes,

EAL: Detected CPU lcores: 128
EAL: Detected NUMA nodes: 10
EAL: Static memory layout is selected, amount of reserved memory can
be adjusted with -m or --socket-mem
EAL: Detected static linkage of DPDK
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: Selected IOVA mode 'VA'
EAL: VFIO support initialized

With this change on the same system,

EAL: Detected CPU lcores: 128
EAL: Detected NUMA nodes: 16
EAL: Static memory layout is selected, amount of reserved memory can
be adjusted with -m or --socket-mem
EAL: Detected static linkage of DPDK
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: Selected IOVA mode 'VA'
EAL: VFIO support initialized

Quoted 6 lines
Fixes 8ef09fdc506b ("build: add optional NUMA and CPU counts detection")

Applied, thanks.