11#ifndef _RTE_RING_C11_PVT_H_
12#define _RTE_RING_C11_PVT_H_
16 uint32_t new_val, uint32_t single, uint32_t enqueue)
26 rte_memory_order_relaxed);
33 rte_atomic_store_explicit(&ht->tail, new_val, rte_memory_order_release);
60__rte_ring_move_prod_head(
struct rte_ring *r,
unsigned int is_sp,
62 uint32_t *old_head, uint32_t *new_head,
63 uint32_t *free_entries)
65 const uint32_t capacity = r->
capacity;
77 *old_head = rte_atomic_load_explicit(&r->prod.head, rte_memory_order_acquire);
89 cons_tail = rte_atomic_load_explicit(&r->cons.tail,
90 rte_memory_order_acquire);
97 *free_entries = (capacity + cons_tail - *old_head);
107 *new_head = *old_head + n;
109 r->prod.head = *new_head;
122 success = rte_atomic_compare_exchange_strong_explicit(&r->prod.head,
124 rte_memory_order_release,
125 rte_memory_order_acquire);
154__rte_ring_move_cons_head(
struct rte_ring *r,
int is_sc,
156 uint32_t *old_head, uint32_t *new_head,
159 unsigned int max = n;
170 *old_head = rte_atomic_load_explicit(&r->cons.head, rte_memory_order_acquire);
181 prod_tail = rte_atomic_load_explicit(&r->prod.tail,
182 rte_memory_order_acquire);
189 *entries = (prod_tail - *old_head);
198 *new_head = *old_head + n;
200 r->cons.head = *new_head;
213 success = rte_atomic_compare_exchange_strong_explicit(&r->cons.head,
215 rte_memory_order_release,
216 rte_memory_order_acquire);
#define __rte_always_inline
static __rte_always_inline void rte_wait_until_equal_32(volatile uint32_t *addr, uint32_t expected, rte_memory_order memorder)