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 4F64945845; Thu, 22 Aug 2024 12:38:50 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 10F1542EB5; Thu, 22 Aug 2024 12:38:39 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) by mails.dpdk.org (Postfix) with ESMTP id 950F842E6E for ; Thu, 22 Aug 2024 12:38:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724323114; x=1755859114; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=vYyBpVfZzxekxWxZGuPTeo20QzdcLzIXn5o7T3ZT9vs=; b=Ry+cMH/ZJnM0Bk8KYggaDrc8RzlVTsW9eBk4t9/EGg8mnjQ4d7MtecCP 3KoBxxv5nV89YmYAJV9CScqchg2evq7nB1DfPuJP2SQoxzlV5zIHiEx8o mJcAdn/u/NZE8pGZNX9iyUKk7WCvNbpmSDiUF/ZFyEk/yqV4kTzMoi68T S3gt95EMH7LgxdwcbT5kstRGwDT1Ko6R3mqZRP+uUIyl9qrpLjcRxW8wn i09CCjSonU1jWMRRcxTv5lsIyiJBfP+CY22i0l2lhxALL/MwAThXn5txA M+uw4cuozHMOzPBdFlUayXk1LPhXI0ne0d2NEwCK0yBFhm8v3JzSGQHgX g==; X-CSE-ConnectionGUID: Z4BmvxGSRUC19aKpdbGpDw== X-CSE-MsgGUID: 4Awxn2e6TdWk+w3Zb8o8Vw== X-IronPort-AV: E=McAfee;i="6700,10204,11171"; a="33345957" X-IronPort-AV: E=Sophos;i="6.10,166,1719903600"; d="scan'208";a="33345957" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Aug 2024 03:38:34 -0700 X-CSE-ConnectionGUID: eG/RQBGoTrOBO1T3zhqDKg== X-CSE-MsgGUID: bsgkYxz7RfmOql01H1dPVg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,166,1719903600"; d="scan'208";a="61933353" Received: from silpixa00401119.ir.intel.com ([10.55.129.167]) by orviesa007.jf.intel.com with ESMTP; 22 Aug 2024 03:38:34 -0700 From: Anatoly Burakov To: dev@dpdk.org, Robin Jarry Cc: bruce.richardson@intel.com Subject: [PATCH v6 4/4] usertools/dpdk-devbind: print NUMA node Date: Thu, 22 Aug 2024 11:38:26 +0100 Message-ID: X-Mailer: git-send-email 2.43.5 In-Reply-To: <3dd16eeb15638b8429c38fa77aa83101bf375143.1724323106.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