From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0BEFD45DCB; Fri, 29 Nov 2024 10:52:31 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9D9BA402AE; Fri, 29 Nov 2024 10:52:30 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) by mails.dpdk.org (Postfix) with ESMTP id BE1634014F for ; Fri, 29 Nov 2024 10:52:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1732873949; x=1764409949; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=EEcavnW1wnqWscOHuq+Nbb+z0+DFHKH7yQRD7vsDL3s=; b=girYJmkoQPPMFvha0lfMr3+IksJXbe/QkBvAL1H6NUPW4bNIgVyxx5RB 30CY5IwkNX3WG/96+dSHDxvwVmfkbw4g1k4fcnyT0IAtXW4odWQ+t+OzJ uhomcg+g4JTEZTvPioc8CL0PAqe1mk9KlVbQVoaSriVcVKSgpmepXP2hQ 4SkY1SSHyYuarVSvCsajTIg2u/1G+azy7t5WHjId1Wbtp1K5VjlfX9eXg lFErtuPSGC8/yqWWSesemTqPgYJjg2s/xLKts+1fgR9UMRg3k8LdgqVnu +HpVVWJbaNvzGiLHOWizSbpkGKVk4Urclw2/R6VGCu7JHRd7ZBKSdDM6F Q==; X-CSE-ConnectionGUID: Mfk7qEq9QcCyRE7USL2LkQ== X-CSE-MsgGUID: OehfpuOYS8+WSwyHKWdz2Q== X-IronPort-AV: E=McAfee;i="6700,10204,11270"; a="32853096" X-IronPort-AV: E=Sophos;i="6.12,195,1728975600"; d="scan'208";a="32853096" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Nov 2024 01:52:27 -0800 X-CSE-ConnectionGUID: /fPeI6EgTQ+6OcmHl2vc3A== X-CSE-MsgGUID: F3njm7t/RSKIGskipND34w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,195,1728975600"; d="scan'208";a="93289915" Received: from silpixa00401119.ir.intel.com ([10.55.129.167]) by orviesa008.jf.intel.com with ESMTP; 29 Nov 2024 01:52:26 -0800 From: Anatoly Burakov To: dev@dpdk.org, Robin Jarry , Stephen Hemminger Subject: [PATCH v1 1/1] usertools/devbind: fix NUMA node display Date: Fri, 29 Nov 2024 09:52:24 +0000 Message-ID: <890de9246f00065a30398729d4c2baf047002584.1732873932.git.anatoly.burakov@intel.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <9af1231398c4ba116d3b89164690feace37293a9.1732810125.git.anatoly.burakov@intel.com> References: <9af1231398c4ba116d3b89164690feace37293a9.1732810125.git.anatoly.burakov@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 --- 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