| rte_ring.h(3) | Library Functions Manual | rte_ring.h(3) |
rte_ring.h
#include <rte_ring_core.h>
#include <rte_ring_elem.h>
ssize_t rte_ring_get_memsize (unsigned int count)
int rte_ring_init (struct rte_ring *r, const char *name,
unsigned int count, unsigned int flags)
struct rte_ring * rte_ring_create (const char *name, unsigned
int count, int socket_id, unsigned int flags)
void rte_ring_free (struct rte_ring *r)
void rte_ring_dump (FILE *f, const struct rte_ring *r)
static __rte_always_inline unsigned int rte_ring_mp_enqueue_bulk
(struct rte_ring *r, void *const *obj_table, unsigned int n, unsigned
int *free_space)
static __rte_always_inline unsigned int rte_ring_sp_enqueue_bulk
(struct rte_ring *r, void *const *obj_table, unsigned int n, unsigned
int *free_space)
static __rte_always_inline unsigned int rte_ring_enqueue_bulk
(struct rte_ring *r, void *const *obj_table, unsigned int n, unsigned
int *free_space)
static __rte_always_inline int rte_ring_mp_enqueue (struct
rte_ring *r, void *obj)
static __rte_always_inline int rte_ring_sp_enqueue (struct
rte_ring *r, void *obj)
static __rte_always_inline int rte_ring_enqueue (struct
rte_ring *r, void *obj)
static __rte_always_inline unsigned int rte_ring_mc_dequeue_bulk
(struct rte_ring *r, void **obj_table, unsigned int n, unsigned int
*available)
static __rte_always_inline unsigned int rte_ring_sc_dequeue_bulk
(struct rte_ring *r, void **obj_table, unsigned int n, unsigned int
*available)
static __rte_always_inline unsigned int rte_ring_dequeue_bulk
(struct rte_ring *r, void **obj_table, unsigned int n, unsigned int
*available)
static __rte_always_inline int rte_ring_mc_dequeue (struct
rte_ring *r, void **obj_p)
static __rte_always_inline int rte_ring_sc_dequeue (struct
rte_ring *r, void **obj_p)
static __rte_always_inline int rte_ring_dequeue (struct
rte_ring *r, void **obj_p)
void rte_ring_reset (struct rte_ring *r)
static unsigned int rte_ring_count (const struct rte_ring *r)
static unsigned int rte_ring_free_count (const struct rte_ring
*r)
static int rte_ring_full (const struct rte_ring *r)
static int rte_ring_empty (const struct rte_ring *r)
static unsigned int rte_ring_get_size (const struct rte_ring *r)
static unsigned int rte_ring_get_capacity (const struct rte_ring
*r)
static enum rte_ring_sync_type rte_ring_get_prod_sync_type
(const struct rte_ring *r)
static int rte_ring_is_prod_single (const struct rte_ring *r)
static enum rte_ring_sync_type rte_ring_get_cons_sync_type
(const struct rte_ring *r)
static int rte_ring_is_cons_single (const struct rte_ring *r)
void rte_ring_list_dump (FILE *f)
struct rte_ring * rte_ring_lookup (const char *name)
static __rte_always_inline unsigned int
rte_ring_mp_enqueue_burst (struct rte_ring *r, void *const
*obj_table, unsigned int n, unsigned int *free_space)
static __rte_always_inline unsigned int
rte_ring_sp_enqueue_burst (struct rte_ring *r, void *const
*obj_table, unsigned int n, unsigned int *free_space)
static __rte_always_inline unsigned int rte_ring_enqueue_burst
(struct rte_ring *r, void *const *obj_table, unsigned int n, unsigned
int *free_space)
static __rte_always_inline unsigned int
rte_ring_mc_dequeue_burst (struct rte_ring *r, void
**obj_table, unsigned int n, unsigned int *available)
static __rte_always_inline unsigned int
rte_ring_sc_dequeue_burst (struct rte_ring *r, void
**obj_table, unsigned int n, unsigned int *available)
static __rte_always_inline unsigned int rte_ring_dequeue_burst
(struct rte_ring *r, void **obj_table, unsigned int n, unsigned int
*available)
RTE Ring
The Ring Manager is a fixed-size queue, implemented as a table of pointers. Head and tail pointers are modified atomically, allowing concurrent access to it. It has the following features:
Note: the ring implementation is not preemptible. Refer to Programmer's guide/Environment Abstraction Layer/Multiple pthread/Known Issues/rte_ring for more information.
Definition in file rte_ring.h.
Calculate the memory size needed for a ring
This function returns the number of bytes needed for a ring, given the number of elements in it. This value is the sum of the size of the structure rte_ring and the size of the memory needed by the objects pointers. The value is aligned to a cache line size.
Parameters
Returns
Initialize a ring structure.
Initialize a ring structure in memory pointed by 'r'. The size of the memory area must be large enough to store the ring structure and the object table. It is advised to use rte_ring_get_memsize() to get the appropriate size.
The ring size is set to count, which must be a power of two. The real usable ring size is count-1 instead of count to differentiate a full ring from an empty ring.
The ring is not added in RTE_TAILQ_RING global list. Indeed, the memory given by the caller may not be shareable among dpdk processes.
Parameters
Returns
Create a new ring named name in memory.
This function uses memzone_reserve() to allocate memory. Then it calls rte_ring_init() to initialize an empty ring.
The new ring size is set to count, which must be a power of two. The real usable ring size is count-1 instead of count to differentiate a full ring from an empty ring.
The ring is added in RTE_TAILQ_RING list.
Parameters
Returns
De-allocate all memory used by the ring.
Parameters
Dump the status of the ring to a file.
Parameters
Enqueue several objects on the ring (multi-producers safe).
This function uses a 'compare and set' instruction to move the producer index atomically.
Parameters
Returns
Definition at line 226 of file rte_ring.h.
Enqueue several objects on a ring (NOT multi-producers safe).
Parameters
Returns
Definition at line 249 of file rte_ring.h.
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
Returns
Definition at line 276 of file rte_ring.h.
Enqueue one object on a ring (multi-producers safe).
This function uses a 'compare and set' instruction to move the producer index atomically.
Parameters
Returns
Definition at line 298 of file rte_ring.h.
Enqueue one object on a ring (NOT multi-producers safe).
Parameters
Returns
Definition at line 315 of file rte_ring.h.
Enqueue one object on a ring.
This function calls the multi-producer or the single-producer version, depending on the default behaviour that was specified at ring creation time (see flags).
Parameters
Returns
Definition at line 336 of file rte_ring.h.
Dequeue several objects from a ring (multi-consumers safe).
This function uses a 'compare and set' instruction to move the consumer index atomically.
Parameters
Returns
Definition at line 360 of file rte_ring.h.
Dequeue several objects from a ring (NOT multi-consumers safe).
Parameters
Returns
Definition at line 384 of file rte_ring.h.
Dequeue several objects from a ring.
This function calls the multi-consumers or the single-consumer version, depending on the default behaviour that was specified at ring creation time (see flags).
Parameters
Returns
Definition at line 411 of file rte_ring.h.
Dequeue one object from a ring (multi-consumers safe).
This function uses a 'compare and set' instruction to move the consumer index atomically.
Parameters
Returns
Definition at line 434 of file rte_ring.h.
Dequeue one object from a ring (NOT multi-consumers safe).
Parameters
Returns
Definition at line 452 of file rte_ring.h.
Dequeue one object from a ring.
This function calls the multi-consumers or the single-consumer version depending on the default behaviour that was specified at ring creation time (see flags).
Parameters
Returns
Definition at line 474 of file rte_ring.h.
Flush a ring.
This function flush all the elements in a ring
Warning
Parameters
Return the number of entries in a ring.
Parameters
Returns
Definition at line 502 of file rte_ring.h.
Return the number of free entries in a ring.
Parameters
Returns
Definition at line 519 of file rte_ring.h.
Test if a ring is full.
Parameters
Returns
Definition at line 534 of file rte_ring.h.
Test if a ring is empty.
Parameters
Returns
Definition at line 549 of file rte_ring.h.
Return the size of the ring.
Parameters
Returns
Definition at line 567 of file rte_ring.h.
Return the number of elements which can be stored in the ring.
Parameters
Returns
Definition at line 581 of file rte_ring.h.
Return sync type used by producer in the ring.
Parameters
Returns
Definition at line 595 of file rte_ring.h.
Check is the ring for single producer.
Parameters
Returns
Definition at line 609 of file rte_ring.h.
Return sync type used by consumer in the ring.
Parameters
Returns
Definition at line 623 of file rte_ring.h.
Check is the ring for single consumer.
Parameters
Returns
Definition at line 637 of file rte_ring.h.
Dump the status of all rings on the console
Parameters
Search a ring from its name
Parameters
Returns
Enqueue several objects on the ring (multi-producers safe).
This function uses a 'compare and set' instruction to move the producer index atomically.
Parameters
Returns
Definition at line 681 of file rte_ring.h.
Enqueue several objects on a ring (NOT multi-producers safe).
Parameters
Returns
Definition at line 704 of file rte_ring.h.
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
Returns
Definition at line 731 of file rte_ring.h.
Dequeue several objects from a ring (multi-consumers safe). When the request objects are more than the available objects, only dequeue the actual number of objects
This function uses a 'compare and set' instruction to move the consumer index atomically.
Parameters
Returns
Definition at line 759 of file rte_ring.h.
Dequeue several objects from a ring (NOT multi-consumers safe).When the request objects are more than the available objects, only dequeue the actual number of objects
Parameters
Returns
Definition at line 784 of file rte_ring.h.
Dequeue multiple objects from a ring up to a maximum number.
This function calls the multi-consumers or the single-consumer version, depending on the default behaviour that was specified at ring creation time (see flags).
Parameters
Returns
Definition at line 811 of file rte_ring.h.
Generated automatically by Doxygen for DPDK from the source code.
| Version 24.11.3 | DPDK |