DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/2] test/hash: use existing lcore API
@ 2019-05-15  7:56 David Marchand
  2019-05-15  7:56 ` David Marchand
                   ` (4 more replies)
  0 siblings, 5 replies; 22+ messages in thread
From: David Marchand @ 2019-05-15  7:56 UTC (permalink / raw)
  To: dev
  Cc: thomas, stephen, stable, Yipeng Wang, Sameh Gobriel,
	Bruce Richardson, Pablo de Lara

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 <david.marchand@redhat.com>
---
 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;
 }
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [dpdk-dev] [PATCH 1/2] test/hash: use existing lcore API
  2019-05-15  7:56 [dpdk-dev] [PATCH 1/2] test/hash: use existing lcore API David Marchand
@ 2019-05-15  7:56 ` David Marchand
  2019-05-15  7:57 ` [dpdk-dev] [PATCH 2/2] test/rcu: " David Marchand
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 22+ messages in thread
From: David Marchand @ 2019-05-15  7:56 UTC (permalink / raw)
  To: dev
  Cc: thomas, stephen, stable, Yipeng Wang, Sameh Gobriel,
	Bruce Richardson, Pablo de Lara

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 <david.marchand@redhat.com>
---
 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;
 }
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 22+ messages in thread

* [dpdk-dev] [PATCH 2/2] test/rcu: use existing lcore API
  2019-05-15  7:56 [dpdk-dev] [PATCH 1/2] test/hash: use existing lcore API David Marchand
  2019-05-15  7:56 ` David Marchand
@ 2019-05-15  7:57 ` David Marchand
  2019-05-15  7:57   ` David Marchand
                     ` (2 more replies)
  2019-05-15 12:14 ` [dpdk-dev] [PATCH 1/2] test/hash: " Maxime Coquelin
                   ` (2 subsequent siblings)
  4 siblings, 3 replies; 22+ messages in thread
From: David Marchand @ 2019-05-15  7:57 UTC (permalink / raw)
  To: dev; +Cc: thomas, stephen, Honnappa Nagarahalli

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 <david.marchand@redhat.com>
---
 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);
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [dpdk-dev] [PATCH 2/2] test/rcu: use existing lcore API
  2019-05-15  7:57 ` [dpdk-dev] [PATCH 2/2] test/rcu: " David Marchand
@ 2019-05-15  7:57   ` David Marchand
  2019-05-15 12:19   ` Maxime Coquelin
  2019-05-15 20:04   ` Honnappa Nagarahalli
  2 siblings, 0 replies; 22+ messages in thread
From: David Marchand @ 2019-05-15  7:57 UTC (permalink / raw)
  To: dev; +Cc: thomas, stephen, Honnappa Nagarahalli

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 <david.marchand@redhat.com>
---
 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);
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [dpdk-dev] [PATCH 1/2] test/hash: use existing lcore API
  2019-05-15  7:56 [dpdk-dev] [PATCH 1/2] test/hash: use existing lcore API David Marchand
  2019-05-15  7:56 ` David Marchand
  2019-05-15  7:57 ` [dpdk-dev] [PATCH 2/2] test/rcu: " David Marchand
