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 EBC264582E; Wed, 21 Aug 2024 11:45:35 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B96A340F35; Wed, 21 Aug 2024 11:45:10 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) by mails.dpdk.org (Postfix) with ESMTP id B25BF40EF1 for ; Wed, 21 Aug 2024 11:45:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724233507; x=1755769507; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=vYyBpVfZzxekxWxZGuPTeo20QzdcLzIXn5o7T3ZT9vs=; b=AJlJ9f0g15UgygoEI95sQa4tL9paem1ayzoi8+gmWy7j9ivXq3AA6QLR UFzgQNTuIsY4QnmFfhmuEyC6ScgX6qecSLEgpghdKQpsk4ctfmG4pdpnj yEccEQ7uZTN6B+tT//pJ490jLARE3mmNjTuTyeWsPw9UKtHC44N7CYHg1 i2DHxlqLD/6yK/XogaKY0Cwof40OT/+yHAIGXDppoYWZBSgv9VPM2Mi83 crXrZF/wkCSo38wm19hEVGd1Y6ABbZqdYMsKl6LQLHtOH7Vqzfowzy4nx UeGEroe7SxsUvcGYjQZ1LQLRuEWJb9cU+LpZzYeBQaOmPUBVmToFqNc+2 g==; X-CSE-ConnectionGUID: lcKUWyW3TgWtgywJWXx+YA== X-CSE-MsgGUID: kd8JL8R6SBC7zn5G2vBxSQ== X-IronPort-AV: E=McAfee;i="6700,10204,11170"; a="22390544" X-IronPort-AV: E=Sophos;i="6.10,164,1719903600"; d="scan'208";a="22390544" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Aug 2024 02:45:06 -0700 X-CSE-ConnectionGUID: q+AnSRO0QfO4QJ7WOD22WQ== X-CSE-MsgGUID: 7saCD+zsTz+e5bUCNwQnJw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,164,1719903600"; d="scan'208";a="91831917" Received: from silpixa00401119.ir.intel.com ([10.55.129.167]) by fmviesa001.fm.intel.com with ESMTP; 21 Aug 2024 02:45:06 -0700 From: Anatoly Burakov To: dev@dpdk.org, Robin Jarry Cc: bruce.richardson@intel.com Subject: [PATCH v5 4/4] usertools/dpdk-devbind: print NUMA node Date: Wed, 21 Aug 2024 10:44:59 +0100 Message-ID: X-Mailer: git-send-email 2.43.5 In-Reply-To: <6646f59acc5a1d93481a06fe7374453d40aad990.1724233499.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 Acked-by: Robin Jarry --- Notes: v1 -> v2: - Added commit to print out NUMA information in devbind usertools/dpdk-devbind.py | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/usertools/dpdk-devbind.py b/usertools/dpdk-devbind.py index b276e8efc8..078e8c387b 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 @@ -577,20 +582,28 @@ 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" + if print_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 print_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 print_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