summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Conole <aconole@redhat.com>2019-08-07 10:58:44 -0400
committerThomas Monjalon <thomas@monjalon.net>2019-08-08 12:19:59 +0200
commit7fb1e84570eb61e508a097176a2f5b046d417311 (patch)
tree22f61300d281bfd3c2c417af5f3b3c136ab0c8fb
parent8b36297d15f90265b50fae211157dff573513359 (diff)
downloaddpdk-7fb1e84570eb61e508a097176a2f5b046d417311.zip
dpdk-7fb1e84570eb61e508a097176a2f5b046d417311.tar.gz
dpdk-7fb1e84570eb61e508a097176a2f5b046d417311.tar.xz
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") Signed-off-by: Aaron Conole <aconole@redhat.com> Acked-by: Phil Yang <phil.yang@arm.com> Reviewed-by: David Marchand <david.marchand@redhat.com>
-rw-r--r--app/test/test_mcslock.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/test/test_mcslock.c b/app/test/test_mcslock.c
index ed384b8..e9359df 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)) {