From 8d53e9f3c6001dcb2865f6e894da5b54e1418f88 Mon Sep 17 00:00:00 2001 From: Christian Ehrhardt Date: Thu, 4 Jul 2019 10:40:06 +0200 Subject: New upstream version 18.11.2 Change-Id: I23eb4f9179abf1f9c659891f8fddb27ee68ad26b Signed-off-by: Christian Ehrhardt --- test/test/test_barrier.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'test/test/test_barrier.c') diff --git a/test/test/test_barrier.c b/test/test/test_barrier.c index 82b572c3..92f3d325 100644 --- a/test/test/test_barrier.c +++ b/test/test/test_barrier.c @@ -92,12 +92,14 @@ plock_lock(struct plock *l, uint32_t self) other = self ^ 1; l->flag[self] = 1; + rte_smp_wmb(); l->victim = self; store_load_barrier(l->utype); while (l->flag[other] == 1 && l->victim == self) rte_pause(); + rte_smp_rmb(); } static void @@ -202,7 +204,7 @@ plock_test(uint32_t iter, enum plock_use_type utype) printf("%s(iter=%u, utype=%u) started on %u lcores\n", __func__, iter, utype, n); - if (pt == NULL || lpt == NULL) { + if (pt == NULL || lpt == NULL || sum == NULL) { printf("%s: failed to allocate memory for %u lcores\n", __func__, n); free(pt); @@ -252,7 +254,7 @@ plock_test(uint32_t iter, enum plock_use_type utype) /* race condition occurred, lock doesn't work properly */ if (sum[i] != pt[i].val || 2 * iter != pt[i].iter) { - printf("error: local and shared sums don't much\n"); + printf("error: local and shared sums don't match\n"); rc = -1; } } -- cgit 1.2.3-korg