table of contents
- trixie 24.11.3-1~deb13u1
- testing 24.11.3-2
- unstable 24.11.3-2
- experimental 25.11-1
| rte_event_ring.h(3) | Library Functions Manual | rte_event_ring.h(3) |
NAME¶
rte_event_ring.h
SYNOPSIS¶
#include <stdint.h>
#include <rte_common.h>
#include <rte_ring.h>
#include <rte_ring_elem.h>
#include 'rte_eventdev.h'
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)
void rte_event_ring_free (struct rte_event_ring *r)
struct rte_event_ring * rte_event_ring_create (const char *name,
unsigned int count, int socket_id, unsigned int flags) __rte_malloc
__rte_dealloc(rte_event_ring_free
struct rte_event_ring struct rte_event_ring *
rte_event_ring_lookup (const char *name)
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_always_inline unsigned int rte_event_ring_count (const struct rte_event_ring * r) [static]¶
Returns the number of events in the ring
Parameters
Returns
Definition at line 50 of file rte_event_ring.h.
__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
Returns
Definition at line 65 of file rte_event_ring.h.
__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
events pointer to an array of struct rte_event objects
n The number of events in the array to enqueue
free_space if non-NULL, returns the amount of space in the ring after the enqueue operation has completed
Returns
Definition at line 91 of file rte_event_ring.h.
__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
events pointer to an array to hold the struct rte_event objects
n number of events that can be held in the events array
available if non-null, is updated to indicate the number of events remaining in the ring once the dequeue has completed
Returns
Definition at line 127 of file rte_event_ring.h.
__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
events pointer to an array of struct rte_event objects
n number of events in the array to enqueue
free_space if non-null, is updated to indicate the amount of free space in the ring once the enqueue has completed.
Returns
Definition at line 165 of file rte_event_ring.h.
__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
events pointer to an array to hold the struct rte_event objects
n number of events that can be held in the events array
available if non-null, is updated to indicate the number of events remaining in the ring once the dequeue has completed
Returns
Definition at line 201 of file rte_event_ring.h.
void rte_event_ring_free (struct rte_event_ring * r)¶
De-allocate all memory used by the ring.
Parameters
struct rte_event_ring * rte_event_ring_create (const char * name, unsigned int count, int socket_id, unsigned int flags)¶
Create an event ring structure
This function allocates memory and initializes an event ring inside that memory.
Parameters
count the number of elements to be stored in the ring. If the flag RING_F_EXACT_SZ is not set, this must be a power of 2, and the actual usable space in the ring will be count - 1 entries. If the flag RING_F_EXACT_SZ is set, the this can be any value up to the ring size limit - 1, and the usable space will be exactly that requested.
socket_id The socket_id argument is the socket identifier in case of NUMA. The value can be SOCKET_ID_ANY if there is no NUMA constraint for the reserved zone.
flags An OR of the following:
- RING_F_SP_ENQ: If this flag is set, the default behavior when using rte_ring_enqueue() or rte_ring_enqueue_bulk() is "single-producer". Otherwise, it is "multi-producers".
- RING_F_SC_DEQ: If this flag is set, the default behavior when using rte_ring_dequeue() or rte_ring_dequeue_bulk() is "single-consumer". Otherwise, it is "multi-consumers".
- RING_F_EXACT_SZ: If this flag is set, the count parameter is to be taken as the exact usable size of the ring, and as such does not need to be a power of 2. The underlying ring memory should be a power-of-2 size greater than the count value.
Returns
- E_RTE_NO_CONFIG - function could not get pointer to rte_config structure
- E_RTE_SECONDARY - function was called from a secondary process instance
- EINVAL - count provided is not a power of 2
- ENOSPC - the maximum number of memzones has already been allocated
- EEXIST - a memzone with the same name already exists
- ENOMEM - no appropriate memory area found in which to create memzone
struct rte_event_ring struct rte_event_ring * rte_event_ring_lookup (const char * name)¶
Search for an event ring based on its name
Parameters
Returns
- •
- ENOENT - required entry not available to return.
unsigned int rte_event_ring_get_size (const struct rte_event_ring * r) [inline], [static]¶
Return the size of the event ring.
Parameters
Returns
Definition at line 328 of file rte_event_ring.h.
unsigned int rte_event_ring_get_capacity (const struct rte_event_ring * r) [inline], [static]¶
Return the number of elements which can be stored in the event ring.
Parameters
Returns
Definition at line 342 of file rte_event_ring.h.
Author¶
Generated automatically by Doxygen for DPDK from the source code.
| Version 25.11.0 | DPDK |