From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by dpdk.org (Postfix) with ESMTP id 7CA9F2C18; Thu, 29 Nov 2018 19:39:27 +0100 (CET) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7093480D; Thu, 29 Nov 2018 10:39:26 -0800 (PST) Received: from 2p2660v4-1.austin.arm.com (2p2660v4-1.austin.arm.com [10.118.12.72]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 24B273F575; Thu, 29 Nov 2018 10:39:26 -0800 (PST) From: Dharmik Thakkar To: Bruce Richardson , Pablo de Lara Cc: dev@dpdk.org, Dharmik Thakkar , stable@dpdk.org Date: Thu, 29 Nov 2018 12:38:55 -0600 Message-Id: <20181129183855.9361-1-dharmik.thakkar@arm.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH] test/hash: reset iter and found in perf test X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 18:39:28 -0000 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 --- 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