test/mcslock: wait for lcore completion
PATCH 1/1 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.
--- app/test/test_mcslock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
app/test/test_mcslock.c +1 -1
@@ -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)) {
Signature · 1 line
2.21.0
Quoted 38 lines
-----Original Message-----
From: Aaron Conole <[email protected]>
Sent: Wednesday, August 7, 2019 10:59 PM
To: [email protected]
Cc: Phil Yang (Arm Technology China) <[email protected]>; Gavin Hu (Arm Technology China) <[email protected]>; Honnappa Nagarahalli <[email protected]>
Subject: [PATCH] test/mcslock: wait for lcore completionIt's possible that the mcsunlock occurs before the
test_mcslock_tryhas 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 <[email protected]>Cc Gavin Hu <[email protected]>Cc Honnappa Nagarahalli <[email protected]>Signed-off-by Aaron Conole <[email protected]>--- app/test/test_mcslock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)app/test/test_mcslock.c +1
-2@@ -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)) { --
Quoted 1 line
2.21.0
Thanks for the patch.
Thomas Monjalon
Applied08/08/2019 05:44, Phil Yang (Arm Technology China):
Quoted 7 lines
From: Aaron Conole <[email protected]>
Quoted 6 lines
It's possible that the mcsunlock occurs before the
test_mcslock_tryhas 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.
Quoted 8 lines
Quoted 5 lines
Fixes 32dcb9fd2a22 ("test/mcslock: add MCS queued lock unit test")Cc Phil Yang <[email protected]>Cc Gavin Hu <[email protected]>Cc Honnappa Nagarahalli <[email protected]>Signed-off-by Aaron Conole <[email protected]>Thanks for the patch.
Acked-by Phil Yang <[email protected]>
Applied, thanks
Quoted 30 lines · Aaron Conole
It's possible that the mcsunlock occurs before the
test_mcslock_tryhas 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 <[email protected]>Cc Gavin Hu <[email protected]>Cc Honnappa Nagarahalli <[email protected]>Signed-off-by Aaron Conole <[email protected]>--- app/test/test_mcslock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)app/test/test_mcslock.c +1
-2@@ -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)) { --
Quoted 2 lines
2.21.0
Thanks.
Signature · 1 line
David Marchand