From patchwork Fri May 31 15:36:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 53959 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5FE361B993; Fri, 31 May 2019 17:37:20 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id EF4BC1B974 for ; Fri, 31 May 2019 17:37:18 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 580F9FA8AF; Fri, 31 May 2019 15:37:13 +0000 (UTC) Received: from dmarchan.remote.csb (ovpn-116-185.ams2.redhat.com [10.36.116.185]) by smtp.corp.redhat.com (Postfix) with ESMTP id F328A60BFC; Fri, 31 May 2019 15:37:11 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: thomas@monjalon.net, stephen@networkplumber.org, bruce.richardson@intel.com Date: Fri, 31 May 2019 17:36:58 +0200 Message-Id: <1559317022-28779-2-git-send-email-david.marchand@redhat.com> In-Reply-To: <1559317022-28779-1-git-send-email-david.marchand@redhat.com> References: <20190408182510.16078-1-stephen@networkplumber.org> <1559317022-28779-1-git-send-email-david.marchand@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 31 May 2019 15:37:13 +0000 (UTC) Subject: [dpdk-dev] [PATCH v5 1/5] eal: use unsigned int in lcore API prototypes X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Stephen Hemminger Purely cosmetic change, use unsigned int instead of unsigned alone. Signed-off-by: Stephen Hemminger Signed-off-by: David Marchand --- lib/librte_eal/common/include/rte_lcore.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) Changelog since v3: - updated title diff --git a/lib/librte_eal/common/include/rte_lcore.h b/lib/librte_eal/common/include/rte_lcore.h index be757a3..705594a 100644 --- a/lib/librte_eal/common/include/rte_lcore.h +++ b/lib/librte_eal/common/include/rte_lcore.h @@ -137,7 +137,7 @@ struct lcore_config { * @return * the ID of current lcoreid's physical socket */ -unsigned rte_socket_id(void); +unsigned int rte_socket_id(void); /** * Return number of physical sockets detected on the system. @@ -177,8 +177,8 @@ struct lcore_config { * @return * the ID of lcoreid's physical socket */ -static inline unsigned -rte_lcore_to_socket_id(unsigned lcore_id) +static inline unsigned int +rte_lcore_to_socket_id(unsigned int lcore_id) { return lcore_config[lcore_id].socket_id; } @@ -193,7 +193,7 @@ struct lcore_config { * True if the given lcore is enabled; false otherwise. */ static inline int -rte_lcore_is_enabled(unsigned lcore_id) +rte_lcore_is_enabled(unsigned int lcore_id) { struct rte_config *cfg = rte_eal_get_configuration(); if (lcore_id >= RTE_MAX_LCORE) @@ -214,8 +214,8 @@ struct lcore_config { * @return * The next lcore_id or RTE_MAX_LCORE if not found. */ -static inline unsigned -rte_get_next_lcore(unsigned i, int skip_master, int wrap) +static inline unsigned int +rte_get_next_lcore(unsigned int i, int skip_master, int wrap) { i++; if (wrap) From patchwork Fri May 31 15:36:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 53958 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 186AF1B964; Fri, 31 May 2019 17:37:17 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id F2E041B964 for ; Fri, 31 May 2019 17:37:15 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5C4738666D; Fri, 31 May 2019 15:37:15 +0000 (UTC) Received: from dmarchan.remote.csb (ovpn-116-185.ams2.redhat.com [10.36.116.185]) by smtp.corp.redhat.com (Postfix) with ESMTP id C6A2960BF7; Fri, 31 May 2019 15:37:13 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: thomas@monjalon.net, stephen@networkplumber.org, bruce.richardson@intel.com Date: Fri, 31 May 2019 17:36:59 +0200 Message-Id: <1559317022-28779-3-git-send-email-david.marchand@redhat.com> In-Reply-To: <1559317022-28779-1-git-send-email-david.marchand@redhat.com> References: <20190408182510.16078-1-stephen@networkplumber.org> <1559317022-28779-1-git-send-email-david.marchand@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 31 May 2019 15:37:15 +0000 (UTC) Subject: [dpdk-dev] [PATCH v5 2/5] eal: add lcore accessors X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Stephen Hemminger The fields of the internal EAL core configuration are currently laid bare as part of the API. This is not good practice and limits fixing issues with layout and sizes. Make new accessor functions for the fields used by current drivers and examples. Signed-off-by: Stephen Hemminger Signed-off-by: David Marchand --- lib/librte_eal/common/eal_common_lcore.c | 33 +++++++++++++++++++++++ lib/librte_eal/common/include/rte_lcore.h | 44 +++++++++++++++++++++---------- lib/librte_eal/rte_eal_version.map | 12 +++++++++ 3 files changed, 75 insertions(+), 14 deletions(-) --- Changelog since v4: - marked rte_lcore_to_cpu_id and rte_lcore_cpuset as experimental Changelog since v3: - updated title - rebased on master - removed doc update - removed unneeded rte_lcore_return_code diff --git a/lib/librte_eal/common/eal_common_lcore.c b/lib/librte_eal/common/eal_common_lcore.c index 8c2744f..38af260 100644 --- a/lib/librte_eal/common/eal_common_lcore.c +++ b/lib/librte_eal/common/eal_common_lcore.c @@ -16,6 +16,39 @@ #include "eal_private.h" #include "eal_thread.h" +int rte_lcore_index(int lcore_id) +{ + if (unlikely(lcore_id >= RTE_MAX_LCORE)) + return -1; + + if (lcore_id < 0) + lcore_id = (int)rte_lcore_id(); + + return lcore_config[lcore_id].core_index; +} + +int rte_lcore_to_cpu_id(int lcore_id) +{ + if (unlikely(lcore_id >= RTE_MAX_LCORE)) + return -1; + + if (lcore_id < 0) + lcore_id = (int)rte_lcore_id(); + + return lcore_config[lcore_id].core_id; +} + +rte_cpuset_t rte_lcore_cpuset(unsigned int lcore_id) +{ + return lcore_config[lcore_id].cpuset; +} + +unsigned int +rte_lcore_to_socket_id(unsigned int lcore_id) +{ + return lcore_config[lcore_id].socket_id; +} + static int socket_id_cmp(const void *a, const void *b) { diff --git a/lib/librte_eal/common/include/rte_lcore.h b/lib/librte_eal/common/include/rte_lcore.h index 705594a..1e3c887 100644 --- a/lib/librte_eal/common/include/rte_lcore.h +++ b/lib/librte_eal/common/include/rte_lcore.h @@ -121,15 +121,7 @@ struct lcore_config { * @return * The relative index, or -1 if not enabled. */ -static inline int -rte_lcore_index(int lcore_id) -{ - if (lcore_id >= RTE_MAX_LCORE) - return -1; - if (lcore_id < 0) - lcore_id = (int)rte_lcore_id(); - return lcore_config[lcore_id].core_index; -} +int rte_lcore_index(int lcore_id); /** * Return the ID of the physical socket of the logical core we are @@ -177,11 +169,35 @@ struct lcore_config { * @return * the ID of lcoreid's physical socket */ -static inline unsigned int -rte_lcore_to_socket_id(unsigned int lcore_id) -{ - return lcore_config[lcore_id].socket_id; -} +unsigned int +rte_lcore_to_socket_id(unsigned int lcore_id); + +/** + * @warning + * @b EXPERIMENTAL: this API may change without prior notice. + * + * Return the id of the lcore on a socket starting from zero. + * + * @param lcore_id + * The targeted lcore, or -1 for the current one. + * @return + * The relative index, or -1 if not enabled. + */ +__rte_experimental int +rte_lcore_to_cpu_id(int lcore_id); + +/** + * @warning + * @b EXPERIMENTAL: this API may change without prior notice. + * + * Return the cpuset for a given lcore. + * @param lcore_id + * the targeted lcore, which MUST be between 0 and RTE_MAX_LCORE-1. + * @return + * The cpuset of that lcore + */ +__rte_experimental rte_cpuset_t +rte_lcore_cpuset(unsigned int lcore_id); /** * Test if an lcore is enabled. diff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map index 2454934..824edf0 100644 --- a/lib/librte_eal/rte_eal_version.map +++ b/lib/librte_eal/rte_eal_version.map @@ -287,6 +287,14 @@ DPDK_19.05 { } DPDK_18.11; +DPDK_19.08 { + global: + + rte_lcore_index; + rte_lcore_to_socket_id; + +} DPDK_19.05; + EXPERIMENTAL { global: @@ -378,4 +386,8 @@ EXPERIMENTAL { rte_service_lcore_attr_get; rte_service_lcore_attr_reset_all; rte_service_may_be_active; + + # added in 19.08 + rte_lcore_cpuset; + rte_lcore_to_cpu_id; }; From patchwork Fri May 31 15:37:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 53960 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B4F7A1B999; Fri, 31 May 2019 17:37:23 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 1F8761B993 for ; Fri, 31 May 2019 17:37:19 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 68DBB9FFE4; Fri, 31 May 2019 15:37:17 +0000 (UTC) Received: from dmarchan.remote.csb (ovpn-116-185.ams2.redhat.com [10.36.116.185]) by smtp.corp.redhat.com (Postfix) with ESMTP id C641A60BFC; Fri, 31 May 2019 15:37:15 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: thomas@monjalon.net, stephen@networkplumber.org, bruce.richardson@intel.com, Hemant Agrawal , Shreyansh Jain Date: Fri, 31 May 2019 17:37:00 +0200 Message-Id: <1559317022-28779-4-git-send-email-david.marchand@redhat.com> In-Reply-To: <1559317022-28779-1-git-send-email-david.marchand@redhat.com> References: <20190408182510.16078-1-stephen@networkplumber.org> <1559317022-28779-1-git-send-email-david.marchand@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 31 May 2019 15:37:17 +0000 (UTC) Subject: [dpdk-dev] [PATCH v5 3/5] drivers/bus: use lcore accessors X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Stephen Hemminger The lcore_config structure will be hidden in future release. Signed-off-by: Stephen Hemminger Signed-off-by: David Marchand --- drivers/bus/dpaa/dpaa_bus.c | 6 ++++-- drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) --- Changelog since v3: - updated title diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c index ac20ecc..08c8227 100644 --- a/drivers/bus/dpaa/dpaa_bus.c +++ b/drivers/bus/dpaa/dpaa_bus.c @@ -254,6 +254,7 @@ int rte_dpaa_portal_init(void *arg) unsigned int cpu, lcore = rte_lcore_id(); int ret; struct dpaa_portal *dpaa_io_portal; + rte_cpuset_t cpuset; BUS_INIT_FUNC_TRACE(); @@ -263,12 +264,13 @@ int rte_dpaa_portal_init(void *arg) if (lcore >= RTE_MAX_LCORE) return -1; - cpu = lcore_config[lcore].core_id; + cpu = rte_lcore_to_cpu_id(lcore); /* Set CPU affinity for this thread.*/ id = pthread_self(); + cpuset = rte_lcore_cpuset(lcore); ret = pthread_setaffinity_np(id, sizeof(cpu_set_t), - &lcore_config[lcore].cpuset); + &cpuset); if (ret) { DPAA_BUS_LOG(ERR, "pthread_setaffinity_np failed on core :%u" " (lcore=%u) with ret: %d", cpu, lcore, ret); diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c index 7bcbde8..8efb24a 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c +++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c @@ -366,7 +366,9 @@ static struct dpaa2_dpio_dev *dpaa2_get_qbman_swp(int lcoreid) for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) { for (i = 0; i < RTE_MAX_LCORE; i++) { - if (CPU_ISSET(i, &lcore_config[lcore_id].cpuset)) { + rte_cpuset_t cpuset = rte_lcore_cpuset(lcore_id); + + if (CPU_ISSET(i, &cpuset)) { RTE_LOG(DEBUG, EAL, "lcore id = %u cpu=%u\n", lcore_id, i); if (dpaa2_cpu[lcore_id] != 0xffffffff) { From patchwork Fri May 31 15:37:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 53961 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 659011B9A4; Fri, 31 May 2019 17:37:26 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 0AE662AB for ; Fri, 31 May 2019 17:37:20 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 74D8B309B15E; Fri, 31 May 2019 15:37:19 +0000 (UTC) Received: from dmarchan.remote.csb (ovpn-116-185.ams2.redhat.com [10.36.116.185]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1915060BFC; Fri, 31 May 2019 15:37:17 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: thomas@monjalon.net, stephen@networkplumber.org, bruce.richardson@intel.com, Chas Williams Date: Fri, 31 May 2019 17:37:01 +0200 Message-Id: <1559317022-28779-5-git-send-email-david.marchand@redhat.com> In-Reply-To: <1559317022-28779-1-git-send-email-david.marchand@redhat.com> References: <20190408182510.16078-1-stephen@networkplumber.org> <1559317022-28779-1-git-send-email-david.marchand@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Fri, 31 May 2019 15:37:19 +0000 (UTC) Subject: [dpdk-dev] [PATCH v5 4/5] examples/bond: use lcore accessors X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Stephen Hemminger Referring to lcore_config directly is no longer recommended. Also remove unnecessary assignment of slave_core_id. Signed-off-by: Stephen Hemminger Signed-off-by: David Marchand --- examples/bond/main.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) --- Changelog since v3: - updated title diff --git a/examples/bond/main.c b/examples/bond/main.c index 9b9ed56..4c650ef 100644 --- a/examples/bond/main.c +++ b/examples/bond/main.c @@ -531,8 +531,9 @@ static void cmd_start_parsed(__attribute__((unused)) void *parsed_result, int slave_core_id = rte_lcore_id(); rte_spinlock_trylock(&global_flag_stru_p->lock); - if (global_flag_stru_p->LcoreMainIsRunning == 0) { - if (lcore_config[global_flag_stru_p->LcoreMainCore].state != WAIT) { + if (global_flag_stru_p->LcoreMainIsRunning == 0) { + if (rte_eal_get_lcore_state(global_flag_stru_p->LcoreMainCore) + != WAIT) { rte_spinlock_unlock(&global_flag_stru_p->lock); return; } @@ -765,7 +766,7 @@ static void prompt(__attribute__((unused)) void *arg1) int main(int argc, char *argv[]) { - int ret; + int ret, slave_core_id; uint16_t nb_ports, i; /* init EAL */ @@ -797,13 +798,13 @@ static void prompt(__attribute__((unused)) void *arg1) bond_port_init(mbuf_pool); rte_spinlock_init(&global_flag_stru_p->lock); - int slave_core_id = rte_lcore_id(); /* check state of lcores */ RTE_LCORE_FOREACH_SLAVE(slave_core_id) { - if (lcore_config[slave_core_id].state != WAIT) - return -EBUSY; + if (rte_eal_get_lcore_state(slave_core_id) != WAIT) + return -EBUSY; } + /* start lcore main on core != master_core - ARP response thread */ slave_core_id = rte_get_next_lcore(rte_lcore_id(), 1, 0); if ((slave_core_id >= RTE_MAX_LCORE) || (slave_core_id == 0)) From patchwork Fri May 31 15:37:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 53962 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 176E71B9A9; Fri, 31 May 2019 17:37:28 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id B819E1B998 for ; Fri, 31 May 2019 17:37:22 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1ECCB309B7B9; Fri, 31 May 2019 15:37:22 +0000 (UTC) Received: from dmarchan.remote.csb (ovpn-116-185.ams2.redhat.com [10.36.116.185]) by smtp.corp.redhat.com (Postfix) with ESMTP id E645860BFC; Fri, 31 May 2019 15:37:19 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: thomas@monjalon.net, stephen@networkplumber.org, bruce.richardson@intel.com, Pablo de Lara , Declan Doherty , Olivier Matz , Gage Eads Date: Fri, 31 May 2019 17:37:02 +0200 Message-Id: <1559317022-28779-6-git-send-email-david.marchand@redhat.com> In-Reply-To: <1559317022-28779-1-git-send-email-david.marchand@redhat.com> References: <20190408182510.16078-1-stephen@networkplumber.org> <1559317022-28779-1-git-send-email-david.marchand@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Fri, 31 May 2019 15:37:22 +0000 (UTC) Subject: [dpdk-dev] [PATCH v5 5/5] test: use lcore accessors X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Stephen Hemminger Don't refer to lcore_config directly. Signed-off-by: Stephen Hemminger Signed-off-by: David Marchand Acked-by: Gage Eads --- app/test/test_cryptodev.c | 2 +- app/test/test_ring_perf.c | 22 ++++++++++++---------- app/test/test_stack_perf.c | 20 ++++++++++---------- 3 files changed, 23 insertions(+), 21 deletions(-) --- Changelog since v3: - updated title - removed parts on test_hash_readwrite_lf diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index 9f31aaa..eca6d3d 100644 --- a/app/test/test_cryptodev.c +++ b/app/test/test_cryptodev.c @@ -378,7 +378,7 @@ struct crypto_unittest_params { strcpy(temp_str, vdev_args); strlcat(temp_str, ";", sizeof(temp_str)); slave_core_count++; - socket_id = lcore_config[i].socket_id; + socket_id = rte_lcore_to_socket_id(i); } if (slave_core_count != 2) { RTE_LOG(ERR, USER1, diff --git a/app/test/test_ring_perf.c b/app/test/test_ring_perf.c index ebb3939..6eccccf 100644 --- a/app/test/test_ring_perf.c +++ b/app/test/test_ring_perf.c @@ -52,10 +52,11 @@ struct lcore_pair { RTE_LCORE_FOREACH(id2) { if (id1 == id2) continue; - c1 = lcore_config[id1].core_id; - c2 = lcore_config[id2].core_id; - s1 = lcore_config[id1].socket_id; - s2 = lcore_config[id2].socket_id; + + c1 = rte_lcore_to_cpu_id(id1); + c2 = rte_lcore_to_cpu_id(id2); + s1 = rte_lcore_to_socket_id(id1); + s2 = rte_lcore_to_socket_id(id2); if ((c1 == c2) && (s1 == s2)){ lcp->c1 = id1; lcp->c2 = id2; @@ -75,10 +76,11 @@ struct lcore_pair { RTE_LCORE_FOREACH(id2) { if (id1 == id2) continue; - c1 = lcore_config[id1].core_id; - c2 = lcore_config[id2].core_id; - s1 = lcore_config[id1].socket_id; - s2 = lcore_config[id2].socket_id; + + c1 = rte_lcore_to_cpu_id(id1); + c2 = rte_lcore_to_cpu_id(id2); + s1 = rte_lcore_to_socket_id(id1); + s2 = rte_lcore_to_socket_id(id2); if ((c1 != c2) && (s1 == s2)){ lcp->c1 = id1; lcp->c2 = id2; @@ -98,8 +100,8 @@ struct lcore_pair { RTE_LCORE_FOREACH(id2) { if (id1 == id2) continue; - s1 = lcore_config[id1].socket_id; - s2 = lcore_config[id2].socket_id; + s1 = rte_lcore_to_socket_id(id1); + s2 = rte_lcore_to_socket_id(id2); if (s1 != s2){ lcp->c1 = id1; lcp->c2 = id2; diff --git a/app/test/test_stack_perf.c b/app/test/test_stack_perf.c index ba27fbf..70561fe 100644 --- a/app/test/test_stack_perf.c +++ b/app/test/test_stack_perf.c @@ -44,10 +44,10 @@ struct lcore_pair { RTE_LCORE_FOREACH(id[1]) { if (id[0] == id[1]) continue; - core[0] = lcore_config[id[0]].core_id; - core[1] = lcore_config[id[1]].core_id; - socket[0] = lcore_config[id[0]].socket_id; - socket[1] = lcore_config[id[1]].socket_id; + core[0] = rte_lcore_to_cpu_id(id[0]); + core[1] = rte_lcore_to_cpu_id(id[1]); + socket[0] = rte_lcore_to_socket_id(id[0]); + socket[1] = rte_lcore_to_socket_id(id[1]); if ((core[0] == core[1]) && (socket[0] == socket[1])) { lcp->c1 = id[0]; lcp->c2 = id[1]; @@ -70,10 +70,10 @@ struct lcore_pair { RTE_LCORE_FOREACH(id[1]) { if (id[0] == id[1]) continue; - core[0] = lcore_config[id[0]].core_id; - core[1] = lcore_config[id[1]].core_id; - socket[0] = lcore_config[id[0]].socket_id; - socket[1] = lcore_config[id[1]].socket_id; + core[0] = rte_lcore_to_cpu_id(id[0]); + core[1] = rte_lcore_to_cpu_id(id[1]); + socket[0] = rte_lcore_to_socket_id(id[0]); + socket[1] = rte_lcore_to_socket_id(id[1]); if ((core[0] != core[1]) && (socket[0] == socket[1])) { lcp->c1 = id[0]; lcp->c2 = id[1]; @@ -95,8 +95,8 @@ struct lcore_pair { RTE_LCORE_FOREACH(id[1]) { if (id[0] == id[1]) continue; - socket[0] = lcore_config[id[0]].socket_id; - socket[1] = lcore_config[id[1]].socket_id; + socket[0] = rte_lcore_to_socket_id(id[0]); + socket[1] = rte_lcore_to_socket_id(id[1]); if (socket[0] != socket[1]) { lcp->c1 = id[0]; lcp->c2 = id[1];