DPDK  24.07.0
Data Structures | Functions
rte_event_ring.h File Reference
#include <stdint.h>
#include <rte_common.h>
#include <rte_ring.h>
#include <rte_ring_elem.h>
#include "rte_eventdev.h"

Go to the source code of this file.

Data Structures

struct  rte_event_ring
 

Functions

static __rte_always_inline unsigned int rte_event_ring_count (const struct rte_event_ring *r)
 
static __rte_always_inline unsigned int rte_event_ring_free_count (const struct rte_event_ring *r)
 
static __rte_always_inline unsigned int rte_event_ring_enqueue_bulk (struct rte_event_ring *r, const struct rte_event *events, unsigned int n, uint16_t *free_space)
 
static __rte_always_inline unsigned int rte_event_ring_dequeue_bulk (struct rte_event_ring *r, struct rte_event *events, unsigned int n, uint16_t *available)
 
static __rte_always_inline unsigned int rte_event_ring_enqueue_burst (struct rte_event_ring *r, const struct rte_event *events, unsigned int n, uint16_t *free_space)
 
static __rte_always_inline unsigned int rte_event_ring_dequeue_burst (struct rte_event_ring *r, struct rte_event *events, unsigned int n, uint16_t *available)
 
struct rte_event_ringrte_event_ring_lookup (const char *name)
 
void rte_event_ring_free (struct rte_event_ring *r)
 
static unsigned int rte_event_ring_get_size (const struct rte_event_ring *r)
 
static unsigned int rte_event_ring_get_capacity (const struct rte_event_ring *r)
 

Detailed Description

RTE Event Ring

This provides a ring implementation for passing rte_event structures from one core to another.

Definition in file rte_event_ring.h.

Function Documentation

◆ rte_event_ring_count()

static __rte_always_inline unsigned int rte_event_ring_count ( const struct rte_event_ring r)
static

Returns the number of events in the ring

Parameters
rpointer to the event ring
Returns
the number of events in the ring

Definition at line 50 of file rte_event_ring.h.

◆ rte_event_ring_free_count()

static __rte_always_inline unsigned int rte_event_ring_free_count ( const struct rte_event_ring r)
static

Returns the amount of free space in the ring

Parameters
rpointer to the event ring
Returns
the number of free slots in the ring, i.e. the number of events that can be successfully enqueued before dequeue must be called

Definition at line 65 of file rte_event_ring.h.

◆ rte_event_ring_enqueue_bulk()

static __rte_always_inline unsigned int rte_event_ring_enqueue_bulk ( struct rte_event_ring r,
const struct rte_event events,
unsigned int  n,
uint16_t *  free_space 
)
static

Enqueue several objects on a ring.

This function calls the multi-producer or the single-producer version depending on the default behavior that was specified at ring creation time (see flags).

Parameters
rpointer to the event ring
eventspointer to an array of struct rte_event objects
nThe number of events in the array to enqueue
free_spaceif non-NULL, returns the amount of space in the ring after the enqueue operation has completed
Returns
the number of objects enqueued, either 0 or n

Definition at line 91 of file rte_event_ring.h.

◆ rte_event_ring_dequeue_bulk()

static __rte_always_inline unsigned int rte_event_ring_dequeue_bulk ( struct rte_event_ring r,
struct rte_event events,
unsigned int  n,
uint16_t *  available 
)
static

Dequeue a set of events from a ring

Note: this API does not work with pointers to events, rather it copies the events themselves to the destination events buffer.

Parameters
rpointer to the event ring
eventspointer to an array to hold the struct rte_event objects
nnumber of events that can be held in the events array
availableif non-null, is updated to indicate the number of events remaining in the ring once the dequeue has completed
Returns
the number of objects dequeued, either 0 or n

Definition at line 127 of file rte_event_ring.h.

◆ rte_event_ring_enqueue_burst()

static __rte_always_inline unsigned int rte_event_ring_enqueue_burst ( struct rte_event_ring r,
const struct rte_event events,
unsigned int  n,
uint16_t *  free_space 
)
static

Enqueue a set of events onto a ring

Note: this API enqueues by copying the events themselves onto the ring, rather than just placing a pointer to each event onto the ring. This means that statically-allocated events can safely be enqueued by this API.

Parameters
rpointer to the event ring
eventspointer to an array of struct rte_event objects
nnumber of events in the array to enqueue
free_spaceif non-null, is updated to indicate the amount of free space in the ring once the enqueue has completed.
Returns
the number of elements, n', enqueued to the ring, 0 <= n' <= n

Definition at line 165 of file rte_event_ring.h.

◆ rte_event_ring_dequeue_burst()

static __rte_always_inline unsigned int rte_event_ring_dequeue_burst ( struct rte_event_ring r,
struct rte_event events,
unsigned int  n,
uint16_t *  available 
)
static

Dequeue a set of events from a ring

Note: this API does not work with pointers to events, rather it copies the events themselves to the destination events buffer.

Parameters
rpointer to the event ring
eventspointer to an array to hold the struct rte_event objects
nnumber of events that can be held in the events array
availableif non-null, is updated to indicate the number of events remaining in the ring once the dequeue has completed
Returns
the number of elements, n', dequeued from the ring, 0 <= n' <= n

Definition at line 201 of file rte_event_ring.h.

◆ rte_event_ring_lookup()

struct rte_event_ring* rte_event_ring_lookup ( const char *  name)

Search for an event ring based on its name

Parameters
nameThe name of the ring.
Returns
The pointer to the ring matching the name, or NULL if not found, with rte_errno set appropriately. Possible rte_errno values include:
  • ENOENT - required entry not available to return.

◆ rte_event_ring_free()

void rte_event_ring_free ( struct rte_event_ring r)

De-allocate all memory used by the ring.

Parameters
rPointer to ring to created with rte_event_ring_create(). If r is NULL, no operation is performed.

◆ rte_event_ring_get_size()

static unsigned int rte_event_ring_get_size ( const struct rte_event_ring r)
inlinestatic

Return the size of the event ring.

Parameters
rA pointer to the ring structure.
Returns
The size of the data store used by the ring. NOTE: this is not the same as the usable space in the ring. To query that use rte_ring_get_capacity().

Definition at line 328 of file rte_event_ring.h.

◆ rte_event_ring_get_capacity()

static unsigned int rte_event_ring_get_capacity ( const struct rte_event_ring r)
inlinestatic

Return the number of elements which can be stored in the event ring.

Parameters
rA pointer to the ring structure.
Returns
The usable size of the ring.

Definition at line 342 of file rte_event_ring.h.