@ 2019-05-15 12:14 ` Maxime Coquelin
  2019-05-15 12:14   ` Maxime Coquelin
  2019-05-22  0:16 ` Wang, Yipeng1
  2019-05-22 15:06 ` [dpdk-dev] [PATCH v2 " David Marchand
  4 siblings, 1 reply; 22+ messages in thread
From: Maxime Coquelin @ 2019-05-15 12:14 UTC (permalink / raw)
  To: David Marchand, dev
  Cc: thomas, stephen, stable, Yipeng Wang, Sameh Gobriel,
	Bruce Richardson, Pablo de Lara



On 5/15/19 9:56 AM, David Marchand wrote:
> 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<david.marchand@redhat.com>
> ---
>   app/test/test_hash_readwrite_lf.c | 29 ++++++++++++++---------------
>   1 file changed, 14 insertions(+), 15 deletions(-)


Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [dpdk-dev] [PATCH 1/2] test/hash: use existing lcore API
  2019-05-15 12:14 ` [dpdk-dev] [PATCH 1/2] test/hash: " Maxime Coquelin
@ 2019-05-15 12:14   ` Maxime Coquelin
  0 siblings, 0 replies; 22+ messages in thread
From: Maxime Coquelin @ 2019-05-15 12:14 UTC (permalink / raw)
  To: David Marchand, dev
  Cc: thomas, stephen, stable, Yipeng Wang, Sameh Gobriel,
	Bruce Richardson, Pablo de Lara



On 5/15/19 9:56 AM, David Marchand wrote:
> 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<david.marchand@redhat.com>
> ---
>   app/test/test_hash_readwrite_lf.c | 29 ++++++++++++++---------------
>   1 file changed, 14 insertions(+), 15 deletions(-)


Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [dpdk-dev] [PATCH 2/2] test/rcu: use existing lcore API
  2019-05-15  7:57 ` [dpdk-dev] [PATCH 2/2] test/rcu: " David Marchand
  2019-05-15  7:57   ` David Marchand
@ 2019-05-15 12:19   ` Maxime Coquelin
  2019-05-15 12:19     ` Maxime Coquelin
  2019-05-15 20:04   ` Honnappa Nagarahalli
  2 siblings, 1 reply; 22+ messages in thread
From: Maxime Coquelin @ 2019-05-15 12:19 UTC (permalink / raw)
  To: David Marchand, dev; +Cc: thomas, stephen, Honnappa Nagarahalli



On 5/15/19 9:57 AM, David Marchand wrote:
> 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<david.marchand@redhat.com>
> ---
>   app/test/test_rcu_qsbr.c      | 22 ++++++++++------------
>   app/test/test_rcu_qsbr_perf.c | 12 ++++--------
>   2 files changed, 14 insertions(+), 20 deletions(-)


Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [dpdk-dev] [PATCH 2/2] test/rcu: use existing lcore API
  2019-05-15 12:19   ` Maxime Coquelin
@ 2019-05-15 12:19     ` Maxime Coquelin
  0 siblings, 0 replies; 22+ messages in thread
From: Maxime Coquelin @ 2019-05-15 12:19 UTC (permalink / raw)
  To: David Marchand, dev; +Cc: thomas, stephen, Honnappa Nagarahalli



On 5/15/19 9:57 AM, David Marchand wrote:
> 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<david.marchand@redhat.com>
> ---
>   app/test/test_rcu_qsbr.c      | 22 ++++++++++------------
>   app/test/test_rcu_qsbr_perf.c | 12 ++++--------
>   2 files changed, 14 insertions(+), 20 deletions(-)


Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [dpdk-dev] [PATCH 2/2] test/rcu: use existing lcore API
  2019-05-15  7:57 ` [dpdk-dev] [PATCH 2/2] test/rcu: " David Marchand
  2019-05-15  7:57   ` David Marchand
  2019-05-15 12:19   ` Maxime Coquelin
@ 2019-05-15 20:04   ` Honnappa Nagarahalli
  2019-05-15 20:04     ` Honnappa Nagarahalli
  2 siblings, 1 reply; 22+ messages in thread
From: Honnappa Nagarahalli @ 2019-05-15 20:04 UTC (permalink / raw)
  To: David Marchand, dev; +Cc: thomas, stephen, nd, nd

> 
> 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 <david.marchand@redhat.com>
> ---
>  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);
> --
> 1.8.3.1

Acked-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [dpdk-dev] [PATCH 2/2] test/rcu: use existing lcore API
  2019-05-15 20:04   ` Honnappa Nagarahalli
@ 2019-05-15 20:04     ` Honnappa Nagarahalli
  0 siblings, 0 replies; 22+ messages in thread
From: Honnappa Nagarahalli @ 2019-05-15 20:04 UTC (permalink / raw)
  To: David Marchand, dev; +Cc: thomas, stephen, nd, nd

> 
> 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 <david.marchand@redhat.com>
> ---
>  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);
> --
> 1.8.3.1

Acked-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [dpdk-dev] [PATCH 1/2] test/hash: use existing lcore API
  2019-05-15  7:56 [dpdk-dev] [PATCH 1/2] test/hash: use existing lcore API David Marchand
                   ` (2 preceding siblings ...)
  2019-05-15 12:14 ` [dpdk-dev] [PATCH 1/2] test/hash: " Maxime Coquelin
@ 2019-05-22  0:16 ` Wang, Yipeng1
  2019-05-22 12:40   ` David Marchand
  2019-05-22 15:06 ` [dpdk-dev] [PATCH v2 " David Marchand
  4 siblings, 1 reply; 22+ messages in thread
From: Wang, Yipeng1 @ 2019-05-22  0:16 UTC (permalink / raw)
  To: David Marchand, dev, Dharmik Thakkar
  Cc: thomas, stephen, stable, Gobriel, Sameh, Richardson, Bruce,
	De Lara Guarch, Pablo

>-----Original Message-----
>From: David Marchand [mailto:david.marchand@redhat.com]
>Sent: Wednesday, May 15, 2019 12:57 AM
>To: dev@dpdk.org
>Cc: thomas@monjalon.net; stephen@networkplumber.org; stable@dpdk.org; Wang, Yipeng1 <yipeng1.wang@intel.com>; Gobriel,
>Sameh <sameh.gobriel@intel.com>; Richardson, Bruce <bruce.richardson@intel.com>; De Lara Guarch, Pablo
><pablo.de.lara.guarch@intel.com>
>Subject: [PATCH 1/2] test/hash: use existing lcore API
>
>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 <david.marchand@redhat.com>
>---
> app/test/test_hash_readwrite_lf.c | 29 ++++++++++++++---------------
> 1 file changed, 14 insertions(+), 15 deletions(-)
>

[Wang, Yipeng] 

Hi, David, I tested the patch and the test case seems now frozen after running in the middle. Have you seen same thing?

I include the original author Dharmik for the file for more reviews.


Output:

"
....

Test: Hash add - key shift, Hash lookup - miss

Number of readers: 1
Cycles per lookup: 112

Number of readers: 2
Cycles per lookup: 113

Number of readers: 4
Cycles per lookup: 116

** With bulk-lookup **

Number of readers: 1
Cycles per lookup: 41

Number of readers: 2
Cycles per lookup: 40

Number of readers: 4
Cycles per lookup: 40

Test: Multi-add-lookup

Number of writers: 2
Number of readers: 1
Cycles per lookup: 166

Number of writers: 2
Number of readers: 2
"
<Freezing here>


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [dpdk-dev] [PATCH 1/2] test/hash: use existing lcore API
  2019-05-22  0:16 ` Wang, Yipeng1
