10 #define _RTE_PFLOCK_H_ 32 #include <rte_stdatomic.h> 43 RTE_ATOMIC(uint16_t) in;
44 RTE_ATOMIC(uint16_t) out;
70 #define RTE_PFLOCK_WBITS 0x3 71 #define RTE_PFLOCK_PRES 0x2 72 #define RTE_PFLOCK_PHID 0x1 73 #define RTE_PFLOCK_LSB 0xFFF0 74 #define RTE_PFLOCK_RINC 0x10 79 #define RTE_PFLOCK_INITIALIZER { } 111 w = rte_atomic_fetch_add_explicit(&pf->rd.in, RTE_PFLOCK_RINC, rte_memory_order_acquire)
117 RTE_WAIT_UNTIL_MASKED(&pf->rd.in, RTE_PFLOCK_WBITS, !=, w, rte_memory_order_acquire);
129 rte_atomic_fetch_add_explicit(&pf->rd.out, RTE_PFLOCK_RINC, rte_memory_order_release);
146 ticket = rte_atomic_fetch_add_explicit(&pf->wr.in, 1, rte_memory_order_relaxed);
148 rte_memory_order_acquire);
158 w = RTE_PFLOCK_PRES | (ticket & RTE_PFLOCK_PHID);
159 ticket = rte_atomic_fetch_add_explicit(&pf->rd.in, w, rte_memory_order_relaxed);
163 rte_memory_order_acquire);
176 rte_atomic_fetch_and_explicit(&pf->rd.in, RTE_PFLOCK_LSB, rte_memory_order_release);
179 rte_atomic_fetch_add_explicit(&pf->wr.out, 1, rte_memory_order_release);
static __rte_always_inline void rte_wait_until_equal_16(volatile uint16_t *addr, uint16_t expected, rte_memory_order memorder)
static void rte_pflock_read_unlock(rte_pflock_t *pf)
static void rte_pflock_write_lock(rte_pflock_t *pf)
static void rte_pflock_init(struct rte_pflock *pf)
static void rte_pflock_write_unlock(rte_pflock_t *pf)
static void rte_pflock_read_lock(rte_pflock_t *pf)