[dpdk-dev] [PATCH v9 2/5] pflock: use wait until scheme for read pflock
From: Feifei Wang <hidden>
Date: 2021-11-01 06:00:34
Subsystem:
library code, the rest · Maintainers:
Andrew Morton, Linus Torvalds
From: Feifei Wang <hidden>
Date: 2021-11-01 06:00:34
Subsystem:
library code, the rest · Maintainers:
Andrew Morton, Linus Torvalds
Instead of polling for read pflock update, use wait until scheme for this case. Jira: ENTNET-2903 Signed-off-by: Feifei Wang <redacted> Reviewed-by: Ruifeng Wang <redacted> Acked-by: Jerin Jacob <redacted> --- lib/eal/include/generic/rte_pflock.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/lib/eal/include/generic/rte_pflock.h b/lib/eal/include/generic/rte_pflock.h
index e57c179ef2..5d2864ee8e 100644
--- a/lib/eal/include/generic/rte_pflock.h
+++ b/lib/eal/include/generic/rte_pflock.h@@ -121,9 +121,7 @@ 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_MASKED(&pf->rd.in, RTE_PFLOCK_WBITS, !=, w, __ATOMIC_ACQUIRE); } /**
--
2.25.1