@ 2019-05-22 12:40   ` David Marchand
  0 siblings, 0 replies; 22+ messages in thread
From: David Marchand @ 2019-05-22 12:40 UTC (permalink / raw)
  To: Wang, Yipeng1
  Cc: dev, Dharmik Thakkar, thomas, stephen, stable, Gobriel, Sameh,
	Richardson, Bruce, De Lara Guarch, Pablo

Hello,

On Wed, May 22, 2019 at 2:16 AM Wang, Yipeng1 <yipeng1.wang@intel.com>
wrote:

> >-----Original Message-----
> >From: David Marchand [mailto:david.marchand@redhat.com]
> >Sent: Wednesday, May 15, 2019 12:57 AM
> >To: dev@dpdk.org
> >Cc: thomas@monjalon.net; stephen@networkplumber.org; stable@dpdk.org;
> Wang, Yipeng1 <yipeng1.wang@intel.com>; Gobriel,
> >Sameh <sameh.gobriel@intel.com>; Richardson, Bruce <
> bruce.richardson@intel.com>; De Lara Guarch, Pablo
> ><pablo.de.lara.guarch@intel.com>
> >Subject: [PATCH 1/2] test/hash: use existing lcore API
> >
> >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 <david.marchand@redhat.com>
> >---
> > app/test/test_hash_readwrite_lf.c | 29 ++++++++++++++---------------
> > 1 file changed, 14 insertions(+), 15 deletions(-)
> >
>
> [Wang, Yipeng]
>
> Hi, David, I tested the patch and the test case seems now frozen after
> running in the middle. Have you seen same thing?
>
> I include the original author Dharmik for the file for more reviews.
>
>
> Output:
>
> "
> ....
>
> Test: Hash add - key shift, Hash lookup - miss
>
> Number of readers: 1
> Cycles per lookup: 112
>
> Number of readers: 2
> Cycles per lookup: 113
>
> Number of readers: 4
> Cycles per lookup: 116
>
> ** With bulk-lookup **
>
> Number of readers: 1
> Cycles per lookup: 41
>
> Number of readers: 2
> Cycles per lookup: 40
>
> Number of readers: 4
> Cycles per lookup: 40
>
> Test: Multi-add-lookup
>
> Number of writers: 2
> Number of readers: 1
> Cycles per lookup: 166
>
> Number of writers: 2
> Number of readers: 2
> "
> <Freezing here>
>

Thanks for reporting.

I reproduced the issue.
I did not catch it as I was starting the test with 4 cores on my laptop.
I will post a fix and/or an updated patch.

-- 
David Marchand

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [dpdk-dev] [PATCH v2 1/2] test/hash: use existing lcore API
  2019-05-15  7:56 [dpdk-dev] [PATCH 1/2] test/hash: use existing lcore API David Marchand
                   ` (3 preceding siblings ...)
  2019-05-22  0:16 ` Wang, Yipeng1
@ 2019-05-22 15:06 ` David Marchand
  2019-05-22 15:06   ` [dpdk-dev] [PATCH v2 2/2] test/rcu: " David Marchand
                     ` (2 more replies)
  4 siblings, 3 replies; 22+ messages in thread
From: David Marchand @ 2019-05-22 15:06 UTC (permalink / raw)
  To: dev
  Cc: thomas, stephen, maxime.coquelin, Dharmik.Thakkar, stable,
	Yipeng Wang, Sameh Gobriel, Bruce Richardson, Pablo de Lara

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")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 app/test/test_hash_readwrite_lf.c | 41 ++++++++++++++++++---------------------
 1 file changed, 19 insertions(+), 22 deletions(-)

---
Changelog since v1:
- fixed test hang in test_hash_multi_add_lookup() reported by Wang, Yipeng

diff --git a/app/test/test_hash_readwrite_lf.c b/app/test/test_hash_readwrite_lf.c
index 4ab4c8e..343a338 100644
--- a/app/test/test_hash_readwrite_lf.c
+++ b/app/test/test_hash_readwrite_lf.c
@@ -86,7 +86,6 @@ struct {
 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];
 
@@ -690,7 +689,6 @@ struct {
 	for (i = offset; i < offset + tbl_rwc_test_param.single_insert; i++)
 		rte_hash_add_key(tbl_rwc_test_param.h,
 				 tbl_rwc_test_param.keys_ks + i);
-	multi_writer_done[pos_core] = 1;
 	return 0;
 }
 
