From: Feifei Wang Date: Mon, 1 Nov 2021 06:00:04 +0000 (+0800) Subject: pflock: use wait until scheme for read lock X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=41902d2468968a8c6acb96b48e84d726bb797c8a;p=dpdk.git pflock: use wait until scheme for read lock Instead of polling for read pflock update, use wait until scheme for this case. Signed-off-by: Feifei Wang Reviewed-by: Ruifeng Wang Acked-by: Jerin Jacob --- diff --git a/lib/eal/include/generic/rte_pflock.h b/lib/eal/include/generic/rte_pflock.h index e57c179ef2..b9de063c89 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_MASKED(&pf->rd.in, RTE_PFLOCK_WBITS, !=, w, + __ATOMIC_ACQUIRE); } /**