[dpdk-dev] [PATCH] test/mcslock: wait for lcore completion

Phil Yang (Arm Technology China) Phil.Yang at arm.com
Thu Aug 8 05:44:41 CEST 2019


> -----Original Message-----
> From: Aaron Conole <aconole at redhat.com>
> Sent: Wednesday, August 7, 2019 10:59 PM
> To: dev at dpdk.org
> Cc: Phil Yang (Arm Technology China) <Phil.Yang at arm.com>; Gavin Hu (Arm
> Technology China) <Gavin.Hu at arm.com>; Honnappa Nagarahalli
> <Honnappa.Nagarahalli at 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 at arm.com>
> Cc: Gavin Hu <gavin.hu at arm.com>
> Cc: Honnappa Nagarahalli <honnappa.nagarahalli at arm.com>
> Signed-off-by: Aaron Conole <aconole at 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 at arm.com>



More information about the dev mailing list