@@ -738,10 +736,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 +755,7 @@ struct {
 	return 0;
 
 err:
+	rte_eal_mp_wait_lcore();
 	rte_hash_free(tbl_rwc_test_param.h);
 	return -1;
 }
@@ -808,12 +806,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 +827,7 @@ struct {
 	return 0;
 
 err:
+	rte_eal_mp_wait_lcore();
 	rte_hash_free(tbl_rwc_test_param.h);
 	return -1;
 }
@@ -884,12 +882,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 +903,7 @@ struct {
 	return 0;
 
 err:
+	rte_eal_mp_wait_lcore();
 	rte_hash_free(tbl_rwc_test_param.h);
 	return -1;
 }
@@ -960,12 +958,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 +979,7 @@ struct {
 	return 0;
 
 err:
+	rte_eal_mp_wait_lcore();
 	rte_hash_free(tbl_rwc_test_param.h);
 	return -1;
 }
@@ -1035,12 +1033,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 +1053,7 @@ struct {
 	return 0;
 
 err:
+	rte_eal_mp_wait_lcore();
 	rte_hash_free(tbl_rwc_test_param.h);
 	return -1;
 }
@@ -1108,8 +1106,6 @@ struct {
 
 				rte_hash_reset(tbl_rwc_test_param.h);
 				writer_done = 0;
-				for (i = 0; i < 4; i++)
-					multi_writer_done[i] = 0;
 				write_type = WRITE_NO_KEY_SHIFT;
 				if (write_keys(write_type) < 0)
 					goto err;
@@ -1133,15 +1129,15 @@ struct {
 				}
 
 				/* Wait for writers to complete */
-				for (i = 0; i < rwc_core_cnt[m]; i++)
-					while
-						(multi_writer_done[i] == 0);
-				writer_done = 1;
+				for (i = rwc_core_cnt[n] + 1;
+				     i <= rwc_core_cnt[m] + rwc_core_cnt[n];
+				     i++)
+					rte_eal_wait_lcore(i);
 
-				rte_eal_mp_wait_lcore();
+				writer_done = 1;
 
 				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 +1156,7 @@ struct {
 	return 0;
 
 err:
+	rte_eal_mp_wait_lcore();
 	rte_hash_free(tbl_rwc_test_param.h);
 	return -1;
 }
@@ -1222,10 +1219,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 +1238,7 @@ struct {
 	return 0;
 
 err:
+	rte_eal_mp_wait_lcore();
 	rte_hash_free(tbl_rwc_test_param.h);
 	return -1;
 }
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 22+ messages in thread

* [dpdk-dev] [PATCH v2 2/2] test/rcu: use existing lcore API
  2019-05-22 15:06 ` [dpdk-dev] [PATCH v2 " David Marchand
@ 2019-05-22 15:06   ` David Marchand
  2019-05-23 14:20     ` Maxime Coquelin
  2019-05-22 16:26   ` [dpdk-dev] [PATCH v2 1/2] test/hash: " Dharmik Thakkar
  2019-05-23 12:48   ` Maxime Coquelin
  2 siblings, 1 reply; 22+ messages in thread
From: David Marchand @ 2019-05-22 15:06 UTC (permalink / raw)
  To: dev
  Cc: thomas, stephen, maxime.coquelin, Dharmik.Thakkar, stable,
	Honnappa Nagarahalli

Prefer the existing apis rather than direct access lcore_config that is
going to disappear.

Fixes: b87089b0bb19 ("test/rcu: add API and functional tests")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 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);
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/2] test/hash: use existing lcore API
  2019-05-22 15:06 ` [dpdk-dev] [PATCH v2 " David Marchand
  2019-05-22 15:06   ` [dpdk-dev] [PATCH v2 2/2] test/rcu: " David Marchand
@ 2019-05-22 16:26   ` Dharmik Thakkar
  2019-05-22 17:17     ` David Marchand
  2019-05-23 12:48   ` Maxime Coquelin
  2 siblings, 1 reply; 22+ messages in thread
From: Dharmik Thakkar @ 2019-05-22 16:26 UTC (permalink / raw)
  To: David Marchand
  Cc: dev, thomas, Stephen Hemminger, maxime.coquelin, stable,
	Yipeng Wang, Sameh Gobriel, Bruce Richardson, Pablo de Lara, nd

Hi David,

Thank you for the patch!

Some comments inlined.

> On May 22, 2019, at 10:06 AM, David Marchand <david.marchand@redhat.com> wrote:
> 
> 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")
> Cc: stable@dpdk.org
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
> app/test/test_hash_readwrite_lf.c | 41 ++++++++++++++++++---------------------
> 1 file changed, 19 insertions(+), 22 deletions(-)
> 
> ---
> Changelog since v1:
> - fixed test hang in test_hash_multi_add_lookup() reported by Wang, Yipeng
> 
> diff --git a/app/test/test_hash_readwrite_lf.c b/app/test/test_hash_readwrite_lf.c
> index 4ab4c8e..343a338 100644
> --- a/app/test/test_hash_readwrite_lf.c
> +++ b/app/test/test_hash_readwrite_lf.c
> @@ -86,7 +86,6 @@ struct {
> 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];
> 
> @@ -690,7 +689,6 @@ struct {
> 	for (i = offset; i < offset + tbl_rwc_test_param.single_insert; i++)
> 		rte_hash_add_key(tbl_rwc_test_param.h,
> 				 tbl_rwc_test_param.keys_ks + i);
> -	multi_writer_done[pos_core] = 1;
> 	return 0;
> }
> 
> @@ -738,10 +736,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)
if (rte_eal_wait_lcore(enabled_core_ids[i]) < 0)

(There are similar changes in other functions too.
I realize that this is a separate issue than what the patch is aimed for.
If you see fit, please integrate it, else I will put out a patch once your patch has been merged.)
> 					goto err;
> 
> 			unsigned long long cycles_per_lookup =
> @@ -758,6 +755,7 @@ struct {
> 	return 0;
> 
> err:
> +	rte_eal_mp_wait_lcore();
> 	rte_hash_free(tbl_rwc_test_param.h);
> 	return -1;
> }
> @@ -808,12 +806,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)
if (rte_eal_wait_lcore(enabled_core_ids[i]) < 0)
> 					goto err;
> 
> 			unsigned long long cycles_per_lookup =
> @@ -830,6 +827,7 @@ struct {
> 	return 0;
> 
> err:
> +	rte_eal_mp_wait_lcore();
> 	rte_hash_free(tbl_rwc_test_param.h);
> 	return -1;
> }
> @@ -884,12 +882,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)
if (rte_eal_wait_lcore(enabled_core_ids[i]) < 0)
> 					goto err;
> 
> 			unsigned long long cycles_per_lookup =
> @@ -906,6 +903,7 @@ struct {
> 	return 0;
> 
> err:
> +	rte_eal_mp_wait_lcore();
> 	rte_hash_free(tbl_rwc_test_param.h);
> 	return -1;
> }
> @@ -960,12 +958,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)
if (rte_eal_wait_lcore(enabled_core_ids[i]) < 0)
> 					goto err;
> 
> 			unsigned long long cycles_per_lookup =
> @@ -982,6 +979,7 @@ struct {
> 	return 0;
> 
> err:
> +	rte_eal_mp_wait_lcore();
> 	rte_hash_free(tbl_rwc_test_param.h);
> 	return -1;
> }
> @@ -1035,12 +1033,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)
if (rte_eal_wait_lcore(enabled_core_ids[i]) < 0)
> 					goto err;
> 
> 			unsigned long long cycles_per_lookup =
> @@ -1056,6 +1053,7 @@ struct {
> 	return 0;
> 
> err:
> +	rte_eal_mp_wait_lcore();
> 	rte_hash_free(tbl_rwc_test_param.h);
> 	return -1;
> }
> @@ -1108,8 +1106,6 @@ struct {
> 
> 				rte_hash_reset(tbl_rwc_test_param.h);
> 				writer_done = 0;
> -				for (i = 0; i < 4; i++)
> -					multi_writer_done[i] = 0;
> 				write_type = WRITE_NO_KEY_SHIFT;
> 				if (write_keys(write_type) < 0)
> 					goto err;
> @@ -1133,15 +1129,15 @@ struct {
> 				}
> 
> 				/* Wait for writers to complete */
> -				for (i = 0; i < rwc_core_cnt[m]; i++)
> -					while
> -						(multi_writer_done[i] == 0);
> -				writer_done = 1;
> +				for (i = rwc_core_cnt[n] + 1;
> +				     i <= rwc_core_cnt[m] + rwc_core_cnt[n];
> +				     i++)
> +					rte_eal_wait_lcore(i);
rte_eal_wait_lcore(enabled_core_ids[i]);
> 
> -				rte_eal_mp_wait_lcore();
> +				writer_done = 1;
> 
> 				for (i = 1; i <= rwc_core_cnt[n]; i++)
> -					if (lcore_config[i].ret < 0)
> +					if (rte_eal_wait_lcore(i) < 0)
if (rte_eal_wait_lcore(enabled_core_ids[i]) < 0)
> 						goto err;
> 
> 				unsigned long long cycles_per_lookup =
> @@ -1160,6 +1156,7 @@ struct {
> 	return 0;
> 
> err:
> +	rte_eal_mp_wait_lcore();
> 	rte_hash_free(tbl_rwc_test_param.h);
> 	return -1;
> }
> @@ -1222,10 +1219,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)
if (rte_eal_wait_lcore(enabled_core_ids[i]) < 0)
> 					goto err;
> 
> 			unsigned long long cycles_per_lookup =
> @@ -1242,6 +1238,7 @@ struct {
> 	return 0;
> 
> err:
> +	rte_eal_mp_wait_lcore();
> 	rte_hash_free(tbl_rwc_test_param.h);
> 	return -1;
> }
> -- 
> 1.8.3.1
> 
Thank you,
Dharmik Thakkar


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/2] test/hash: use existing lcore API
  2019-05-22 16:26   ` [dpdk-dev] [PATCH v2 1/2] test/hash: " Dharmik Thakkar
@ 2019-05-22 17:17     ` David Marchand
  2019-05-22 19:37       ` Dharmik Thakkar
  0 siblings, 1 reply; 22+ messages in thread
From: David Marchand @ 2019-05-22 17:17 UTC (permalink / raw)
  To: Dharmik Thakkar
  Cc: dev, thomas, Stephen Hemminger, maxime.coquelin, stable,
	Yipeng Wang, Sameh Gobriel, Bruce Richardson, Pablo de Lara, nd

Hello Dharmik,

On Wed, May 22, 2019 at 6:27 PM Dharmik Thakkar <Dharmik.Thakkar@arm.com>
wrote:

> > On May 22, 2019, at 10:06 AM, David Marchand <david.marchand@redhat.com>
> wrote:
> >
> > 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")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: David Marchand <david.marchand@redhat.com>
> > ---
> > app/test/test_hash_readwrite_lf.c | 41
> ++++++++++++++++++---------------------
> > 1 file changed, 19 insertions(+), 22 deletions(-)
> >
> > ---
> > Changelog since v1:
> > - fixed test hang in test_hash_multi_add_lookup() reported by Wang,
> Yipeng
> >
> > diff --git a/app/test/test_hash_readwrite_lf.c
> b/app/test/test_hash_readwrite_lf.c
> > index 4ab4c8e..343a338 100644
> > --- a/app/test/test_hash_readwrite_lf.c
> > +++ b/app/test/test_hash_readwrite_lf.c
> > @@ -86,7 +86,6 @@ struct {
> > 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];
> >
> > @@ -690,7 +689,6 @@ struct {
> >       for (i = offset; i < offset + tbl_rwc_test_param.single_insert;
> i++)
> >               rte_hash_add_key(tbl_rwc_test_param.h,
> >                                tbl_rwc_test_param.keys_ks + i);
> > -     multi_writer_done[pos_core] = 1;
> >       return 0;
> > }
> >
> > @@ -738,10 +736,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)
> if (rte_eal_wait_lcore(enabled_core_ids[i]) < 0)
>
> (There are similar changes in other functions too.
> I realize that this is a separate issue than what the patch is aimed for.
> If you see fit, please integrate it, else I will put out a patch once your
> patch has been merged.)
>

Indeed, reproduced.

# echo hash_readwrite_lf_autotest |./master/app/test -c 0x2e
EAL: Detected 8 lcore(s)
EAL: Detected 1 NUMA nodes
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: No available hugepages reported in hugepages-1048576kB
EAL: Probing VFIO support...
EAL: PCI device 0000:00:1f.6 on NUMA socket -1
EAL:   Invalid NUMA socket, default to 0
EAL:   probe driver: 8086:15d7 net_e1000_em
APP: HPET is not enabled, using TSC as default timer
RTE>>hash_readwrite_lf_autotest
...

Number of readers: 1
Floating point exception (core dumped)


I'd prefer a separate patch, please.

-- 
David Marchand

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/2] test/hash: use existing lcore API
  2019-05-22 17:17     ` David Marchand
