Thread (113 messages) 113 messages, 8 authors, 2021-11-04

[dpdk-dev] [RFC PATCH v1 2/5] eal: use wait until scheme for read pflock

From: Feifei Wang <hidden>
Date: 2021-09-02 05:33:22
Subsystem: library code, the rest · Maintainers: Andrew Morton, Linus Torvalds

Instead of polling for read pflock update, use wait_until_part_equal
for this case.

Signed-off-by: Feifei Wang <redacted>
Reviewed-by: Ruifeng Wang <redacted>
---
 lib/eal/include/generic/rte_pflock.h | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/lib/eal/include/generic/rte_pflock.h b/lib/eal/include/generic/rte_pflock.h
index e57c179ef2..5298dec7b8 100644
--- a/lib/eal/include/generic/rte_pflock.h
+++ b/lib/eal/include/generic/rte_pflock.h
@@ -121,9 +121,8 @@ rte_pflock_read_lock(rte_pflock_t *pf)
 		return;
 
 	/* Wait for current write phase to complete. */
-	while ((__atomic_load_n(&pf->rd.in, __ATOMIC_ACQUIRE)
-		& RTE_PFLOCK_WBITS) == w)
-		rte_pause();
+	rte_wait_until_part_unequal_16(&pf->rd.in,
+			RTE_PFLOCK_WBITS, w, __ATOMIC_ACQUIRE);
 }
 
 /**
-- 
2.25.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help