DPDK  24.07.0
Functions
rte_ring_peek.h File Reference
#include <rte_ring_peek_elem_pvt.h>

Go to the source code of this file.

Functions

static __rte_always_inline unsigned int rte_ring_enqueue_bulk_elem_start (struct rte_ring *r, unsigned int n, unsigned int *free_space)
 
static __rte_always_inline unsigned int rte_ring_enqueue_bulk_start (struct rte_ring *r, unsigned int n, unsigned int *free_space)
 
static __rte_always_inline unsigned int rte_ring_enqueue_burst_elem_start (struct rte_ring *r, unsigned int n, unsigned int *free_space)
 
static __rte_always_inline unsigned int rte_ring_enqueue_burst_start (struct rte_ring *r, unsigned int n, unsigned int *free_space)
 
static __rte_always_inline void rte_ring_enqueue_elem_finish (struct rte_ring *r, const void *obj_table, unsigned int esize, unsigned int n)
 
static __rte_always_inline void rte_ring_enqueue_finish (struct rte_ring *r, void *const *obj_table, unsigned int n)
 
static __rte_always_inline unsigned int rte_ring_dequeue_bulk_elem_start (struct rte_ring *r, void *obj_table, unsigned int esize, unsigned int n, unsigned int *available)
 
static __rte_always_inline unsigned int rte_ring_dequeue_bulk_start (struct rte_ring *r, void **obj_table, unsigned int n, unsigned int *available)
 
static __rte_always_inline unsigned int rte_ring_dequeue_burst_elem_start (struct rte_ring *r, void *obj_table, unsigned int esize, unsigned int n, unsigned int *available)
 
static __rte_always_inline unsigned int rte_ring_dequeue_burst_start (struct rte_ring *r, void **obj_table, unsigned int n, unsigned int *available)
 
static __rte_always_inline void rte_ring_dequeue_elem_finish (struct rte_ring *r, unsigned int n)
 
static __rte_always_inline void rte_ring_dequeue_finish (struct rte_ring *r, unsigned int n)
 

Detailed Description

It is not recommended to include this file directly. Please include <rte_ring_elem.h> instead.

Ring Peek API Introduction of rte_ring with serialized producer/consumer (HTS sync mode) makes possible to split public enqueue/dequeue API into two phases:

Definition in file rte_ring_peek.h.

Function Documentation

◆ rte_ring_enqueue_bulk_elem_start()

static __rte_always_inline unsigned int rte_ring_enqueue_bulk_elem_start ( struct rte_ring r,
unsigned int  n,
unsigned int *  free_space 
)
static

Start to enqueue several objects on the ring. Note that no actual objects are put in the queue by this function, it just reserves for user such ability. User has to call appropriate enqueue_elem_finish() to copy objects into the queue and complete given enqueue operation.

Parameters
rA pointer to the ring structure.
nThe number of objects to add in the ring from the obj_table.
free_spaceif non-NULL, returns the amount of space in the ring after the enqueue operation has finished.
Returns
The number of objects that can be enqueued, either 0 or n

Definition at line 70 of file rte_ring_peek.h.

◆ rte_ring_enqueue_bulk_start()

static __rte_always_inline unsigned int rte_ring_enqueue_bulk_start ( struct rte_ring r,
unsigned int  n,
unsigned int *  free_space 
)
static

Start to enqueue several objects on the ring. Note that no actual objects are put in the queue by this function, it just reserves for user such ability. User has to call appropriate enqueue_finish() to copy objects into the queue and complete given enqueue operation.

Parameters
rA pointer to the ring structure.
nThe number of objects to add in the ring from the obj_table.
free_spaceif non-NULL, returns the amount of space in the ring after the enqueue operation has finished.
Returns
The number of objects that can be enqueued, either 0 or n

Definition at line 95 of file rte_ring_peek.h.

◆ rte_ring_enqueue_burst_elem_start()

static __rte_always_inline unsigned int rte_ring_enqueue_burst_elem_start ( struct rte_ring r,
unsigned int  n,
unsigned int *  free_space 
)
static

Start to enqueue several objects on the ring. Note that no actual objects are put in the queue by this function, it just reserves for user such ability. User has to call appropriate enqueue_elem_finish() to copy objects into the queue and complete given enqueue operation.

Parameters
rA pointer to the ring structure.
nThe number of objects to add in the ring from the obj_table.
free_spaceif non-NULL, returns the amount of space in the ring after the enqueue operation has finished.
Returns
Actual number of objects that can be enqueued.

Definition at line 119 of file rte_ring_peek.h.

◆ rte_ring_enqueue_burst_start()

static __rte_always_inline unsigned int rte_ring_enqueue_burst_start ( struct rte_ring r,
unsigned int  n,
unsigned int *  free_space 
)
static

Start to enqueue several objects on the ring. Note that no actual objects are put in the queue by this function, it just reserves for user such ability. User has to call appropriate enqueue_finish() to copy objects into the queue and complete given enqueue operation.

Parameters
rA pointer to the ring structure.
nThe number of objects to add in the ring from the obj_table.
free_spaceif non-NULL, returns the amount of space in the ring after the enqueue operation has finished.
Returns
Actual number of objects that can be enqueued.

Definition at line 144 of file rte_ring_peek.h.