@ 2019-05-22 19:37       ` Dharmik Thakkar
  2019-05-27 10:15         ` David Marchand
  0 siblings, 1 reply; 22+ messages in thread
From: Dharmik Thakkar @ 2019-05-22 19:37 UTC (permalink / raw)
  To: David Marchand
  Cc: dev, thomas, Stephen Hemminger, maxime.coquelin, stable,
	Yipeng Wang, Sameh Gobriel, Bruce Richardson, Pablo de Lara, nd



> On May 22, 2019, at 12:17 PM, David Marchand <david.marchand@redhat.com> wrote:
> 
> Hello Dharmik,
> 
> On Wed, May 22, 2019 at 6:27 PM Dharmik Thakkar <Dharmik.Thakkar@arm.com> wrote:
> > On May 22, 2019, at 10:06 AM, David Marchand <david.marchand@redhat.com> wrote:
> > 
> > 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")
> > Cc: stable@dpdk.org
> > 
> > Signed-off-by: David Marchand <david.marchand@redhat.com>
> > ---
> > app/test/test_hash_readwrite_lf.c | 41 ++++++++++++++++++---------------------
> > 1 file changed, 19 insertions(+), 22 deletions(-)
> > 
> > ---
> > Changelog since v1:
> > - fixed test hang in test_hash_multi_add_lookup() reported by Wang, Yipeng
> > 
> > diff --git a/app/test/test_hash_readwrite_lf.c b/app/test/test_hash_readwrite_lf.c
> > index 4ab4c8e..343a338 100644
> > --- a/app/test/test_hash_readwrite_lf.c
> > +++ b/app/test/test_hash_readwrite_lf.c
> > @@ -86,7 +86,6 @@ struct {
> > 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];
> > 
> > @@ -690,7 +689,6 @@ struct {
> >       for (i = offset; i < offset + tbl_rwc_test_param.single_insert; i++)
> >               rte_hash_add_key(tbl_rwc_test_param.h,
> >                                tbl_rwc_test_param.keys_ks + i);
> > -     multi_writer_done[pos_core] = 1;
> >       return 0;
> > }
> > 
> > @@ -738,10 +736,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)
> if (rte_eal_wait_lcore(enabled_core_ids[i]) < 0)
> 
> (There are similar changes in other functions too.
> I realize that this is a separate issue than what the patch is aimed for.
> If you see fit, please integrate it, else I will put out a patch once your patch has been merged.)
> 
> Indeed, reproduced.
> 
> # echo hash_readwrite_lf_autotest |./master/app/test -c 0x2e
> EAL: Detected 8 lcore(s)
> EAL: Detected 1 NUMA nodes
> EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
> EAL: No available hugepages reported in hugepages-1048576kB
> EAL: Probing VFIO support...
> EAL: PCI device 0000:00:1f.6 on NUMA socket -1
> EAL:   Invalid NUMA socket, default to 0
> EAL:   probe driver: 8086:15d7 net_e1000_em
> APP: HPET is not enabled, using TSC as default timer
> RTE>>hash_readwrite_lf_autotest
> ...
> 
> Number of readers: 1
> Floating point exception (core dumped)
> 
> 
> I'd prefer a separate patch, please.
Sounds good.
> 
> -- 
> David Marchand
Acked-by: Dharmik Thakkar <dharmik.thakkar@arm.com>


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/2] test/hash: use existing lcore API
  2019-05-22 15:06 ` [dpdk-dev] [PATCH v2 " David Marchand
  2019-05-22 15:06   ` [dpdk-dev] [PATCH v2 2/2] test/rcu: " David Marchand
  2019-05-22 16:26   ` [dpdk-dev] [PATCH v2 1/2] test/hash: " Dharmik Thakkar
@ 2019-05-23 12:48   ` Maxime Coquelin
  2 siblings, 0 replies; 22+ messages in thread
