DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH v1 1/1] usertools/devbind: fix NUMA node display
@ 2024-11-28 16:08 Anatoly Burakov
  2024-11-28 17:20 ` Stephen Hemminger
  0 siblings, 1 reply; 2+ messages in thread
From: Anatoly Burakov @ 2024-11-28 16:08 UTC (permalink / raw)
  To: dev, Robin Jarry, Stephen Hemminger

On some systems, 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: a7d69cef8f20 ("usertools/devbind: print device NUMA node")

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 usertools/dpdk-devbind.py | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/usertools/dpdk-devbind.py b/usertools/dpdk-devbind.py
index 34f8f3ed3b..8a4aac371c 100755
--- a/usertools/dpdk-devbind.py
+++ b/usertools/dpdk-devbind.py
@@ -113,7 +113,16 @@
 
 # check if this system has NUMA support
 def is_numa():
-    return os.path.exists('/sys/devices/system/node')
+    if not os.path.exists("/sys/devices/system/node"):
+        return False
+    # occasionally, system may report NUMA support but lspci will not, so we
+    # want to go through all devices and see if any of them do not have NUMANode
+    # property - this will mean it is not safe to try to access it
+    for device_dict in devices.values():
+        if "NUMANode" not in device_dict:
+            return False
+    # all checks passed
+    return True
 
 
 # check if a specific kernel module is loaded
-- 
2.43.5


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-11-28 17:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-28 16:08 [PATCH v1 1/1] usertools/devbind: fix NUMA node display Anatoly Burakov
2024-11-28 17:20 ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).