rte_ring_core.h(3)

πŸ’– rte_ring_core.h β€” Library Functions Manual ✨

okay so bestie, welcome to rte_ring_core.h(3) β€” yes that's the manual name, that's the page, we're here, we're seated πŸ’…


🌸 NAME 🌸

rte_ring_core.h β€” it's giving header file, it's giving DPDK ring internals, it's giving main character energy fr fr πŸŽ€


✨ SYNOPSIS ✨

the vibes start with these includes, no cap 🫢

#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 πŸ’œ

okay so this file is literally the definition of the RTE ring structure itself, plus the init flags, plus some related macros. like, the whole core of it. periodt.

and here's the tea bestie: for the majority of DPDK entities, it is not recommended to include this file directly πŸ™ˆ instead use include <rte_ring.h> or <rte_ring_elem.h> β€” those are the ones you actually want, iykyk.

Definition in file rte_ring_core.h.


πŸ‘‘ MACRO DEFINITION DOCUMENTATION πŸ‘‘

πŸŽ€ #define RTE_RING_NAMESIZE

Value:

(RTE_MEMZONE_NAMESIZE - \
sizeof(RTE_RING_MZ_PREFIX) + 1)

this is the maximum length of a ring name, bestie. yes it's math, yes it slays ✨

Definition at line 49 of file rte_ring_core.h.


πŸŽ€ #define RING_F_SP_ENQ 0x0001

the default enqueue is "single-producer". iconic.

Definition at line 147 of file rte_ring_core.h.


πŸŽ€ #define RING_F_SC_DEQ 0x0002

the default dequeue is "single-consumer". we love a matched set 🫢

Definition at line 148 of file rte_ring_core.h.


πŸŽ€ #define RING_F_EXACT_SZ 0x0004

okay this one actually matters so listen up: the ring is to hold exactly the requested number of entries. without this flag set, the ring size you request must be a power of 2, and the usable space will be that size minus one (yes really). with the flag, the requested size gets rounded up to the next power of two, but the usable space will be exactly that requested amount.

worst case? if you request a power-of-2 size, half the ring space will be wasted πŸ’€ so like, choose wisely.

Definition at line 157 of file rte_ring_core.h.


πŸŽ€ #define RTE_RING_SZ_MASK (0x7fffffffU)

ring size mask. she's a mask, she masks, we stan πŸ’…

Definition at line 158 of file rte_ring_core.h.


πŸŽ€ #define RING_F_MP_RTS_ENQ 0x0008

the default enqueue is "MP RTS". slay.

Definition at line 160 of file rte_ring_core.h.


πŸŽ€ #define RING_F_MC_RTS_DEQ 0x0010

the default dequeue is "MC RTS". periodt.

Definition at line 161 of file rte_ring_core.h.


πŸŽ€ #define RING_F_MP_HTS_ENQ 0x0020

the default enqueue is "MP HTS". yes another one, we love an acronym ✨

Definition at line 163 of file rte_ring_core.h.


πŸŽ€ #define RING_F_MC_HTS_DEQ 0x0040

the default dequeue is "MC HTS". and that's the last flag bestie, we made it 🌈

Definition at line 164 of file rte_ring_core.h.


πŸ’… ENUMERATION TYPE DOCUMENTATION πŸ’…

πŸ¦‹ enum rte_ring_queue_behavior

these are the enqueue/dequeue behavior types, like the personality types of your queue fr fr

Enumerator:

  • RTE_RING_QUEUE_FIXED β€” enq/deq a fixed number of items from a ring. commitment, we respect it 🀝
  • RTE_RING_QUEUE_VARIABLE β€” enq/deq as many items as possible from the ring. chaotic, flexible, honestly relatable πŸ“

Definition at line 40 of file rte_ring_core.h.


πŸ¦‹ enum rte_ring_sync_type

these are the prod/cons sync types β€” the whole thread-safety vibe check 🌸

Enumerator:

  • RTE_RING_SYNC_MT β€” multi-thread safe (default mode). the classic, the standard, the default queen πŸ‘‘
  • RTE_RING_SYNC_ST β€” single thread only. just you, no one else, very solo main character energy
  • RTE_RING_SYNC_MT_RTS β€” multi-thread relaxed tail sync. relaxed but make it threaded πŸ’…
  • RTE_RING_SYNC_MT_HTS β€” multi-thread head/tail sync. head AND tail? obsessed πŸ”₯

Definition at line 53 of file rte_ring_core.h.


🌈 AUTHOR 🌈

generated automatically by Doxygen for DPDK from the source code. so like, not a human author, a whole robot did this. ate, honestly πŸ€–βœ¨


and that's the whole page bestie!! this was DPDK, Version 25.11.3, and the page is rte_ring_core.h(3) β€” go forth and ring responsibly, ily, byeee πŸŽ€πŸ’–πŸ¦‹

πŸ“¦ where this page comes from