From patchwork Wed May 15 07:56: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: 53420 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 1552B5B38; Wed, 15 May 2019 09:57:18 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 507ED5A44; Wed, 15 May 2019 09:57:16 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A63BA305883B; Wed, 15 May 2019 07:57:15 +0000 (UTC) Received: from dmarchan.remote.csb (ovpn-116-80.ams2.redhat.com [10.36.116.80]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5F1EC1001E67; Wed, 15 May 2019 07:57:13 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: thomas@monjalon.net, stephen@networkplumber.org, stable@dpdk.org, Yipeng Wang , Sameh Gobriel , Bruce Richardson , Pablo de Lara Date: Wed, 15 May 2019 09:56:59 +0200 Message-Id: <1557907020-1548-1-git-send-email-david.marchand@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Wed, 15 May 2019 07:57:15 +0000 (UTC) Subject: [dpdk-dev] [PATCH 1/2] test/hash: use existing lcore API 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" Prefer the existing apis rather than direct access the configuration structure. Fixes: c7eb0972e74b ("test/hash: add lock-free r/w concurrency") Fixes: 3f9aab961ed3 ("test/hash: check lock-free extendable bucket") Cc: stable@dpdk.org Signed-off-by: David Marchand Reviewed-by: Maxime Coquelin --- app/test/test_hash_readwrite_lf.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/app/test/test_hash_readwrite_lf.c b/app/test/test_hash_readwrite_lf.c index 4ab4c8e..cd0e7ae 100644 --- a/app/test/test_hash_readwrite_lf.c +++ b/app/test/test_hash_readwrite_lf.c @@ -738,10 +738,9 @@ struct { rte_eal_remote_launch(test_rwc_reader, (void *)(uintptr_t)read_type, enabled_core_ids[i]); - rte_eal_mp_wait_lcore(); for (i = 1; i <= rwc_core_cnt[n]; i++) - if (lcore_config[i].ret < 0) + if (rte_eal_wait_lcore(i) < 0) goto err; unsigned long long cycles_per_lookup = @@ -758,6 +757,7 @@ struct { return 0; err: + rte_eal_mp_wait_lcore(); rte_hash_free(tbl_rwc_test_param.h); return -1; } @@ -808,12 +808,11 @@ struct { enabled_core_ids[i]); ret = write_keys(write_type); writer_done = 1; - rte_eal_mp_wait_lcore(); if (ret < 0) goto err; for (i = 1; i <= rwc_core_cnt[n]; i++) - if (lcore_config[i].ret < 0) + if (rte_eal_wait_lcore(i) < 0) goto err; unsigned long long cycles_per_lookup = @@ -830,6 +829,7 @@ struct { return 0; err: + rte_eal_mp_wait_lcore(); rte_hash_free(tbl_rwc_test_param.h); return -1; } @@ -884,12 +884,11 @@ struct { write_type = WRITE_KEY_SHIFT; ret = write_keys(write_type); writer_done = 1; - rte_eal_mp_wait_lcore(); if (ret < 0) goto err; for (i = 1; i <= rwc_core_cnt[n]; i++) - if (lcore_config[i].ret < 0) + if (rte_eal_wait_lcore(i) < 0) goto err; unsigned long long cycles_per_lookup = @@ -906,6 +905,7 @@ struct { return 0; err: + rte_eal_mp_wait_lcore(); rte_hash_free(tbl_rwc_test_param.h); return -1; } @@ -960,12 +960,11 @@ struct { write_type = WRITE_KEY_SHIFT; ret = write_keys(write_type); writer_done = 1; - rte_eal_mp_wait_lcore(); if (ret < 0) goto err; for (i = 1; i <= rwc_core_cnt[n]; i++) - if (lcore_config[i].ret < 0) + if (rte_eal_wait_lcore(i) < 0) goto err; unsigned long long cycles_per_lookup = @@ -982,6 +981,7 @@ struct { return 0; err: + rte_eal_mp_wait_lcore(); rte_hash_free(tbl_rwc_test_param.h); return -1; } @@ -1035,12 +1035,11 @@ struct { write_type = WRITE_KEY_SHIFT; ret = write_keys(write_type); writer_done = 1; - rte_eal_mp_wait_lcore(); if (ret < 0) goto err; for (i = 1; i <= rwc_core_cnt[n]; i++) - if (lcore_config[i].ret < 0) + if (rte_eal_wait_lcore(i) < 0) goto err; unsigned long long cycles_per_lookup = @@ -1056,6 +1055,7 @@ struct { return 0; err: + rte_eal_mp_wait_lcore(); rte_hash_free(tbl_rwc_test_param.h); return -1; } @@ -1138,10 +1138,8 @@ struct { (multi_writer_done[i] == 0); writer_done = 1; - rte_eal_mp_wait_lcore(); - for (i = 1; i <= rwc_core_cnt[n]; i++) - if (lcore_config[i].ret < 0) + if (rte_eal_wait_lcore(i) < 0) goto err; unsigned long long cycles_per_lookup = @@ -1160,6 +1158,7 @@ struct { return 0; err: + rte_eal_mp_wait_lcore(); rte_hash_free(tbl_rwc_test_param.h); return -1; } @@ -1222,10 +1221,9 @@ struct { } } writer_done = 1; - rte_eal_mp_wait_lcore(); for (i = 1; i <= rwc_core_cnt[n]; i++) - if (lcore_config[i].ret < 0) + if (rte_eal_wait_lcore(i) < 0) goto err; unsigned long long cycles_per_lookup = @@ -1242,6 +1240,7 @@ struct { return 0; err: + rte_eal_mp_wait_lcore(); rte_hash_free(tbl_rwc_test_param.h); return -1; } From patchwork Wed May 15 07:57: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: 53421 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 6DC0F5F1C; Wed, 15 May 2019 09:57:20 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id EFFAC5B2A for ; Wed, 15 May 2019 09:57:17 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5C485300DA3F; Wed, 15 May 2019 07:57:17 +0000 (UTC) Received: from dmarchan.remote.csb (ovpn-116-80.ams2.redhat.com [10.36.116.80]) by smtp.corp.redhat.com (Postfix) with ESMTP id 17CE51001DCB; Wed, 15 May 2019 07:57:15 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: thomas@monjalon.net, stephen@networkplumber.org, Honnappa Nagarahalli Date: Wed, 15 May 2019 09:57:00 +0200 Message-Id: <1557907020-1548-2-git-send-email-david.marchand@redhat.com> In-Reply-To: <1557907020-1548-1-git-send-email-david.marchand@redhat.com> References: <1557907020-1548-1-git-send-email-david.marchand@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Wed, 15 May 2019 07:57:17 +0000 (UTC) Subject: [dpdk-dev] [PATCH 2/2] test/rcu: use existing lcore API 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" Prefer the existing apis rather than direct access lcore_config that is going to disappear. Fixes: b87089b0bb19 ("test/rcu: add API and functional tests") Signed-off-by: David Marchand Reviewed-by: Maxime Coquelin Acked-by: Honnappa Nagarahalli --- app/test/test_rcu_qsbr.c | 22 ++++++++++------------ app/test/test_rcu_qsbr_perf.c | 12 ++++-------- 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/app/test/test_rcu_qsbr.c b/app/test/test_rcu_qsbr.c index ed6934a..92ab0c2 100644 --- a/app/test/test_rcu_qsbr.c +++ b/app/test/test_rcu_qsbr.c @@ -853,11 +853,10 @@ hash_data[0][6] = NULL; writer_done = 1; - /* Wait until all readers have exited */ - rte_eal_mp_wait_lcore(); - /* Check return value from threads */ + + /* Wait and check return value from reader threads */ for (i = 0; i < 4; i++) - if (lcore_config[enabled_core_ids[i]].ret < 0) + if (rte_eal_wait_lcore(enabled_core_ids[i]) < 0) goto error; rte_hash_free(h[0]); rte_free(keys); @@ -913,17 +912,16 @@ rte_eal_remote_launch(test_rcu_qsbr_writer, (void *)(uintptr_t)(i - (test_cores / 2)), enabled_core_ids[i]); - /* Wait for writers to complete */ + /* Wait and check return value from writer threads */ for (i = test_cores / 2; i < test_cores; i++) - rte_eal_wait_lcore(enabled_core_ids[i]); + if (rte_eal_wait_lcore(enabled_core_ids[i]) < 0) + goto error; writer_done = 1; - /* Wait for readers to complete */ - rte_eal_mp_wait_lcore(); - /* Check return value from threads */ - for (i = 0; i < test_cores; i++) - if (lcore_config[enabled_core_ids[i]].ret < 0) + /* Wait and check return value from reader threads */ + for (i = 0; i < test_cores / 2; i++) + if (rte_eal_wait_lcore(enabled_core_ids[i]) < 0) goto error; for (i = 0; i < num_cores / 4; i++) @@ -935,7 +933,7 @@ error: writer_done = 1; - /* Wait until all readers have exited */ + /* Wait until all readers and writers have exited */ rte_eal_mp_wait_lcore(); for (i = 0; i < num_cores / 4; i++) diff --git a/app/test/test_rcu_qsbr_perf.c b/app/test/test_rcu_qsbr_perf.c index 16a43f8..6b1912c 100644 --- a/app/test/test_rcu_qsbr_perf.c +++ b/app/test/test_rcu_qsbr_perf.c @@ -473,11 +473,9 @@ writer_done = 1; - /* Wait until all readers have exited */ - rte_eal_mp_wait_lcore(); - /* Check return value from threads */ + /* Wait and check return value from reader threads */ for (i = 0; i < num_cores; i++) - if (lcore_config[enabled_core_ids[i]].ret < 0) + if (rte_eal_wait_lcore(enabled_core_ids[i]) < 0) goto error; rte_hash_free(h[0]); rte_free(keys); @@ -587,11 +585,9 @@ rte_atomic64_add(&checks, i); writer_done = 1; - /* Wait until all readers have exited */ - rte_eal_mp_wait_lcore(); - /* Check return value from threads */ + /* Wait and check return value from reader threads */ for (i = 0; i < num_cores; i++) - if (lcore_config[enabled_core_ids[i]].ret < 0) + if (rte_eal_wait_lcore(enabled_core_ids[i]) < 0) goto error; rte_hash_free(h[0]); rte_free(keys);