[dpdk-stable] patch 'test/hash: use existing lcore API' has been queued to LTS release 18.11.3

Kevin Traynor ktraynor at redhat.com
Fri Jun 21 18:46:05 CEST 2019


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 <david.marchand at redhat.com>
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 <david.marchand at redhat.com>
Acked-by: Dharmik Thakkar <dharmik.thakkar at arm.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin at redhat.com>
---
 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 at 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:


More information about the stable mailing list