From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 09C29A0679 for ; Wed, 3 Apr 2019 19:17:20 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 886541B544; Wed, 3 Apr 2019 19:16:39 +0200 (CEST) Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) by dpdk.org (Postfix) with ESMTP id 7D26F1B4ED for ; Wed, 3 Apr 2019 19:16:21 +0200 (CEST) Received: by mail-pl1-f176.google.com with SMTP id cv12so8355823plb.9 for ; Wed, 03 Apr 2019 10:16:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=VLdGgOA7gWOU0pRdlnAPc9jYagTNPPVxr2crds8eLac=; b=mIzMCEIR213ZWxGjQcPHTcrGh5RqNP3oCK+fXE+t2pHaVL+bFii7cvCyMd8pjloPSh b3j7dC4Rb8go4j3bwAk8xetfd2aGZcPJPs6OnphSRC6OaPJBp7W81B6x+YYUHyg84qHr Jk6nOr9xghlXLR2NOCOSN5RfcO9RUPONdsTfXMqZS7ncpIy4ergytB9QjB/kIfyU1vjP 0yLjnt8DWMGYEJ/l4gvCRRgzCaa3g6638AKWmulr9UC/gNG9AUrI/Kg+bIhloeJ60mSW 3eOXhANmoxRoIfir4v9NRHhQUvOqOlQeTAHIXUOzpTUVl05KK1TJIhs7FhPHWYYCab1z +4vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=VLdGgOA7gWOU0pRdlnAPc9jYagTNPPVxr2crds8eLac=; b=nyxx9mLwQ6g2EabPO7s2lzVV1vokdyQcvbvjdNWcQfyZRIRl00lZ3QC9kGZtqSko+F acf+X/U12WvCMRhnHO0zzbwa8JiwbJeN+2yaJxaU9deHxKiREAQQR+Aha6HsYotAV6Fj zF6/qh2txZUl4Ex4z1KK7pxvXd/YZhEGes8m7DGI94opPfVk6CJXo2nG0RX1mhSsyxxJ /WG0oB4HBvAZbwnwo9945y0FIwa7BPVJKZxIQIoh7G9nX8R5Y5M7XUU4OmB99rBOmDWv M/mVf9YlKESLZu2d9ZB3IquDO0wnXCG7nafSzaYfwkbk3S5Pq2Zjf/r+3SMTTtZLmWd0 sf3w== X-Gm-Message-State: APjAAAVVo0jo0XD6h2590+AjUo8eeaqqFbek9vdxlikJ/cgZsTFAe0HQ 6yPAqEJUBbUMSY+5kkyWBFUsTBpc2Zk2mg== X-Google-Smtp-Source: APXvYqxubdvH4JItNrDNWnk2nSCMDsd7StIFMCosdk+s0lRxH2E+R3g5U2OdZ8lHBpB0taV5x69uGQ== X-Received: by 2002:a17:902:784d:: with SMTP id e13mr1172560pln.152.1554311780392; Wed, 03 Apr 2019 10:16:20 -0700 (PDT) Received: from shemminger-XPS-13-9360.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id k14sm23041693pfb.125.2019.04.03.10.16.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Apr 2019 10:16:19 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Wed, 3 Apr 2019 10:16:09 -0700 Message-Id: <20190403171610.23970-5-stephen@networkplumber.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190403171610.23970-1-stephen@networkplumber.org> References: <20190403171610.23970-1-stephen@networkplumber.org> Subject: [dpdk-dev] [RFC 4/5] app/test: use lcore accessor functions 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" Content-Type: text/plain; charset="UTF-8" Message-ID: <20190403171609.tPeYPvhg_0rpyp1USOom6qF72BwDXGzEc3ZW5kgmgwM@z> Don't refer to lcore_config directly. Signed-off-by: Stephen Hemminger --- app/test/test_cryptodev.c | 2 +- app/test/test_hash_readwrite_lf.c | 12 ++++++------ app/test/test_ring_perf.c | 22 ++++++++++++---------- 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index 2ff204137157..55c5ef7d97a9 100644 --- a/app/test/test_cryptodev.c +++ b/app/test/test_cryptodev.c @@ -378,7 +378,7 @@ testsuite_setup(void) 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_hash_readwrite_lf.c b/app/test/test_hash_readwrite_lf.c index cbfd9322696b..4968d5b49dcd 100644 --- a/app/test/test_hash_readwrite_lf.c +++ b/app/test/test_hash_readwrite_lf.c @@ -622,7 +622,7 @@ test_hash_add_no_ks_lookup_hit(struct rwc_perf *rwc_perf_results, int rwc_lf, rte_eal_mp_wait_lcore(); for (i = 1; i <= rwc_core_cnt[n]; i++) - if (lcore_config[i].ret < 0) + if (rte_lcore_return_code(i) < 0) goto err; unsigned long long cycles_per_lookup = @@ -694,7 +694,7 @@ test_hash_add_no_ks_lookup_miss(struct rwc_perf *rwc_perf_results, int rwc_lf, if (ret < 0) goto err; for (i = 1; i <= rwc_core_cnt[n]; i++) - if (lcore_config[i].ret < 0) + if (rte_lcore_return_code(i) < 0) goto err; unsigned long long cycles_per_lookup = @@ -770,7 +770,7 @@ test_hash_add_ks_lookup_hit_non_sp(struct rwc_perf *rwc_perf_results, if (ret < 0) goto err; for (i = 1; i <= rwc_core_cnt[n]; i++) - if (lcore_config[i].ret < 0) + if (rte_lcore_return_code(i) < 0) goto err; unsigned long long cycles_per_lookup = @@ -846,7 +846,7 @@ test_hash_add_ks_lookup_hit_sp(struct rwc_perf *rwc_perf_results, int rwc_lf, if (ret < 0) goto err; for (i = 1; i <= rwc_core_cnt[n]; i++) - if (lcore_config[i].ret < 0) + if (rte_lcore_return_code(i) < 0) goto err; unsigned long long cycles_per_lookup = @@ -921,7 +921,7 @@ test_hash_add_ks_lookup_miss(struct rwc_perf *rwc_perf_results, int rwc_lf, int if (ret < 0) goto err; for (i = 1; i <= rwc_core_cnt[n]; i++) - if (lcore_config[i].ret < 0) + if (rte_lcore_return_code(i) < 0) goto err; unsigned long long cycles_per_lookup = @@ -1022,7 +1022,7 @@ test_hash_multi_add_lookup(struct rwc_perf *rwc_perf_results, int rwc_lf, rte_eal_mp_wait_lcore(); for (i = 1; i <= rwc_core_cnt[n]; i++) - if (lcore_config[i].ret < 0) + if (rte_lcore_return_code(i) < 0) goto err; unsigned long long cycles_per_lookup = diff --git a/app/test/test_ring_perf.c b/app/test/test_ring_perf.c index ebb3939f51d0..6eccccfe93b4 100644 --- a/app/test/test_ring_perf.c +++ b/app/test/test_ring_perf.c @@ -52,10 +52,11 @@ get_two_hyperthreads(struct lcore_pair *lcp) 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 @@ get_two_cores(struct lcore_pair *lcp) 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 @@ get_two_sockets(struct lcore_pair *lcp) 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; -- 2.17.1