Skip to content

Commit

Permalink
usertools/devbind: fix NUMA node display
Browse files Browse the repository at this point in the history
On some systems (particularly ones with NUMA disabled in BIOS), even
though NUMA nodes may be present in sysfs, the lspci command will not
have NUMANode keys in them, which will cause an exception. Fix to check
if NUMANode keys are available in lspci output before enabling NUMA node
output.

Fixes: a7d69ce ("usertools/devbind: print device NUMA node")

Signed-off-by: Anatoly Burakov <[email protected]>
Acked-by: Robin Jarry <[email protected]>
  • Loading branch information
anatolyburakov authored and david-marchand committed Nov 29, 2024
1 parent 828fe9d commit b456bf5
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions usertools/dpdk-devbind.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,6 @@
args = []


# check if this system has NUMA support
def is_numa():
return os.path.exists('/sys/devices/system/node')


# check if a specific kernel module is loaded
def module_is_loaded(module):
global loaded_modules
Expand Down Expand Up @@ -595,9 +590,12 @@ def show_device_status(devices_type, device_name, if_field=False):
dpdk_drv = []
no_drv = []

print_numa = True # by default, assume we can print NUMA information

# split our list of network devices into the three categories above
for d in devices.keys():
if device_type_match(devices[d], devices_type):
print_numa &= "NUMANode" in devices[d]
if not has_driver(d):
no_drv.append(devices[d])
continue
Expand All @@ -616,8 +614,6 @@ def show_device_status(devices_type, device_name, if_field=False):
print("".join('=' * len(msg)))
return

print_numa = is_numa()

# print each category separately, so we can clearly see what's used by DPDK
if dpdk_drv:
extra_param = "drv=%(Driver_str)s unused=%(Module_str)s"
Expand Down

0 comments on commit b456bf5

Please sign in to comment.