Skip to content

Commit

Permalink
ofed_scripts/utils/mlnx_tune: Fix CPU detection
Browse files Browse the repository at this point in the history
When a device local NUMA node is not detected, mlnx_tune still
tries to initialize a local CPU list. Fixed two issues:
1. When querying for the CPU list and getting a range, the last core is excluded.
2. On some cases the CPU list has duplications.

Verified on a VM with no NUMA detection.

Signed-off-by: Tal Gilboa <[email protected]>
  • Loading branch information
talgimellanox authored and vladsokolovsky committed Jul 31, 2019
1 parent 061cab6 commit 48eae51
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ofed_scripts/utils/mlnx_tune
Original file line number Diff line number Diff line change
Expand Up @@ -2565,7 +2565,7 @@ class PciDeviceInfo:
for core in output.split(','):
if '-' in core:
values = core.split('-')
cores = range(int(values[0]),int(values[1]))
cores = range(int(values[0]), int(values[1]) + 1)
numa_aware_cores += cores
else:
numa_aware_cores += core
Expand All @@ -2581,7 +2581,7 @@ class PciDeviceInfo:
self.closest_core_list = range(0,node_info.cpu.total_cores)
self.numa_aware_cores = range(0,node_info.cpu.total_cores)

if node_info.cpu.vendor != CPUVendor.IBM:
if node_info.cpu.vendor != CPUVendor.IBM and self.numa != -1:
numa_aware_cores += non_numa_cores
self.numa_aware_core_list = numa_aware_cores

Expand Down

0 comments on commit 48eae51

Please sign in to comment.