* [dpdk-dev] [PATCH] test/mcslock: wait for lcore completion
@ 2019-08-07 14:58 Aaron Conole
2019-08-08 3:44 ` Phil Yang (Arm Technology China)
2019-08-08 6:58 ` David Marchand
0 siblings, 2 replies; 4+ messages in thread
From: Aaron Conole @ 2019-08-07 14:58 UTC (permalink / raw)
To: dev; +Cc: Phil Yang, Gavin Hu, Honnappa Nagarahalli
It's possible that the mcsunlock occurs before the test_mcslock_try has
a chance to execute, which will result in the trylock being successful,
making the test case fail. Fix this by waiting until all lcores have
completed their test before unlocking the master lock.
Fixes: 32dcb9fd2a22 ("test/mcslock: add MCS queued lock unit test")
Cc: Phil Yang <phil.yang@arm.com>
Cc: Gavin Hu <gavin.hu@arm.com>
Cc: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Signed-off-by: Aaron Conole <aconole@redhat.com>
---
app/test/test_mcslock.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/test/test_mcslock.c b/app/test/test_mcslock.c
index ed384b81d..e9359df2e 100644
--- a/app/test/test_mcslock.c
+++ b/app/test/test_mcslock.c
@@ -225,8 +225,8 @@ test_mcslock(void)
RTE_LCORE_FOREACH_SLAVE(i) {
rte_eal_remote_launch(test_mcslock_try, NULL, i);
}
- rte_mcslock_unlock(&p_ml_try, &ml_try_me);
rte_eal_mp_wait_lcore();
+ rte_mcslock_unlock(&p_ml_try, &ml_try_me);
/* Test is_locked API */
if (rte_mcslock_is_locked(p_ml)) {
--
2.21.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH] test/mcslock: wait for lcore completion
2019-08-07 14:58 [dpdk-dev] [PATCH] test/mcslock: wait for lcore completion Aaron Conole
@ 2019-08-08 3:44 ` Phil Yang (Arm Technology China)
2019-08-08 10:22 ` Thomas Monjalon
2019-08-08 6:58 ` David Marchand
1 sibling, 1 reply; 4+ messages in thread
From: Phil Yang (Arm Technology China) @ 2019-08-08 3:44 UTC (permalink / raw)
To: Aaron Conole, dev
Cc: Gavin Hu (Arm Technology China), Honnappa Nagarahalli, nd, nd
> -----Original Message-----
> From: Aaron Conole <aconole@redhat.com>
> Sent: Wednesday, August 7, 2019 10:59 PM
> To: dev@dpdk.org
> Cc: Phil Yang (Arm Technology China) <Phil.Yang@arm.com>; Gavin Hu (Arm
> Technology China) <Gavin.Hu@arm.com>; Honnappa Nagarahalli
> <Honnappa.Nagarahalli@arm.com>
> Subject: [PATCH] test/mcslock: wait for lcore completion
>
> It's possible that the mcsunlock occurs before the test_mcslock_try has
> a chance to execute, which will result in the trylock being successful,
> making the test case fail. Fix this by waiting until all lcores have
> completed their test before unlocking the master lock.
>
> Fixes: 32dcb9fd2a22 ("test/mcslock: add MCS queued lock unit test")
> Cc: Phil Yang <phil.yang@arm.com>
> Cc: Gavin Hu <gavin.hu@arm.com>
> Cc: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> Signed-off-by: Aaron Conole <aconole@redhat.com>
> ---
> app/test/test_mcslock.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/app/test/test_mcslock.c b/app/test/test_mcslock.c
> index ed384b81d..e9359df2e 100644
> --- a/app/test/test_mcslock.c
> +++ b/app/test/test_mcslock.c
> @@ -225,8 +225,8 @@ test_mcslock(void)
> RTE_LCORE_FOREACH_SLAVE(i) {
> rte_eal_remote_launch(test_mcslock_try, NULL, i);
> }
> - rte_mcslock_unlock(&p_ml_try, &ml_try_me);
> rte_eal_mp_wait_lcore();
> + rte_mcslock_unlock(&p_ml_try, &ml_try_me);
>
> /* Test is_locked API */
> if (rte_mcslock_is_locked(p_ml)) {
> --
> 2.21.0
Thanks for the patch.
Acked-by: Phil Yang <phil.yang@arm.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH] test/mcslock: wait for lcore completion
2019-08-08 3:44 ` Phil Yang (Arm Technology China)
@ 2019-08-08 10:22 ` Thomas Monjalon
0 siblings, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2019-08-08 10:22 UTC (permalink / raw)
To: Aaron Conole
Cc: dev, Phil Yang (Arm Technology China),
Gavin Hu (Arm Technology China),
Honnappa Nagarahalli, nd
08/08/2019 05:44, Phil Yang (Arm Technology China):
> From: Aaron Conole <aconole@redhat.com>
> >
> > It's possible that the mcsunlock occurs before the test_mcslock_try has
> > a chance to execute, which will result in the trylock being successful,
> > making the test case fail. Fix this by waiting until all lcores have
> > completed their test before unlocking the master lock.
> >
> > Fixes: 32dcb9fd2a22 ("test/mcslock: add MCS queued lock unit test")
> > Cc: Phil Yang <phil.yang@arm.com>
> > Cc: Gavin Hu <gavin.hu@arm.com>
> > Cc: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> > Signed-off-by: Aaron Conole <aconole@redhat.com>
>
> Thanks for the patch.
> Acked-by: Phil Yang <phil.yang@arm.com>
Applied, thanks
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH] test/mcslock: wait for lcore completion
2019-08-07 14:58 [dpdk-dev] [PATCH] test/mcslock: wait for lcore completion Aaron Conole
2019-08-08 3:44 ` Phil Yang (Arm Technology China)
@ 2019-08-08 6:58 ` David Marchand
1 sibling, 0 replies; 4+ messages in thread
From: David Marchand @ 2019-08-08 6:58 UTC (permalink / raw)
To: Aaron Conole; +Cc: dev, Phil Yang, Gavin Hu, Honnappa Nagarahalli
On Wed, Aug 7, 2019 at 4:58 PM Aaron Conole <aconole@redhat.com> wrote:
>
> It's possible that the mcsunlock occurs before the test_mcslock_try has
> a chance to execute, which will result in the trylock being successful,
> making the test case fail. Fix this by waiting until all lcores have
> completed their test before unlocking the master lock.
>
> Fixes: 32dcb9fd2a22 ("test/mcslock: add MCS queued lock unit test")
> Cc: Phil Yang <phil.yang@arm.com>
> Cc: Gavin Hu <gavin.hu@arm.com>
> Cc: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> Signed-off-by: Aaron Conole <aconole@redhat.com>
> ---
> app/test/test_mcslock.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/app/test/test_mcslock.c b/app/test/test_mcslock.c
> index ed384b81d..e9359df2e 100644
> --- a/app/test/test_mcslock.c
> +++ b/app/test/test_mcslock.c
> @@ -225,8 +225,8 @@ test_mcslock(void)
> RTE_LCORE_FOREACH_SLAVE(i) {
> rte_eal_remote_launch(test_mcslock_try, NULL, i);
> }
> - rte_mcslock_unlock(&p_ml_try, &ml_try_me);
> rte_eal_mp_wait_lcore();
> + rte_mcslock_unlock(&p_ml_try, &ml_try_me);
>
> /* Test is_locked API */
> if (rte_mcslock_is_locked(p_ml)) {
> --
> 2.21.0
>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Thanks.
--
David Marchand
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-08-08 10:22 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-07 14:58 [dpdk-dev] [PATCH] test/mcslock: wait for lcore completion Aaron Conole
2019-08-08 3:44 ` Phil Yang (Arm Technology China)
2019-08-08 10:22 ` Thomas Monjalon
2019-08-08 6:58 ` David Marchand
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).