◆ rte_ring_enqueue_elem_finish()

static __rte_always_inline void rte_ring_enqueue_elem_finish ( struct rte_ring r,
const void *  obj_table,
unsigned int  esize,
unsigned int  n 
)
static

Complete to enqueue several objects on the ring. Note that number of objects to enqueue should not exceed previous enqueue_start return value.

Parameters
rA pointer to the ring structure.
obj_tableA pointer to a table of objects.
esizeThe size of ring element, in bytes. It must be a multiple of 4. This must be the same value used while creating the ring. Otherwise the results are undefined.
nThe number of objects to add to the ring from the obj_table.

Definition at line 167 of file rte_ring_peek.h.

◆ rte_ring_enqueue_finish()

static __rte_always_inline void rte_ring_enqueue_finish ( struct rte_ring r,
void *const *  obj_table,
unsigned int  n 
)
static

Complete to enqueue several objects on the ring. Note that number of objects to enqueue should not exceed previous enqueue_start return value.

Parameters
rA pointer to the ring structure.
obj_tableA pointer to a table of objects.
nThe number of objects to add to the ring from the obj_table.

Definition at line 206 of file rte_ring_peek.h.

◆ rte_ring_dequeue_bulk_elem_start()

static __rte_always_inline unsigned int rte_ring_dequeue_bulk_elem_start ( struct rte_ring r,
void *  obj_table,
unsigned int  esize,
unsigned int  n,
unsigned int *  available 
)
static

Start to dequeue several objects from the ring. Note that user has to call appropriate dequeue_finish() to complete given dequeue operation and actually remove objects the ring.

Parameters
rA pointer to the ring structure.
obj_tableA pointer to a table of objects that will be filled.
esizeThe size of ring element, in bytes. It must be a multiple of 4. This must be the same value used while creating the ring. Otherwise the results are undefined.
nThe number of objects to dequeue from the ring to the obj_table.
availableIf non-NULL, returns the number of remaining ring entries after the dequeue has finished.
Returns
The number of objects dequeued, either 0 or n.

Definition at line 234 of file rte_ring_peek.h.

◆ rte_ring_dequeue_bulk_start()

static __rte_always_inline unsigned int rte_ring_dequeue_bulk_start ( struct rte_ring r,
void **  obj_table,
unsigned int  n,
unsigned int *  available 
)
static

Start to dequeue several objects from the ring. Note that user has to call appropriate dequeue_finish() to complete given dequeue operation and actually remove objects the ring.

Parameters
rA pointer to the ring structure.
obj_tableA pointer to a table of void * pointers (objects) that will be filled.
nThe number of objects to dequeue from the ring to the obj_table.
availableIf non-NULL, returns the number of remaining ring entries after the dequeue has finished.
Returns
Actual number of objects dequeued.

Definition at line 259 of file rte_ring_peek.h.

◆ rte_ring_dequeue_burst_elem_start()

static __rte_always_inline unsigned int rte_ring_dequeue_burst_elem_start ( struct rte_ring r,
void *  obj_table,
unsigned int  esize,
unsigned int  n,
unsigned int *  available 
)
static

Start to dequeue several objects from the ring. Note that user has to call appropriate dequeue_finish() to complete given dequeue operation and actually remove objects the ring.

Parameters
rA pointer to the ring structure.
obj_tableA pointer to a table of objects that will be filled.
esizeThe size of ring element, in bytes. It must be a multiple of 4. This must be the same value used while creating the ring. Otherwise the results are undefined.
nThe number of objects to dequeue from the ring to the obj_table.
availableIf non-NULL, returns the number of remaining ring entries after the dequeue has finished.
Returns
The actual number of objects dequeued.

Definition at line 288 of file rte_ring_peek.h.

◆ rte_ring_dequeue_burst_start()

static __rte_always_inline unsigned int rte_ring_dequeue_burst_start ( struct rte_ring r,
void **  obj_table,
unsigned int  n,
unsigned int *  available 
)
static

Start to dequeue several objects from the ring. Note that user has to call appropriate dequeue_finish() to complete given dequeue operation and actually remove objects the ring.

Parameters
rA pointer to the ring structure.
obj_tableA pointer to a table of void * pointers (objects) that will be filled.
nThe number of objects to dequeue from the ring to the obj_table.
availableIf non-NULL, returns the number of remaining ring entries after the dequeue has finished.
Returns
The actual number of objects dequeued.

Definition at line 313 of file rte_ring_peek.h.

◆ rte_ring_dequeue_elem_finish()

static __rte_always_inline void rte_ring_dequeue_elem_finish ( struct rte_ring r,
unsigned int  n 
)
static

Complete to dequeue several objects from the ring. Note that number of objects to dequeue should not exceed previous dequeue_start return value.

Parameters
rA pointer to the ring structure.
nThe number of objects to remove from the ring.

Definition at line 331 of file rte_ring_peek.h.

◆ rte_ring_dequeue_finish()

static __rte_always_inline void rte_ring_dequeue_finish ( struct rte_ring r,
unsigned int  n 
)
static

Complete to dequeue several objects from the ring. Note that number of objects to dequeue should not exceed previous dequeue_start return value.

Parameters
rA pointer to the ring structure.
nThe number of objects to remove from the ring.

Definition at line 363 of file rte_ring_peek.h.