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 42319457E4; Fri, 16 Aug 2024 14:17:21 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B8B0642DF1; Fri, 16 Aug 2024 14:17:07 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) by mails.dpdk.org (Postfix) with ESMTP id AE6B842DCD for ; Fri, 16 Aug 2024 14:17:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1723810626; x=1755346626; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Rt9FfjyTUeYOBDSjarriTQUHIteL3osXL1rrYffZDhA=; b=XCd9RTrENBZ+SMBush4gd67yyTvSdCvoV7WouBMuL9aWkTzx56EPBnq2 cw8cVXY3Zh3n8vgZlQncGmxn0fp1d0CX2Jhne1GwY5YiLz26q3N0S94oB GO+531sZ5FAFGQrKwS8+YXe63uk/P2TuO5WXr/BXdvTbV25D3qb7Iq8/R FJT5cLz7pwfnsBRSc7Ph68gZke8Xj0T5tN8ehHT5qVxbHimggfQbCV062 SQfrw7Q2Juk7P0uqu5tELOuTzK5YGPDAmBlod2QIQGIE2j9ADaDtvjYtf TTcyi2at8VtMU70f85ThZORfxmnCyJRd3sX2km7tRUWuuQxCmy1KqgLuO w==; X-CSE-ConnectionGUID: xpSaDlocT6Oz0TE06BLerw== X-CSE-MsgGUID: /bAKvhB4TNC136lP/hUr3w== X-IronPort-AV: E=McAfee;i="6700,10204,11166"; a="22276059" X-IronPort-AV: E=Sophos;i="6.10,151,1719903600"; d="scan'208";a="22276059" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Aug 2024 05:17:05 -0700 X-CSE-ConnectionGUID: 7psigz9iQtiFyBmqxdhhbQ== X-CSE-MsgGUID: Q7iZ+RCUT4ycLmasZ2p4JA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,151,1719903600"; d="scan'208";a="59819893" Received: from silpixa00401119.ir.intel.com ([10.55.129.167]) by fmviesa010.fm.intel.com with ESMTP; 16 Aug 2024 05:17:04 -0700 From: Anatoly Burakov To: dev@dpdk.org, Robin Jarry Cc: bruce.richardson@intel.com Subject: [PATCH v2 4/4] usertools/dpdk-devbind: print NUMA node Date: Fri, 16 Aug 2024 13:16:58 +0100 Message-ID: X-Mailer: git-send-email 2.43.5 In-Reply-To: <4844fc3a4604ffef789702752ff04699ab5118db.1723810613.git.anatoly.burakov@intel.com> References: 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 Currently, devbind does not print out any NUMA information, which makes figuring out which NUMA node device belongs to not trivial. Add printouts for NUMA information if NUMA support is enabled on the system. Signed-off-by: Anatoly Burakov --- usertools/dpdk-devbind.py | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/usertools/dpdk-devbind.py b/usertools/dpdk-devbind.py index b276e8efc8..c0611a501d 100755 --- a/usertools/dpdk-devbind.py +++ b/usertools/dpdk-devbind.py @@ -110,6 +110,11 @@ 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 @@ -579,18 +584,24 @@ def show_device_status(devices_type, device_name, if_field=False): # 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" + if is_numa(): + extra_param = "numa_node=%(NUMANode)s " + extra_param display_devices("%s devices using DPDK-compatible driver" % device_name, - dpdk_drv, "drv=%(Driver_str)s unused=%(Module_str)s") + dpdk_drv, extra_param) if kernel_drv: - if_text = "" + extra_param = "drv=%(Driver_str)s unused=%(Module_str)s" if if_field: - if_text = "if=%(Interface)s " - display_devices("%s devices using kernel driver" % device_name, kernel_drv, - if_text + "drv=%(Driver_str)s " - "unused=%(Module_str)s %(Active)s") + extra_param = "if=%(Interface)s " + extra_param + if is_numa(): + extra_param = "numa_node=%(NUMANode)s " + extra_param + display_devices("%s devices using kernel driver" % device_name, + kernel_drv, extra_param) if no_drv: - display_devices("Other %s devices" % device_name, no_drv, - "unused=%(Module_str)s") + extra_param = "unused=%(Module_str)s" + if is_numa(): + extra_param = "numa_node=%(NUMANode)s " + extra_param + display_devices("Other %s devices" % device_name, no_drv, extra_param) def show_status(): -- 2.43.5