10 #ifndef _RTE_RING_GENERIC_H_
11 #define _RTE_RING_GENERIC_H_
14 update_tail(
struct rte_ring_headtail *ht, uint32_t old_val, uint32_t new_val,
15 uint32_t single, uint32_t enqueue)
26 while (
unlikely(ht->tail != old_val))
56 __rte_ring_move_prod_head(
struct rte_ring *r,
unsigned int is_sp,
57 unsigned int n,
enum rte_ring_queue_behavior behavior,
58 uint32_t *old_head, uint32_t *new_head,
59 uint32_t *free_entries)
69 *old_head = r->prod.head;
82 *free_entries = (capacity + r->cons.tail - *old_head);
86 n = (behavior == RTE_RING_QUEUE_FIXED) ?
92 *new_head = *old_head + n;
94 r->prod.head = *new_head, success = 1;
97 *old_head, *new_head);
126 __rte_ring_move_cons_head(
struct rte_ring *r,
unsigned int is_sc,
127 unsigned int n,
enum rte_ring_queue_behavior behavior,
128 uint32_t *old_head, uint32_t *new_head,
131 unsigned int max = n;
139 *old_head = r->cons.head;
151 *entries = (r->prod.tail - *old_head);
155 n = (behavior == RTE_RING_QUEUE_FIXED) ? 0 : *entries;
160 *new_head = *old_head + n;
162 r->cons.head = *new_head, success = 1;