[v2,04/15] test/hash: fix off-by-one check on core count

Message ID 1560580950-16754-5-git-send-email-david.marchand@redhat.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series [v2,01/15] test/bonding: add missing sources for link bonding RSS |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

David Marchand June 15, 2019, 6:42 a.m. UTC
  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 <david.marchand@redhat.com>
Acked-by: Aaron Conole <aconole@redhat.com>
Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
---
 app/test/test_hash_readwrite_lf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/app/test/test_hash_readwrite_lf.c b/app/test/test_hash_readwrite_lf.c
index 343a338..f9f233a 100644
--- a/app/test/test_hash_readwrite_lf.c
+++ b/app/test/test_hash_readwrite_lf.c
@@ -939,7 +939,7 @@  struct {
 		}
 		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]);