Skip to contentSkip to conversation

test: fix memory barrier test failure on power CPUs

PATCH In review David Christensen 1 participant 1 message May 8, 2019

lore
Share & tools
lore
#0 lore raw

PATCH v3 4/4 test: fix memory barrier test failure on power CPUs

The memory barrier test fails on IBM Power 9 systems. Add additional barriers to accommodate the weakly ordered model used on Power CPUs.

---
v2:
* Removed ifdef's for PPC since the rte_smp_*mb() macros are already customized for each CPU architecture
v3:
* None

---
 app/test/test_barrier.c | 2 ++
 1 file changed, 2 insertions(+)
app/test/test_barrier.c +2 -0
index a0b4704..43b5f62 100644
@@ -92,12 +92,14 @@ struct lcore_plock_test {
 	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
Signature · 1 line
1.8.3.1