---
name: "rte_event_ring_get_size"
section: "3"
platform: "linux"
package: "dpdk-doc"
version: "24.11.4-0+deb13u1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/rte_event_ring.h"
---

# rte\_event\_ring\_get\_size(3)

Part of [rte\_event\_ring.h(3)](/rte_event_ring.h/3.md).

## 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)\
 struct **rte\_event\_ring** \* **rte\_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

### 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**

*r* pointer to the event ring

**Returns**

the number of events in the ring

Definition at line **50** of file **rte\_event\_ring.h**.

### 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**

*r* pointer 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**.

### 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**

*r* pointer to the event ring \
 *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**

the number of objects enqueued, either 0 or n

Definition at line **91** of file **rte\_event\_ring.h**.

### 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**

*r* pointer to the event ring \
 *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**

the number of objects dequeued, either 0 or n

Definition at line **127** of file **rte\_event\_ring.h**.

### 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**

*r* pointer to the event ring \
 *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**

the number of elements, n', enqueued to the ring, 0 \<= n' \<= n

Definition at line **165** of file **rte\_event\_ring.h**.

### 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**

*r* pointer to the event ring \
 *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**

the number of elements, n', dequeued from the ring, 0 \<= n' \<= n

Definition at line **201** of file **rte\_event\_ring.h**.

### struct rte\_event\_ring \* rte\_event\_ring\_lookup (const char \* name)

Search for an event ring based on its name

**Parameters**

*name* The 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.

### void rte\_event\_ring\_free (struct rte\_event\_ring \* r)

De-allocate all memory used by the ring.

**Parameters**

*r* Pointer to ring to created with rte\_event\_ring\_create(). If r is NULL, no operation is performed.

### static unsigned int rte\_event\_ring\_get\_size (const struct rte\_event\_ring \* r)` [inline]`, ` [static]`

Return the size of the event ring.

**Parameters**

*r* A 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.**

### static 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**

*r* **A pointer to the ring structure.**

**Returns**

**The usable size of the ring.**

**Definition at line 342 of file rte\_event\_ring.h.**

## Author

**Generated automatically by Doxygen for DPDK from the source code.**
