10 #ifndef _RTE_RING_PEEK_ZC_H_
11 #define _RTE_RING_PEEK_ZC_H_
99 __rte_ring_get_elem_addr(
struct rte_ring *r, uint32_t head,
100 uint32_t esize, uint32_t num,
void **dst1, uint32_t *n1,
void **dst2)
102 uint32_t idx, scale, nr_idx;
103 uint32_t *ring = (uint32_t *)&r[1];
106 scale = esize /
sizeof(uint32_t);
107 idx = head & r->
mask;
108 nr_idx = idx * scale;
110 *dst1 = ring + nr_idx;
113 if (idx + num > r->
size) {
125 __rte_ring_do_enqueue_zc_elem_start(
struct rte_ring *r,
unsigned int esize,
129 uint32_t free, head, next;
134 behavior, &head, &next, &free);
136 case RTE_RING_SYNC_MT_HTS:
137 n = __rte_ring_hts_move_prod_head(r, n, behavior, &head, &free);
140 case RTE_RING_SYNC_MT_RTS:
149 __rte_ring_get_elem_addr(r, head, esize, n, &zcd->ptr1,
150 &zcd->n1, &zcd->ptr2);
152 if (free_space != NULL)
153 *free_space = free - n;
185 return __rte_ring_do_enqueue_zc_elem_start(r, esize, n,
248 return __rte_ring_do_enqueue_zc_elem_start(r, esize, n,
301 n = __rte_ring_st_get_tail(&r->prod, &tail, n);
302 __rte_ring_st_set_head_tail(&r->prod, tail, n, 1);
304 case RTE_RING_SYNC_MT_HTS:
305 n = __rte_ring_hts_get_tail(&r->hts_prod, &tail, n);
306 __rte_ring_hts_set_head_tail(&r->hts_prod, tail, n, 1);
309 case RTE_RING_SYNC_MT_RTS:
338 __rte_ring_do_dequeue_zc_elem_start(
struct rte_ring *r,
342 uint32_t avail, head, next;
347 behavior, &head, &next, &avail);
349 case RTE_RING_SYNC_MT_HTS:
350 n = __rte_ring_hts_move_cons_head(r, n, behavior,
354 case RTE_RING_SYNC_MT_RTS:
363 __rte_ring_get_elem_addr(r, head, esize, n, &zcd->ptr1,
364 &zcd->n1, &zcd->ptr2);
366 if (available != NULL)
367 *available = avail - n;
398 return __rte_ring_do_dequeue_zc_elem_start(r, esize, n,
461 return __rte_ring_do_dequeue_zc_elem_start(r, esize, n,
513 n = __rte_ring_st_get_tail(&r->cons, &tail, n);
514 __rte_ring_st_set_head_tail(&r->cons, tail, n, 0);
516 case RTE_RING_SYNC_MT_HTS:
517 n = __rte_ring_hts_get_tail(&r->hts_cons, &tail, n);
518 __rte_ring_hts_set_head_tail(&r->hts_cons, tail, n, 0);
521 case RTE_RING_SYNC_MT_RTS:
#define __rte_always_inline
static __rte_experimental __rte_always_inline unsigned int rte_ring_dequeue_zc_bulk_elem_start(struct rte_ring *r, unsigned int esize, unsigned int n, struct rte_ring_zc_data *zcd, unsigned int *available)
static __rte_experimental __rte_always_inline void rte_ring_dequeue_zc_elem_finish(struct rte_ring *r, unsigned int n)
static __rte_experimental __rte_always_inline void rte_ring_dequeue_elem_finish(struct rte_ring *r, unsigned int n)
static __rte_experimental __rte_always_inline void rte_ring_enqueue_zc_finish(struct rte_ring *r, unsigned int n)
static __rte_experimental __rte_always_inline unsigned int rte_ring_enqueue_zc_bulk_elem_start(struct rte_ring *r, unsigned int esize, unsigned int n, struct rte_ring_zc_data *zcd, unsigned int *free_space)
static __rte_experimental __rte_always_inline unsigned int rte_ring_dequeue_zc_burst_start(struct rte_ring *r, unsigned int n, struct rte_ring_zc_data *zcd, unsigned int *available)
static __rte_experimental __rte_always_inline unsigned int rte_ring_dequeue_zc_burst_elem_start(struct rte_ring *r, unsigned int esize, unsigned int n, struct rte_ring_zc_data *zcd, unsigned int *available)
static __rte_experimental __rte_always_inline unsigned int rte_ring_enqueue_zc_bulk_start(struct rte_ring *r, unsigned int n, struct rte_ring_zc_data *zcd, unsigned int *free_space)
#define __rte_cache_aligned
static __rte_experimental __rte_always_inline unsigned int rte_ring_dequeue_zc_bulk_start(struct rte_ring *r, unsigned int n, struct rte_ring_zc_data *zcd, unsigned int *available)
enum rte_ring_sync_type sync_type
static __rte_experimental __rte_always_inline unsigned int rte_ring_enqueue_zc_burst_elem_start(struct rte_ring *r, unsigned int esize, unsigned int n, struct rte_ring_zc_data *zcd, unsigned int *free_space)
static __rte_experimental __rte_always_inline void rte_ring_enqueue_zc_elem_finish(struct rte_ring *r, unsigned int n)
static __rte_experimental __rte_always_inline void rte_ring_dequeue_zc_finish(struct rte_ring *r, unsigned int n)
static __rte_experimental __rte_always_inline unsigned int rte_ring_enqueue_zc_burst_start(struct rte_ring *r, unsigned int n, struct rte_ring_zc_data *zcd, unsigned int *free_space)