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: c7eb0972e7 ("test/hash: add lock-free r/w concurrency")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Aaron Conole <aconole@redhat.com>
Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
This commit is contained in:
David Marchand 2019-06-15 08:42:19 +02:00 committed by Thomas Monjalon
parent c57c8cb42e
commit bf7a24b997

View File

@ -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]);