From: Maxime Coquelin @ 2019-05-23 12:48 UTC (permalink / raw)
  To: David Marchand, dev
  Cc: thomas, stephen, Dharmik.Thakkar, stable, Yipeng Wang,
	Sameh Gobriel, Bruce Richardson, Pablo de Lara



On 5/22/19 5:06 PM, David Marchand wrote:
> 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")
> Cc: stable@dpdk.org
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
>   app/test/test_hash_readwrite_lf.c | 41 ++++++++++++++++++---------------------
>   1 file changed, 19 insertions(+), 22 deletions(-)
> 


Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [dpdk-dev] [PATCH v2 2/2] test/rcu: use existing lcore API
  2019-05-22 15:06   ` [dpdk-dev] [PATCH v2 2/2] test/rcu: " David Marchand
@ 2019-05-23 14:20     ` Maxime Coquelin
  2019-05-29 22:41       ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon
  0 siblings, 1 reply; 22+ messages in thread
From: Maxime Coquelin @ 2019-05-23 14:20 UTC (permalink / raw)
  To: David Marchand, dev
  Cc: thomas, stephen, Dharmik.Thakkar, stable, Honnappa Nagarahalli



On 5/22/19 5:06 PM, David Marchand wrote:
> Prefer the existing apis rather than direct access lcore_config that is
> going to disappear.
> 
> Fixes: b87089b0bb19 ("test/rcu: add API and functional tests")
> Cc: stable@dpdk.org
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> Acked-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> ---
>   app/test/test_rcu_qsbr.c      | 22 ++++++++++------------
>   app/test/test_rcu_qsbr_perf.c | 12 ++++--------
>   2 files changed, 14 insertions(+), 20 deletions(-)

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/2] test/hash: use existing lcore API
  2019-05-22 19:37       ` Dharmik Thakkar
@ 2019-05-27 10:15         ` David Marchand
  2019-05-28 14:15           ` Dharmik Thakkar
  0 siblings, 1 reply; 22+ messages in thread
From: David Marchand @ 2019-05-27 10:15 UTC (permalink / raw)
  To: Dharmik Thakkar
  Cc: dev, thomas, Stephen Hemminger, maxime.coquelin, stable,
	Yipeng Wang, Sameh Gobriel, Bruce Richardson, Pablo de Lara, nd

Hello Dharmik,

On Wed, May 22, 2019 at 9:38 PM Dharmik Thakkar <Dharmik.Thakkar@arm.com>
wrote:

> > On May 22, 2019, at 12:17 PM, David Marchand <david.marchand@redhat.com>
> wrote:
> > On Wed, May 22, 2019 at 6:27 PM Dharmik Thakkar <Dharmik.Thakkar@arm.com>
> wrote:
> > > @@ -738,10 +736,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)
> > if (rte_eal_wait_lcore(enabled_core_ids[i]) < 0)
> >
> > (There are similar changes in other functions too.
> > I realize that this is a separate issue than what the patch is aimed for.
> > If you see fit, please integrate it, else I will put out a patch once
> your patch has been merged.)
> >
> > Indeed, reproduced.
> >
>

Did you have a chance to look at this ?
These loops could be reworked by using RTE_LCORE_FOREACH_SLAVE() (so that
it automatically skips the master lcore) removing the need for
enabled_core_ids[].


-- 
David Marchand

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/2] test/hash: use existing lcore API
  2019-05-27 10:15         ` David Marchand
@ 2019-05-28 14:15           ` Dharmik Thakkar
  0 siblings, 0 replies; 22+ messages in thread
From: Dharmik Thakkar @ 2019-05-28 14:15 UTC (permalink / raw)
  To: David Marchand
  Cc: dev, thomas, Stephen Hemminger, maxime.coquelin, stable,
	Yipeng Wang, Sameh Gobriel, Bruce Richardson, Pablo de Lara, nd



> On May 27, 2019, at 5:15 AM, David Marchand <david.marchand@redhat.com> wrote:
> 
> Hello Dharmik,
Hi David,
> 
> On Wed, May 22, 2019 at 9:38 PM Dharmik Thakkar <Dharmik.Thakkar@arm.com> wrote:
> > On May 22, 2019, at 12:17 PM, David Marchand <david.marchand@redhat.com> wrote:
> > On Wed, May 22, 2019 at 6:27 PM Dharmik Thakkar <Dharmik.Thakkar@arm.com> wrote:
> > > @@ -738,10 +736,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)
> > if (rte_eal_wait_lcore(enabled_core_ids[i]) < 0)
> > 
> > (There are similar changes in other functions too.
> > I realize that this is a separate issue than what the patch is aimed for.
> > If you see fit, please integrate it, else I will put out a patch once your patch has been merged.)
> > 
> > Indeed, reproduced.
> > 
> 
> Did you have a chance to look at this ?
> These loops could be reworked by using RTE_LCORE_FOREACH_SLAVE() (so that it automatically skips the master lcore) removing the need for enabled_core_ids[].
> 
Yes, I have tried to use RTE_LCORE_FOREACH_SLAVE() and eliminate enabled_core_ids[]. However, the code becomes quite complicated to read with if statements
within RTE_LCORE_FOREACH_SLAVE(), to break the loop (since not all slave cores are checked for). This is a snip from test_hash_multi_add_lookup():

					/* snip */
				RTE_LCORE_FOREACH_SLAVE(core_id) {
					if (i < rwc_core_cnt[n])
						rte_eal_remote_launch(test_rwc_reader,
								(void *)(uintptr_t)read_type,
								core_id);
					else if (i >= rwc_core_cnt[n] &&
						 i < (rwc_core_cnt[n] +
						 rwc_core_cnt[m])) {
						rte_eal_remote_launch(test_rwc_multi_writer,
							(void *)(uintptr_t)pos_core,
							core_id);
						pos_core++;
					} else
						break;
					i++;
				}
> 
> -- 
> David Marchand


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [dpdk-dev] [dpdk-stable] [PATCH v2 2/2] test/rcu: use existing lcore API
  2019-05-23 14:20     ` Maxime Coquelin
