From: Anatoly Burakov <anatoly.burakov@intel.com>
To: dev@dpdk.org, Robin Jarry <rjarry@redhat.com>,
Stephen Hemminger <stephen@networkplumber.org>
Subject: [PATCH v1 1/1] usertools/devbind: fix NUMA node display
Date: Fri, 29 Nov 2024 09:52:24 +0000 [thread overview]
Message-ID: <890de9246f00065a30398729d4c2baf047002584.1732873932.git.anatoly.burakov@intel.com> (raw)
In-Reply-To: <9af1231398c4ba116d3b89164690feace37293a9.1732810125.git.anatoly.burakov@intel.com>
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: a7d69cef8f20 ("usertools/devbind: print device NUMA node")
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
Notes:
This is an alternative fix to patch 34067 [1]
The difference between this and the original patch is that we drop the
check for sysfs node, because it does not give us any useful information,
and instead rely just on lspci dictionary to let us know if it's safe to
enable NUMA node display.
[1] https://patches.dpdk.org/project/dpdk/patch/9af1231398c4ba116d3b89164690feace37293a9.1732810125.git.anatoly.burakov@intel.com/
usertools/dpdk-devbind.py | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/usertools/dpdk-devbind.py b/usertools/dpdk-devbind.py
index 34f8f3ed3b..283707fc16 100755
--- a/usertools/dpdk-devbind.py
+++ b/usertools/dpdk-devbind.py
@@ -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
@@ -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
@@ -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"
--
2.43.5
prev parent reply other threads:[~2024-11-29 9:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-28 16:08 Anatoly Burakov
2024-11-28 17:20 ` Stephen Hemminger
2024-11-29 9:12 ` Burakov, Anatoly
2024-11-29 9:28 ` Burakov, Anatoly
2024-11-29 8:06 ` Robin Jarry
2024-11-29 9:52 ` Anatoly Burakov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=890de9246f00065a30398729d4c2baf047002584.1732873932.git.anatoly.burakov@intel.com \
--to=anatoly.burakov@intel.com \
--cc=dev@dpdk.org \
--cc=rjarry@redhat.com \
--cc=stephen@networkplumber.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).