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 875E9A0471 for ; Fri, 21 Jun 2019 18:51:01 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 76D555B3A; Fri, 21 Jun 2019 18:51:01 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 8BC215B3A for ; Fri, 21 Jun 2019 18:51:00 +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 06C04307D93F; Fri, 21 Jun 2019 16:51:00 +0000 (UTC) Received: from rh.redhat.com (ovpn-117-77.ams2.redhat.com [10.36.117.77]) by smtp.corp.redhat.com (Postfix) with ESMTP id F243160BFB; Fri, 21 Jun 2019 16:50:45 +0000 (UTC) From: Kevin Traynor To: David Marchand Cc: Dharmik Thakkar , Maxime Coquelin , dpdk stable Date: Fri, 21 Jun 2019 17:46:05 +0100 Message-Id: <20190621164626.31219-21-ktraynor@redhat.com> In-Reply-To: <20190621164626.31219-1-ktraynor@redhat.com> References: <20190621164626.31219-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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.48]); Fri, 21 Jun 2019 16:51:00 +0000 (UTC) Subject: [dpdk-stable] patch 'test/hash: use existing lcore API' has been queued to LTS release 18.11.3 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to LTS release 18.11.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 06/26/19. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable-queue This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable-queue/commit/d62ffd31f241cd23c142a3443c8b7d343673ed76 Thanks. Kevin Traynor --- >From d62ffd31f241cd23c142a3443c8b7d343673ed76 Mon Sep 17 00:00:00 2001 From: David Marchand Date: Wed, 22 May 2019 17:06:56 +0200 Subject: [PATCH] test/hash: use existing lcore API [ upstream commit dfd9d5537e876676014827cdaf24da3718a25bc7 ] Prefer the existing apis rather than direct access the configuration structure. test_hash_multi_add_lookup() currently starts n readers and N writers using rte_eal_remote_launch(). It then waits for the N writers to complete with a custom multi_writer_done[] array to synchronise over. Jump on the occasion to use rte_eal_wait_lcore() so that the code is more straightforward: - we start n readers with rte_eal_remote_launch(), - we start N writers with rte_eal_remote_launch(), - we wait for N writers to join with rte_eal_wait_lcore(), - we wait for n readers to join with rte_eal_wait_lcore(), Fixes: c7eb0972e74b ("test/hash: add lock-free r/w concurrency") Fixes: 3f9aab961ed3 ("test/hash: check lock-free extendable bucket") Signed-off-by: David Marchand Acked-by: Dharmik Thakkar Reviewed-by: Maxime Coquelin --- test/test/test_hash_readwrite_lf.c | 37 ++++++++++++++---------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/test/test/test_hash_readwrite_lf.c b/test/test/test_hash_readwrite_lf.c index cbfd93226..934512ddb 100644 --- a/test/test/test_hash_readwrite_lf.c +++ b/test/test/test_hash_readwrite_lf.c @@ -76,5 +76,4 @@ static rte_atomic64_t greads; static volatile uint8_t writer_done; -static volatile uint8_t multi_writer_done[4]; uint16_t enabled_core_ids[RTE_MAX_LCORE]; @@ -572,5 +571,4 @@ test_rwc_multi_writer(__attribute__((unused)) void *arg) rte_hash_add_key(tbl_rwc_test_param.h, tbl_rwc_test_param.keys_ks + i); - multi_writer_done[pos_core] = 1; return 0; } @@ -620,8 +618,7 @@ test_hash_add_no_ks_lookup_hit(struct rwc_perf *rwc_perf_results, int rwc_lf, (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; @@ -640,4 +637,5 @@ finish: err: + rte_eal_mp_wait_lcore(); rte_hash_free(tbl_rwc_test_param.h); return -1; @@ -690,10 +688,9 @@ test_hash_add_no_ks_lookup_miss(struct rwc_perf *rwc_perf_results, int rwc_lf, ret = write_keys(key_shift); 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; @@ -712,4 +709,5 @@ finish: err: + rte_eal_mp_wait_lcore(); rte_hash_free(tbl_rwc_test_param.h); return -1; @@ -766,10 +764,9 @@ test_hash_add_ks_lookup_hit_non_sp(struct rwc_perf *rwc_perf_results, ret = write_keys(key_shift); 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; @@ -788,4 +785,5 @@ finish: err: + rte_eal_mp_wait_lcore(); rte_hash_free(tbl_rwc_test_param.h); return -1; @@ -842,10 +840,9 @@ test_hash_add_ks_lookup_hit_sp(struct rwc_perf *rwc_perf_results, int rwc_lf, ret = write_keys(key_shift); 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; @@ -864,4 +861,5 @@ finish: err: + rte_eal_mp_wait_lcore(); rte_hash_free(tbl_rwc_test_param.h); return -1; @@ -917,10 +915,9 @@ test_hash_add_ks_lookup_miss(struct rwc_perf *rwc_perf_results, int rwc_lf, int ret = write_keys(key_shift); 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; @@ -938,4 +935,5 @@ finish: err: + rte_eal_mp_wait_lcore(); rte_hash_free(tbl_rwc_test_param.h); return -1; @@ -990,6 +988,4 @@ test_hash_multi_add_lookup(struct rwc_perf *rwc_perf_results, int rwc_lf, rte_hash_reset(tbl_rwc_test_param.h); writer_done = 0; - for (i = 0; i < 4; i++) - multi_writer_done[i] = 0; key_shift = 0; if (write_keys(key_shift) < 0) @@ -1015,13 +1011,13 @@ test_hash_multi_add_lookup(struct rwc_perf *rwc_perf_results, int rwc_lf, /* Wait for writers to complete */ - for (i = 0; i < rwc_core_cnt[m]; i++) - while - (multi_writer_done[i] == 0); + for (i = rwc_core_cnt[n] + 1; + i <= rwc_core_cnt[m] + rwc_core_cnt[n]; + i++) + rte_eal_wait_lcore(i); + 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; @@ -1042,4 +1038,5 @@ finish: err: + rte_eal_mp_wait_lcore(); rte_hash_free(tbl_rwc_test_param.h); return -1; -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2019-06-21 17:22:12.843472177 +0100 +++ 0021-test-hash-use-existing-lcore-API.patch 2019-06-21 17:22:11.732518921 +0100 @@ -1 +1 @@ -From dfd9d5537e876676014827cdaf24da3718a25bc7 Mon Sep 17 00:00:00 2001 +From d62ffd31f241cd23c142a3443c8b7d343673ed76 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit dfd9d5537e876676014827cdaf24da3718a25bc7 ] + @@ -22 +23,0 @@ -Cc: stable@dpdk.org @@ -28,2 +29,2 @@ - app/test/test_hash_readwrite_lf.c | 41 ++++++++++++++----------------- - 1 file changed, 19 insertions(+), 22 deletions(-) + test/test/test_hash_readwrite_lf.c | 37 ++++++++++++++---------------- + 1 file changed, 17 insertions(+), 20 deletions(-) @@ -31,5 +32,5 @@ -diff --git a/app/test/test_hash_readwrite_lf.c b/app/test/test_hash_readwrite_lf.c -index 4ab4c8ee6..343a338b4 100644 ---- a/app/test/test_hash_readwrite_lf.c -+++ b/app/test/test_hash_readwrite_lf.c -@@ -87,5 +87,4 @@ static rte_atomic64_t greads; +diff --git a/test/test/test_hash_readwrite_lf.c b/test/test/test_hash_readwrite_lf.c +index cbfd93226..934512ddb 100644 +--- a/test/test/test_hash_readwrite_lf.c ++++ b/test/test/test_hash_readwrite_lf.c +@@ -76,5 +76,4 @@ static rte_atomic64_t greads; @@ -41 +42 @@ -@@ -691,5 +690,4 @@ test_rwc_multi_writer(__attribute__((unused)) void *arg) +@@ -572,5 +571,4 @@ test_rwc_multi_writer(__attribute__((unused)) void *arg) @@ -47 +48 @@ -@@ -739,8 +737,7 @@ test_hash_add_no_ks_lookup_hit(struct rwc_perf *rwc_perf_results, int rwc_lf, +@@ -620,8 +618,7 @@ test_hash_add_no_ks_lookup_hit(struct rwc_perf *rwc_perf_results, int rwc_lf, @@ -57 +58 @@ -@@ -759,4 +756,5 @@ finish: +@@ -640,4 +637,5 @@ finish: @@ -63,2 +64,2 @@ -@@ -809,10 +807,9 @@ test_hash_add_no_ks_lookup_miss(struct rwc_perf *rwc_perf_results, int rwc_lf, - ret = write_keys(write_type); +@@ -690,10 +688,9 @@ test_hash_add_no_ks_lookup_miss(struct rwc_perf *rwc_perf_results, int rwc_lf, + ret = write_keys(key_shift); @@ -75 +76 @@ -@@ -831,4 +828,5 @@ finish: +@@ -712,4 +709,5 @@ finish: @@ -81,2 +82,2 @@ -@@ -885,10 +883,9 @@ test_hash_add_ks_lookup_hit_non_sp(struct rwc_perf *rwc_perf_results, - ret = write_keys(write_type); +@@ -766,10 +764,9 @@ test_hash_add_ks_lookup_hit_non_sp(struct rwc_perf *rwc_perf_results, + ret = write_keys(key_shift); @@ -93 +94 @@ -@@ -907,4 +904,5 @@ finish: +@@ -788,4 +785,5 @@ finish: @@ -99,2 +100,2 @@ -@@ -961,10 +959,9 @@ test_hash_add_ks_lookup_hit_sp(struct rwc_perf *rwc_perf_results, int rwc_lf, - ret = write_keys(write_type); +@@ -842,10 +840,9 @@ test_hash_add_ks_lookup_hit_sp(struct rwc_perf *rwc_perf_results, int rwc_lf, + ret = write_keys(key_shift); @@ -111 +112 @@ -@@ -983,4 +980,5 @@ finish: +@@ -864,4 +861,5 @@ finish: @@ -117,2 +118,2 @@ -@@ -1036,10 +1034,9 @@ test_hash_add_ks_lookup_miss(struct rwc_perf *rwc_perf_results, int rwc_lf, int - ret = write_keys(write_type); +@@ -917,10 +915,9 @@ test_hash_add_ks_lookup_miss(struct rwc_perf *rwc_perf_results, int rwc_lf, int + ret = write_keys(key_shift); @@ -129 +130 @@ -@@ -1057,4 +1054,5 @@ finish: +@@ -938,4 +935,5 @@ finish: @@ -135 +136 @@ -@@ -1109,6 +1107,4 @@ test_hash_multi_add_lookup(struct rwc_perf *rwc_perf_results, int rwc_lf, +@@ -990,6 +988,4 @@ test_hash_multi_add_lookup(struct rwc_perf *rwc_perf_results, int rwc_lf, @@ -140,3 +141,3 @@ - write_type = WRITE_NO_KEY_SHIFT; - if (write_keys(write_type) < 0) -@@ -1134,13 +1130,13 @@ test_hash_multi_add_lookup(struct rwc_perf *rwc_perf_results, int rwc_lf, + key_shift = 0; + if (write_keys(key_shift) < 0) +@@ -1015,13 +1011,13 @@ test_hash_multi_add_lookup(struct rwc_perf *rwc_perf_results, int rwc_lf, @@ -162,17 +163 @@ -@@ -1161,4 +1157,5 @@ finish: - - err: -+ rte_eal_mp_wait_lcore(); - rte_hash_free(tbl_rwc_test_param.h); - return -1; -@@ -1223,8 +1220,7 @@ test_hash_add_ks_lookup_hit_extbkt(struct rwc_perf *rwc_perf_results, - } - 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; - -@@ -1243,4 +1239,5 @@ finish: +@@ -1042,4 +1038,5 @@ finish: