patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Kevin Traynor <ktraynor@redhat.com>
To: David Marchand <david.marchand@redhat.com>
Cc: Dharmik Thakkar <dharmik.thakkar@arm.com>,
	Maxime Coquelin <maxime.coquelin@redhat.com>,
	dpdk stable <stable@dpdk.org>
Subject: [dpdk-stable] patch 'test/hash: use existing lcore API' has been queued to LTS release 18.11.3
Date: Fri, 21 Jun 2019 17:46:05 +0100	[thread overview]
Message-ID: <20190621164626.31219-21-ktraynor@redhat.com> (raw)
In-Reply-To: <20190621164626.31219-1-ktraynor@redhat.com>

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

  parent reply	other threads:[~2019-06-21 16:51 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-21 16:45 [dpdk-stable] patch 'kni: fix build on RHEL8' " Kevin Traynor
2019-06-21 16:45 ` [dpdk-stable] patch 'examples: fix make clean when using pkg-config' " Kevin Traynor
2019-06-21 16:45 ` [dpdk-stable] patch 'net/ixgbe: fix unexpected link handler' " Kevin Traynor
2019-06-21 16:45 ` [dpdk-stable] patch 'net/fm10k: advertise supported RSS hash function' " Kevin Traynor
2019-06-21 16:45 ` [dpdk-stable] patch 'net/i40e: fix Tx threshold setup' " Kevin Traynor
2019-06-21 16:45 ` [dpdk-stable] patch 'net/ixgbe: " Kevin Traynor
2019-06-21 16:45 ` [dpdk-stable] patch 'net/mlx5: fix missing validation of null pointer' " Kevin Traynor
2019-06-21 16:45 ` [dpdk-stable] patch 'net/mlx5: fix description of return value' " Kevin Traynor
2019-06-21 16:45 ` [dpdk-stable] patch 'net/mlx5: fix memory free on queue create error' " Kevin Traynor
2019-06-21 16:45 ` [dpdk-stable] patch 'net/bnxt: fix TSO' " Kevin Traynor
2019-06-21 16:45 ` [dpdk-stable] patch 'net/bnxt: check for error conditions in Tx path' " Kevin Traynor
2019-06-21 16:45 ` [dpdk-stable] patch 'net/bnxt: fix Tx batching' " Kevin Traynor
2019-06-21 16:45 ` [dpdk-stable] patch 'net/bnxt: optimize " Kevin Traynor
2019-06-21 16:45 ` [dpdk-stable] patch 'net/vmxnet3: fix uninitialized variable' " Kevin Traynor
2019-06-21 16:45 ` [dpdk-stable] patch 'fix off-by-one errors in snprintf' " Kevin Traynor
2019-06-21 16:46 ` [dpdk-stable] patch 'doc: robustify PDF build' " Kevin Traynor
2019-06-21 16:46 ` [dpdk-stable] patch 'doc: fix PDF with greek letter' " Kevin Traynor
2019-06-21 16:46 ` [dpdk-stable] patch 'net/cxgbe: do not dereference global config struct' " Kevin Traynor
2019-06-21 16:46 ` [dpdk-stable] patch 'examples/multi_process: do not dereference global config' " Kevin Traynor
2019-06-21 16:46 ` [dpdk-stable] patch 'examples/qos_sched: do not dereference global config struct' " Kevin Traynor
2019-06-21 16:46 ` Kevin Traynor [this message]
2019-06-21 16:46 ` [dpdk-stable] patch 'config: disable armv8 crypto extension' " Kevin Traynor
2019-06-21 16:46 ` [dpdk-stable] patch 'examples/ip_fragmentation: fix Tx queues init' " Kevin Traynor
2019-06-21 16:46 ` [dpdk-stable] patch 'mem: ease init in a docker container' " Kevin Traynor
2019-06-21 16:46 ` [dpdk-stable] patch 'doc: fix Linux guide for arm64 cross-compilation' " Kevin Traynor
2019-06-21 16:46 ` [dpdk-stable] patch 'examples/multi_process: fix FreeBSD build' " Kevin Traynor
2019-06-21 16:46 ` [dpdk-stable] patch 'bpf: fix pseudo calls for program loaded from ELF' " Kevin Traynor
2019-06-21 16:46 ` [dpdk-stable] patch 'acl: fix build with some arm64 compiler' " Kevin Traynor
2019-06-21 16:46 ` [dpdk-stable] patch 'net/af_packet: fix RxQ errors stat' " Kevin Traynor
2019-06-21 16:46 ` [dpdk-stable] patch 'net/avp: " Kevin Traynor
2019-06-21 16:46 ` [dpdk-stable] patch 'net/bnxt: " Kevin Traynor
2019-06-21 16:46 ` [dpdk-stable] patch 'net/cxgbe: " Kevin Traynor
2019-06-21 16:46 ` [dpdk-stable] patch 'net/kni: " Kevin Traynor
2019-06-21 16:46 ` [dpdk-stable] patch 'net/mlx4: " Kevin Traynor
2019-06-21 16:46 ` [dpdk-stable] patch 'net/mlx5: " Kevin Traynor
2019-06-21 16:46 ` [dpdk-stable] patch 'net/null: " Kevin Traynor
2019-06-21 16:46 ` [dpdk-stable] patch 'net/pcap: " Kevin Traynor
2019-06-21 16:46 ` [dpdk-stable] patch 'net/ring: " Kevin Traynor
2019-06-21 16:46 ` [dpdk-stable] patch 'net/szedata2: " Kevin Traynor
2019-06-21 16:46 ` [dpdk-stable] patch 'net/tap: " Kevin Traynor
2019-06-27 16:48   ` Kevin Traynor
2019-06-28 10:00     ` David Marchand
2019-06-28 12:11       ` Thomas Monjalon
2019-06-21 16:46 ` [dpdk-stable] patch 'net/mlx5: fix order of items in NEON scatter' " Kevin Traynor
2019-06-21 16:46 ` [dpdk-stable] patch 'net/bnxt: fix RSS RETA indirection table ops' " Kevin Traynor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190621164626.31219-21-ktraynor@redhat.com \
    --to=ktraynor@redhat.com \
    --cc=david.marchand@redhat.com \
    --cc=dharmik.thakkar@arm.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).