DPDK 22.11.7
Data Structures | Macros | Enumerations
rte_ring_core.h File Reference
#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>

Go to the source code of this file.

Data Structures

struct  rte_ring_headtail
 
struct  rte_ring
 

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

◆ RTE_RING_NAMESIZE

#define RTE_RING_NAMESIZE
Value:
sizeof(RTE_RING_MZ_PREFIX) + 1)
#define RTE_MEMZONE_NAMESIZE
Definition: rte_memzone.h:50

The maximum length of a ring name.

Examples
examples/dma/dmafwd.c.

Definition at line 52 of file rte_ring_core.h.

◆ RING_F_SP_ENQ

#define RING_F_SP_ENQ   0x0001

◆ RING_F_SC_DEQ

#define RING_F_SC_DEQ   0x0002

◆ RING_F_EXACT_SZ

#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 163 of file rte_ring_core.h.

◆ RTE_RING_SZ_MASK

#define RTE_RING_SZ_MASK   (0x7fffffffU)

Ring size mask

Definition at line 164 of file rte_ring_core.h.

◆ RING_F_MP_RTS_ENQ

#define RING_F_MP_RTS_ENQ   0x0008

The default enqueue is "MP RTS".

Definition at line 166 of file rte_ring_core.h.

◆ RING_F_MC_RTS_DEQ

#define RING_F_MC_RTS_DEQ   0x0010

The default dequeue is "MC RTS".

Definition at line 167 of file rte_ring_core.h.

◆ RING_F_MP_HTS_ENQ

#define RING_F_MP_HTS_ENQ   0x0020

The default enqueue is "MP HTS".

Definition at line 169 of file rte_ring_core.h.

◆ RING_F_MC_HTS_DEQ

#define RING_F_MC_HTS_DEQ   0x0040

The default dequeue is "MC HTS".

Definition at line 170 of file rte_ring_core.h.

Enumeration Type Documentation

◆ 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 43 of file rte_ring_core.h.

◆ 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 56 of file rte_ring_core.h.