@ 2019-05-29 22:41       ` Thomas Monjalon
  0 siblings, 0 replies; 22+ messages in thread
From: Thomas Monjalon @ 2019-05-29 22:41 UTC (permalink / raw)
  To: David Marchand
  Cc: stable, Maxime Coquelin, dev, stephen, Dharmik.Thakkar,
	Honnappa Nagarahalli

23/05/2019 16:20, Maxime Coquelin:
> On 5/22/19 5:06 PM, David Marchand wrote:
> > Prefer the existing apis rather than direct access lcore_config that is
> > going to disappear.
> > 
> > Fixes: b87089b0bb19 ("test/rcu: add API and functional tests")
> > Cc: stable@dpdk.org
> > 
> > Signed-off-by: David Marchand <david.marchand@redhat.com>
> > Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> > Acked-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> 
> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Series applied, thanks




^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2019-05-29 22:41 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-15  7:56 [dpdk-dev] [PATCH 1/2] test/hash: use existing lcore API David Marchand
2019-05-15  7:56 ` David Marchand
2019-05-15  7:57 ` [dpdk-dev] [PATCH 2/2] test/rcu: " David Marchand
2019-05-15  7:57   ` David Marchand
2019-05-15 12:19   ` Maxime Coquelin
2019-05-15 12:19     ` Maxime Coquelin
2019-05-15 20:04   ` Honnappa Nagarahalli
2019-05-15 20:04     ` Honnappa Nagarahalli
2019-05-15 12:14 ` [dpdk-dev] [PATCH 1/2] test/hash: " Maxime Coquelin
2019-05-15 12:14   ` Maxime Coquelin
2019-05-22  0:16 ` Wang, Yipeng1
2019-05-22 12:40   ` David Marchand
2019-05-22 15:06 ` [dpdk-dev] [PATCH v2 " David Marchand
2019-05-22 15:06   ` [dpdk-dev] [PATCH v2 2/2] test/rcu: " David Marchand
2019-05-23 14:20     ` Maxime Coquelin
2019-05-29 22:41       ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon
2019-05-22 16:26   ` [dpdk-dev] [PATCH v2 1/2] test/hash: " Dharmik Thakkar
2019-05-22 17:17     ` David Marchand
2019-05-22 19:37       ` Dharmik Thakkar
2019-05-27 10:15         ` David Marchand
2019-05-28 14:15           ` Dharmik Thakkar
2019-05-23 12:48   ` Maxime Coquelin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).