From: David Marchand Date: Sat, 15 Jun 2019 06:42:19 +0000 (+0200) Subject: test/hash: fix off-by-one check on core count X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=bf7a24b997dc1f7516f38a38a8ce3c364d64aff4;p=dpdk.git test/hash: fix off-by-one check on core count This subtest wants to start rwc_core_cnt[n] reader threads, while the master core is waiting for them to report. Fixes: c7eb0972e74b ("test/hash: add lock-free r/w concurrency") Cc: stable@dpdk.org Signed-off-by: David Marchand Acked-by: Aaron Conole Acked-by: Yipeng Wang --- diff --git a/app/test/test_hash_readwrite_lf.c b/app/test/test_hash_readwrite_lf.c index 343a338b4e..f9f233a730 100644 --- a/app/test/test_hash_readwrite_lf.c +++ b/app/test/test_hash_readwrite_lf.c @@ -939,7 +939,7 @@ test_hash_add_ks_lookup_hit_sp(struct rwc_perf *rwc_perf_results, int rwc_lf, } for (n = 0; n < NUM_TEST; n++) { unsigned int tot_lcore = rte_lcore_count(); - if (tot_lcore < rwc_core_cnt[n]) + if (tot_lcore < rwc_core_cnt[n] + 1) goto finish; printf("\nNumber of readers: %u\n", rwc_core_cnt[n]);