patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH] test/hash: reset iter and found in perf test
@ 2018-11-29 18:38 Dharmik Thakkar
  2019-01-11 17:10 ` Ferruh Yigit
  2019-01-14  9:23 ` [dpdk-stable] [PATCH v2] " Dharmik Thakkar
  0 siblings, 2 replies; 6+ messages in thread
From: Dharmik Thakkar @ 2018-11-29 18:38 UTC (permalink / raw)
  To: Bruce Richardson, Pablo de Lara; +Cc: dev, Dharmik Thakkar, stable

Reset 'iter' and 'tbl_rw_test_param.found' on each iteration
to give correct result for lost and duplicated keys.

Fixes: 0eb3726ebcf14 ("test/hash: add test for read/write concurrency")
Cc: stable@dpdk.org

Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
---
 test/test/test_hash_readwrite.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/test/test/test_hash_readwrite.c b/test/test/test_hash_readwrite.c
index 6b695ce6e444..be93a2ebd270 100644
--- a/test/test/test_hash_readwrite.c
+++ b/test/test/test_hash_readwrite.c
@@ -361,7 +361,6 @@ test_hash_readwrite_perf(struct perf *perf_results, int use_htm,
 
 	const void *next_key;
 	void *next_data;
-	uint32_t iter = 0;
 	int use_jhash = 0;
 
 	uint32_t duplicated_keys = 0;
@@ -536,6 +535,8 @@ test_hash_readwrite_perf(struct perf *perf_results, int use_htm,
 
 		rte_eal_mp_wait_lcore();
 
+		uint32_t iter = 0;
+		memset(tbl_rw_test_param.found, 0, TOTAL_ENTRY);
 		while (rte_hash_iterate(tbl_rw_test_param.h,
 				&next_key, &next_data, &iter) >= 0) {
 			/* Search for the key in the list of keys added .*/
@@ -619,7 +620,7 @@ test_hash_readwrite_main(void)
 	if (rte_lcore_count() <= 2) {
 		printf("More than two lcores are required "
 			"to do read write test\n");
-		return 0;
+		return -1;
 	}
 
 	RTE_LCORE_FOREACH_SLAVE(core_id) {
-- 
2.17.1

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

end of thread, other threads:[~2019-01-14 23:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-29 18:38 [dpdk-stable] [PATCH] test/hash: reset iter and found in perf test Dharmik Thakkar
2019-01-11 17:10 ` Ferruh Yigit
2019-01-11 18:37   ` Wang, Yipeng1
2019-01-14  7:12     ` Dharmik Thakkar
2019-01-14  9:23 ` [dpdk-stable] [PATCH v2] " Dharmik Thakkar
2019-01-14 23:19   ` [dpdk-stable] [dpdk-dev] " Thomas Monjalon

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).