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 A63C545823; Tue, 20 Aug 2024 17:35:45 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 627F340DF6; Tue, 20 Aug 2024 17:35:29 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) by mails.dpdk.org (Postfix) with ESMTP id 230A740BA2 for ; Tue, 20 Aug 2024 17:35:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724168126; x=1755704126; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=vYyBpVfZzxekxWxZGuPTeo20QzdcLzIXn5o7T3ZT9vs=; b=Oq0+g6GIY/CdvddimQmWzOVU2/zWXhkcaQqzp6bJhS2b+YwCOcJIA8XV KoMgcALaCCgP13V/pYGxtBpye2k9di8aRYtlstipD5RRDBZx+nHSUM1iC j2rskoX0EMb/9UU+akAUE71nwhUfgtdhjNsTiVmVHg+IH38jRPwMfPtYj V+ciELj+FD5qjX6iZGcchT+iKJ9yZu2QCNROyLLQddfcfbjOMSUFgn58c x5M0RXI6PgM0Lv4yBUyg1BNkxQSpEEFYUg9lra/8h3N4wjtq4f7u6aI3N TrxbZGnLHegaJJsEtKZU4YA5CN7h0NiCLQHyFXVIea854uTzonJZ3WSeM A==; X-CSE-ConnectionGUID: lCHDiDIoRWKBDXQF9ticQQ== X-CSE-MsgGUID: zUKVg5WOToiW3U6d80GFzQ== X-IronPort-AV: E=McAfee;i="6700,10204,11170"; a="47872789" X-IronPort-AV: E=Sophos;i="6.10,162,1719903600"; d="scan'208";a="47872789" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Aug 2024 08:35:26 -0700 X-CSE-ConnectionGUID: A8v3gHC1T36D10PGrC7Kmw== X-CSE-MsgGUID: HdLV/DPBQrioeaUyNHEYyQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,162,1719903600"; d="scan'208";a="61074491" Received: from silpixa00401119.ir.intel.com ([10.55.129.167]) by orviesa006.jf.intel.com with ESMTP; 20 Aug 2024 08:35:25 -0700 From: Anatoly Burakov To: dev@dpdk.org, Robin Jarry Cc: bruce.richardson@intel.com Subject: [PATCH v3 4/4] usertools/dpdk-devbind: print NUMA node Date: Tue, 20 Aug 2024 16:35:17 +0100 Message-ID: X-Mailer: git-send-email 2.43.5 In-Reply-To: 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