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 D6AF745DAB; Tue, 26 Nov 2024 14:15:09 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 71C3C40E5A; Tue, 26 Nov 2024 14:15:01 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) by mails.dpdk.org (Postfix) with ESMTP id 8B2D040E48 for ; Tue, 26 Nov 2024 14:14:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1732626898; x=1764162898; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=87XjIv/CXw7LKfePAqWAJeR5p76AJCEg+FJAowphoQw=; b=jMnU4a78LeZ+Wvs0dftdw/0uMFye1+JC5yZjnpE8tm7wbY565Fx2Hf1u WRO2GTBSQacvHKNaM0L9d/RY2h3pwfxDsYZqMm0ui05JKNtMu00Vhq+Zo cuxfubX3IahMw629FOAf8X8Ll8O1YlnaU8l5m05oy62gF4hf7C0wsxzYc Di2KCeWOKds1gyxAYF6GbftoWlzM0otkuNICHG7fQuG/Oe98J+y5C2RlN kNO6EiHekX/MdPAOObiebdMwHqSIichC732peEVnqkC2/0ZwxhbolxuvF 3tr0WfIP3hTp4cfLiGsxKLjDStapYcUzDs7umxOui8agur8QXJZSiCWz/ w==; X-CSE-ConnectionGUID: cpBr2QMZQVi0d84NvMqvIQ== X-CSE-MsgGUID: sn/jR8+gTiCmdpXbqzYTIA== X-IronPort-AV: E=McAfee;i="6700,10204,11268"; a="36447032" X-IronPort-AV: E=Sophos;i="6.12,186,1728975600"; d="scan'208";a="36447032" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Nov 2024 05:14:57 -0800 X-CSE-ConnectionGUID: GOlcSDGRQJecXleEbFz9rw== X-CSE-MsgGUID: zHkh+o7vTzi2Pm/SghSxkA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,186,1728975600"; d="scan'208";a="92013306" Received: from silpixa00401119.ir.intel.com ([10.55.129.167]) by orviesa007.jf.intel.com with ESMTP; 26 Nov 2024 05:14:56 -0800 From: Anatoly Burakov To: dev@dpdk.org, Tyler Retzlaff Subject: [PATCH v1 2/4] lcore: rename socket ID to NUMA ID Date: Tue, 26 Nov 2024 13:14:48 +0000 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 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 bb315dab04..22531a2b19 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