[04/14] test/hash: fix off-by-one check on core count
Checks
Commit Message
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>
---
app/test/test_hash_readwrite_lf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
David Marchand <david.marchand@redhat.com> writes:
> 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>
>-----Original Message-----
>From: David Marchand [mailto:david.marchand@redhat.com]
>Sent: Tuesday, June 4, 2019 2:00 AM
>To: dev@dpdk.org
>Cc: thomas@monjalon.net; aconole@redhat.com; msantana@redhat.com; stable@dpdk.org; Wang, Yipeng1
><yipeng1.wang@intel.com>; Gobriel, Sameh <sameh.gobriel@intel.com>; Richardson, Bruce <bruce.richardson@intel.com>; De Lara
>Guarch, Pablo <pablo.de.lara.guarch@intel.com>
>Subject: [PATCH 04/14] 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.
>
[Wang, Yipeng] May add a sentence to make the commit message more explicit:
The code does not consider the master core in the core
count calculation. This commit fixes this issue.
>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: Yipeng Wang <yipeng1.wang@intel.com>
@@ -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]);