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 CDB904591D; Fri, 6 Sep 2024 13:47:54 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 88F3742EED; Fri, 6 Sep 2024 13:47:41 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) by mails.dpdk.org (Postfix) with ESMTP id DACE242E8F for ; Fri, 6 Sep 2024 13:47:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1725623259; x=1757159259; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=gBUvp7pNlJm5tn6MUSnmKZJG/5okETLBSkT2BcsFieQ=; b=X3WqwNnFIfB8FR5SIa0xR8oCk0hkH0A4XXLvwTzSl8AJI4SL/va2Uelp ce0/wnk3cgaa3LlVrN6uU0n4UR6Q6ad8H1wF47HfRkbIxHStzgtKEJy/A OXAG/I1rhW3giYFNNGvsDH/NQnjw1XQlnWM2M30F3Eo+3qNM34HnwiNdq 1iJWi/qpamNK4JfhTivZAAN089Cr/xUnzez2EJVF6T0jVjQu8EiKl7XYq 5GGOeZ1wYqEDxFiuTZ08E9LTSSFHs50cpn+WBdb3/pObr6NIV9t/96/F3 R6vrqJXZ0jUIQBGty156tdZyMyLjIteCmLKwJJZPtobtBofAEj/YpojLj g==; X-CSE-ConnectionGUID: x8k7cM7oRuqx+1OkZEJ+9A== X-CSE-MsgGUID: GuN7NFCxSPuj18A2df6ahQ== X-IronPort-AV: E=McAfee;i="6700,10204,11187"; a="13408795" X-IronPort-AV: E=Sophos;i="6.10,207,1719903600"; d="scan'208";a="13408795" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Sep 2024 04:47:38 -0700 X-CSE-ConnectionGUID: 0UN4ymJMTsGTpHanHJftAw== X-CSE-MsgGUID: XoKzaow3QOOSqPOCutGi+g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,207,1719903600"; d="scan'208";a="66162941" Received: from silpixa00401119.ir.intel.com ([10.55.129.167]) by fmviesa010.fm.intel.com with ESMTP; 06 Sep 2024 04:47:37 -0700 From: Anatoly Burakov To: dev@dpdk.org, Tyler Retzlaff Subject: [RFC PATCH v1 2/5] lcore: rename socket ID to NUMA ID Date: Fri, 6 Sep 2024 12:47:28 +0100 Message-ID: <35b496d53a912d84b5ba3926189612bdf83f5882.1725622420.git.anatoly.burakov@intel.com> 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 Rename socket ID to NUMA ID in internal lcore structure. This does not change any user facing API's, although it does alter a couple of log messages. In particular, telemetry API and lcore dump API changes have been omitted as there may be consumers of these API that depend on specifics of messages generated by these API's. Signed-off-by: Anatoly Burakov --- lib/eal/common/eal_common_lcore.c | 10 +++++----- lib/eal/common/eal_common_thread.c | 12 ++++++------ lib/eal/common/eal_private.h | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/eal/common/eal_common_lcore.c b/lib/eal/common/eal_common_lcore.c index 2ff9252c52..ba8fce6607 100644 --- a/lib/eal/common/eal_common_lcore.c +++ b/lib/eal/common/eal_common_lcore.c @@ -115,7 +115,7 @@ unsigned int rte_get_next_lcore(unsigned int i, int skip_main, int wrap) unsigned int rte_lcore_to_socket_id(unsigned int lcore_id) { - return lcore_config[lcore_id].socket_id; + return lcore_config[lcore_id].numa_id; } static int @@ -173,17 +173,17 @@ rte_eal_cpu_init(void) config->lcore_role[lcore_id] = ROLE_RTE; lcore_config[lcore_id].core_role = ROLE_RTE; lcore_config[lcore_id].core_id = eal_cpu_core_id(lcore_id); - lcore_config[lcore_id].socket_id = socket_id; + lcore_config[lcore_id].numa_id = socket_id; EAL_LOG(DEBUG, "Detected lcore %u as " - "core %u on socket %u", + "core %u on NUMA node %u", lcore_id, lcore_config[lcore_id].core_id, - lcore_config[lcore_id].socket_id); + lcore_config[lcore_id].numa_id); count++; } for (; lcore_id < CPU_SETSIZE; lcore_id++) { if (eal_cpu_detected(lcore_id) == 0) continue; - EAL_LOG(DEBUG, "Skipped lcore %u as core %u on socket %u", + EAL_LOG(DEBUG, "Skipped lcore %u as core %u on NUMA node %u", lcore_id, eal_cpu_core_id(lcore_id), eal_cpu_socket_id(lcore_id)); } diff --git a/lib/eal/common/eal_common_thread.c b/lib/eal/common/eal_common_thread.c index a53bc639ae..aa98bdc3ff 100644 --- a/lib/eal/common/eal_common_thread.c +++ b/lib/eal/common/eal_common_thread.c @@ -24,13 +24,13 @@ RTE_DEFINE_PER_LCORE(unsigned int, _lcore_id) = LCORE_ID_ANY; RTE_DEFINE_PER_LCORE(int, _thread_id) = -1; -static RTE_DEFINE_PER_LCORE(unsigned int, _socket_id) = +static RTE_DEFINE_PER_LCORE(unsigned int, _numa_id) = (unsigned int)SOCKET_ID_ANY; static RTE_DEFINE_PER_LCORE(rte_cpuset_t, _cpuset); unsigned rte_socket_id(void) { - return RTE_PER_LCORE(_socket_id); + return RTE_PER_LCORE(_numa_id); } static int @@ -66,8 +66,8 @@ thread_update_affinity(rte_cpuset_t *cpusetp) { unsigned int lcore_id = rte_lcore_id(); - /* store socket_id in TLS for quick access */ - RTE_PER_LCORE(_socket_id) = + /* store numa_id in TLS for quick access */ + RTE_PER_LCORE(_numa_id) = eal_cpuset_socket_id(cpusetp); /* store cpuset in TLS for quick access */ @@ -76,7 +76,7 @@ thread_update_affinity(rte_cpuset_t *cpusetp) if (lcore_id != (unsigned)LCORE_ID_ANY) { /* EAL thread will update lcore_config */ - lcore_config[lcore_id].socket_id = RTE_PER_LCORE(_socket_id); + lcore_config[lcore_id].numa_id = RTE_PER_LCORE(_numa_id); memmove(&lcore_config[lcore_id].cpuset, cpusetp, sizeof(rte_cpuset_t)); } @@ -256,7 +256,7 @@ static int control_thread_init(void *arg) /* Set control thread socket ID to SOCKET_ID_ANY * as control threads may be scheduled on any NUMA node. */ - RTE_PER_LCORE(_socket_id) = SOCKET_ID_ANY; + RTE_PER_LCORE(_numa_id) = SOCKET_ID_ANY; params->ret = rte_thread_set_affinity_by_id(rte_thread_self(), cpuset); if (params->ret != 0) { rte_atomic_store_explicit(¶ms->status, diff --git a/lib/eal/common/eal_private.h b/lib/eal/common/eal_private.h index af09620426..196dadc8a2 100644 --- a/lib/eal/common/eal_private.h +++ b/lib/eal/common/eal_private.h @@ -30,7 +30,7 @@ struct lcore_config { volatile int ret; /**< return value of function */ volatile RTE_ATOMIC(enum rte_lcore_state_t) state; /**< lcore state */ - unsigned int socket_id; /**< physical socket id for this lcore */ + unsigned int numa_id; /**< NUMA node ID for this lcore */ unsigned int core_id; /**< core number on socket for this lcore */ int core_index; /**< relative index, starting from 0 */ uint8_t core_role; /**< role of core eg: OFF, RTE, SERVICE */ -- 2.43.5