Scroll to navigation

rte_ring_peek.h(3) DPDK rte_ring_peek.h(3)

NAME

rte_ring_peek.h

SYNOPSIS

#include <rte_ring_peek_elem_pvt.h>

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:

  • enqueue/dequeue start
  • enqueue/dequeue finish That allows user to inspect objects in the ring without removing them from it (aka MT safe peek). Note that right now this new API is available only for two sync modes: 1) Single Producer/Single Consumer (RTE_RING_SYNC_ST) 2) Serialized Producer/Serialized Consumer (RTE_RING_SYNC_MT_HTS). It is a user responsibility to create/init ring with appropriate sync modes selected. As an example: // read 1 elem from the ring: n = rte_ring_dequeue_bulk_start(ring, &obj, 1, NULL); if (n != 0) { //examine object if (object_examine(obj) == KEEP) //decided to keep it in the ring. rte_ring_dequeue_finish(ring, 0); else //decided to remove it from the ring. rte_ring_dequeue_finish(ring, n); } Note that between start and finish none other thread can proceed with enqueue(/dequeue) operation till finish completes.

Definition in file rte_ring_peek.h.

Function Documentation

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:

r A pointer to the ring structure.
n The number of objects to add in the ring from the obj_table.
free_space if 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.

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:

r A pointer to the ring structure.
n The number of objects to add in the ring from the obj_table.
free_space if 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.

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:

r A pointer to the ring structure.
n The number of objects to add in the ring from the obj_table.
free_space if 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.

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:

r A pointer to the ring structure.
n The number of objects to add in the ring from the obj_table.
free_space if 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.

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:

r A pointer to the ring structure.
obj_table A pointer to a table of objects.
esize The 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.
n The number of objects to add to the ring from the obj_table.

Definition at line 167 of file rte_ring_peek.h.

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:

r A pointer to the ring structure.
obj_table A pointer to a table of objects.
n The number of objects to add to the ring from the obj_table.

Definition at line 206 of file rte_ring_peek.h.

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:

r A pointer to the ring structure.
obj_table A pointer to a table of objects that will be filled.
esize The 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.
n The number of objects to dequeue from the ring to the obj_table.
available If 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.

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:

r A pointer to the ring structure.
obj_table A pointer to a table of void * pointers (objects) that will be filled.
n The number of objects to dequeue from the ring to the obj_table.
available If 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.

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:

r A pointer to the ring structure.
obj_table A pointer to a table of objects that will be filled.
esize The 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.
n The number of objects to dequeue from the ring to the obj_table.
available If 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.

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:

r A pointer to the ring structure.
obj_table A pointer to a table of void * pointers (objects) that will be filled.
n The number of objects to dequeue from the ring to the obj_table.
available If 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.

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:

r A pointer to the ring structure.
n The number of objects to remove from the ring.

Definition at line 331 of file rte_ring_peek.h.

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:

r A pointer to the ring structure.
n The number of objects to remove from the ring.

Definition at line 363 of file rte_ring_peek.h.

Author

Generated automatically by Doxygen for DPDK from the source code.

Thu May 23 2024 Version 23.11.0