---
name: "rte_ring_core.h"
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_ring_core.h"
---

# rte\_ring\_core.h(3)

## NAME

rte\_ring\_core.h

## SYNOPSIS

`#include <stdalign.h>`\
 `#include <stdio.h>`\
 `#include <stdint.h>`\
 `#include <string.h>`\
 `#include <errno.h>`\
 `#include <rte_common.h>`\
 `#include <rte_config.h>`\
 `#include <rte_memory.h>`\
 `#include <rte_lcore.h>`\
 `#include <rte_atomic.h>`\
 `#include <rte_branch_prediction.h>`\
 `#include <rte_memzone.h>`\
 `#include <rte_pause.h>`\
 `#include <rte_debug.h>`\

### Data Structures

struct **rte\_ring\_headtail**\
 struct **rte\_ring**\
 union **rte\_ring::\_\_rte\_cache\_aligned**\

### Macros

\#define **RTE\_RING\_NAMESIZE**\
 \#define **RING\_F\_SP\_ENQ**   0x0001\
 \#define **RING\_F\_SC\_DEQ**   0x0002\
 \#define **RING\_F\_EXACT\_SZ**   0x0004\
 \#define **RTE\_RING\_SZ\_MASK**   (0x7fffffffU)\
 \#define **RING\_F\_MP\_RTS\_ENQ**   0x0008\
 \#define **RING\_F\_MC\_RTS\_DEQ**   0x0010\
 \#define **RING\_F\_MP\_HTS\_ENQ**   0x0020\
 \#define **RING\_F\_MC\_HTS\_DEQ**   0x0040\

### Enumerations

enum **rte\_ring\_queue\_behavior** { **RTE\_RING\_QUEUE\_FIXED** = 0, **RTE\_RING\_QUEUE\_VARIABLE** }\
 enum **rte\_ring\_sync\_type** { **RTE\_RING\_SYNC\_MT**, **RTE\_RING\_SYNC\_ST**, **RTE\_RING\_SYNC\_MT\_RTS**, **RTE\_RING\_SYNC\_MT\_HTS** }\

## Detailed Description

This file contains definition of RTE ring structure itself, init flags and some related macros. For majority of DPDK entities, it is not recommended to include this file directly, use include \<**rte\_ring.h**\> or \<**rte\_ring\_elem.h**\> instead.

Definition in file **rte\_ring\_core.h**.

## Macro Definition Documentation

### #define RTE\_RING\_NAMESIZE

**Value:**.PP

```
               (RTE_MEMZONE_NAMESIZE - \
               sizeof(RTE_RING_MZ_PREFIX) + 1)
```

The maximum length of a ring name.

Definition at line **49** of file **rte\_ring\_core.h**.

### #define RING\_F\_SP\_ENQ 0x0001

The default enqueue is 'single-producer'.

Definition at line **147** of file **rte\_ring\_core.h**.

### #define RING\_F\_SC\_DEQ 0x0002

The default dequeue is 'single-consumer'.

Definition at line **148** of file **rte\_ring\_core.h**.

### #define RING\_F\_EXACT\_SZ 0x0004

Ring is to hold exactly requested number of entries. Without this flag set, the ring size requested must be a power of 2, and the usable space will be that size - 1. With the flag, the requested size will be rounded up to the next power of two, but the usable space will be exactly that requested. Worst case, if a power-of-2 size is requested, half the ring space will be wasted.

Definition at line **157** of file **rte\_ring\_core.h**.

### #define RTE\_RING\_SZ\_MASK (0x7fffffffU)

Ring size mask

Definition at line **158** of file **rte\_ring\_core.h**.

### #define RING\_F\_MP\_RTS\_ENQ 0x0008

The default enqueue is 'MP RTS'.

Definition at line **160** of file **rte\_ring\_core.h**.

### #define RING\_F\_MC\_RTS\_DEQ 0x0010

The default dequeue is 'MC RTS'.

Definition at line **161** of file **rte\_ring\_core.h**.

### #define RING\_F\_MP\_HTS\_ENQ 0x0020

The default enqueue is 'MP HTS'.

Definition at line **163** of file **rte\_ring\_core.h**.

### #define RING\_F\_MC\_HTS\_DEQ 0x0040

The default dequeue is 'MC HTS'.

Definition at line **164** of file **rte\_ring\_core.h**.

## Enumeration Type Documentation

### enum rte\_ring\_queue\_behavior

enqueue/dequeue behavior types

**Enumerator**

- *RTE\_RING\_QUEUE\_FIXED*

  *Enq/Deq a fixed number of items from a ring*

- *RTE\_RING\_QUEUE\_VARIABLE*

  *Enq/Deq as many items as possible from ring*

*Definition at line* **40** *of file* **rte\_ring\_core.h***.*

### enum rte\_ring\_sync\_type

*prod/cons sync types*

**Enumerator**

- *RTE\_RING\_SYNC\_MT*

  *multi-thread safe (default mode)*

- *RTE\_RING\_SYNC\_ST*

  *single thread only*

- *RTE\_RING\_SYNC\_MT\_RTS*

  *multi-thread relaxed tail sync*

- *RTE\_RING\_SYNC\_MT\_HTS*

  *multi-thread head/tail sync*

*Definition at line* **53** *of file* **rte\_ring\_core.h***.*

## Author

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