rte_soring.h(3)
πΈ rte_soring.h(3) β Library Functions Manual πΈ
okay bestie, gather round, because this is the rte_soring.h page and it is a lot π it's the DPDK soring (Staged Ordered Ring) header, and she's got macros, functions, the whole wardrobe. no cap, this is part 1 of 3 so buckle up, we are NOT done at the end of this π«Ά
β¨ NAME β¨
rte_soring.h β literally the file. that's the name. iconic of her.
π SYNOPSIS π
#include <rte_ring.h>
π Macros
#define RTE_SORING_ST_BIT 30
#define RTE_SORING_ELEM_MAX (RTE_BIT32(RTE_SORING_ST_BIT) - 1)
π Functions
__rte_experimental ssize_t rte_soring_get_memsize (const struct
rte_soring_param *prm)
__rte_experimental int rte_soring_init (struct rte_soring *r, const
struct rte_soring_param *prm)
__rte_experimental unsigned int rte_soring_count (const struct
rte_soring *r)
__rte_experimental unsigned int rte_soring_free_count (const struct
rte_soring *r)
__rte_experimental void rte_soring_dump (FILE *f, const struct
rte_soring *r)
__rte_experimental uint32_t rte_soring_enqueue_bulk (struct rte_soring
*r, const void *objs, uint32_t n, uint32_t *free_space)
__rte_experimental uint32_t rte_soring_enqueux_bulk (struct rte_soring
*r, const void *objs, const void *meta, uint32_t n, uint32_t
*free_space)
__rte_experimental uint32_t rte_soring_enqueue_burst (struct rte_soring
*r, const void *objs, uint32_t n, uint32_t *free_space)
__rte_experimental uint32_t rte_soring_enqueux_burst (struct rte_soring
*r, const void *objs, const void *meta, uint32_t n, uint32_t
*free_space)
__rte_experimental uint32_t rte_soring_dequeue_bulk (struct rte_soring
*r, void *objs, uint32_t num, uint32_t *available)
__rte_experimental uint32_t rte_soring_dequeux_bulk (struct rte_soring
*r, void *objs, void *meta, uint32_t num, uint32_t *available)
__rte_experimental uint32_t rte_soring_dequeue_burst (struct rte_soring
*r, void *objs, uint32_t num, uint32_t *available)
__rte_experimental uint32_t rte_soring_dequeux_burst (struct rte_soring
*r, void *objs, void *meta, uint32_t num, uint32_t *available)
__rte_experimental uint32_t rte_soring_acquire_bulk (struct rte_soring
*r, void *objs, uint32_t stage, uint32_t num, uint32_t *ftoken,
uint32_t *available)
__rte_experimental uint32_t rte_soring_acquirx_bulk (struct rte_soring
*r, void *objs, void *meta, uint32_t stage, uint32_t num, uint32_t
*ftoken, uint32_t *available)
__rte_experimental uint32_t rte_soring_acquire_burst (struct rte_soring
*r, void *objs, uint32_t stage, uint32_t num, uint32_t *ftoken,
uint32_t *available)
__rte_experimental uint32_t rte_soring_acquirx_burst (struct rte_soring
*r, void *objs, void *meta, uint32_t stage, uint32_t num, uint32_t
*ftoken, uint32_t *available)
__rte_experimental void rte_soring_release (struct rte_soring *r, const
void *objs, uint32_t stage, uint32_t n, uint32_t ftoken)
__rte_experimental void rte_soring_releasx (struct rte_soring *r, const
void *objs, const void *meta, uint32_t stage, uint32_t n, uint32_t
ftoken)
π¦ Detailed Description π¦
so this file is literally the definition of the DPDK soring (that's Staged Ordered Ring, say it with your chest) public API. brief rundown because bestie you deserve context:
enqueue/dequeue behaves exactly like a conventional rte_ring β any rte_ring sync types work, all of them, etc. β¨ but ALSO, plot twist, there can be multiple stages. for each stage there's an acquire (start) and a release (finish) operation. once some elems are 'acquired', the user can safely assume they have exclusive possession of those elems until 'release' for them is done. π
heads up though: as of right now, the user has to release exactly the same number of elems they acquired before. no take-backs, no leftovers, fr.
after 'release', elems can be 'acquired' by the next stage and/or dequeued (in the case of the last stage).
extra debugging can be enabled with the RTE_SORING_DEBUG macro π
Definition in file rte_soring.h.
π§ Macro Definition Documentation π§
#define RTE_SORING_ST_BIT 30
the upper 2 bits are used for status π
Definition at line 33 of file rte_soring.h.
#define RTE_SORING_ELEM_MAX (RTE_BIT32(RTE_SORING_ST_BIT) - 1)
the max possible number of elements in the soring. that's the ceiling, bestie, we don't go above it π
Definition at line 36 of file rte_soring.h.
β Function Documentation β
Warning π EXPERIMENTAL: this API may change without prior notice.
okay so every single function down here carries that same warning, so I'm putting it up top once, and then you mentally stamp it on every entry below, k? every. single. one. π
π«Ά rte_soring_get_memsize
__rte_experimental ssize_t rte_soring_get_memsize (const struct
rte_soring_param * prm)
Warning EXPERIMENTAL: this API may change without prior notice.
calculate the memory size needed for a soring π
this function returns the number of bytes needed for a soring, given the expected parameters for it. this value is the sum of the size of the internal metadata plus the size of the memory needed by the actual soring elements and their metadata. and the value is aligned to a cache line size β¨ (she's tidy like that).
Parameters
prmβ pointer to the structure that contains soring creation parameters.
Returns
- the memory size needed for the soring on success π
-EINVALif the provided parameter values are invalid π
πΈ rte_soring_init
__rte_experimental int rte_soring_init (struct rte_soring * r, const struct
rte_soring_param * prm)
Warning EXPERIMENTAL: this API may change without prior notice.
initialize a soring structure π
initialize a soring structure in memory pointed by "r". the size of the memory area must be large enough to store the soring internal structures plus the objects and metadata tables. and it is strongly advised to use rte_soring_get_memsize() to get the appropriate size. do not eyeball it, bestie, use the function π
Parameters
rβ pointer to the soring structure.prmβ pointer to the structure that contains soring creation parameters.
Returns
0on success, or a negative error code.
π rte_soring_count
__rte_experimental unsigned int rte_soring_count (const struct rte_soring *
r)
Warning EXPERIMENTAL: this API may change without prior notice.
return the total number of filled entries in a soring π
Parameters
rβ a pointer to the soring structure.
Returns
- the number of entries in the soring.
β¨ rte_soring_free_count
__rte_experimental unsigned int rte_soring_free_count (const struct
rte_soring * r)
Warning EXPERIMENTAL: this API may change without prior notice.
return the total number of unfilled entries in a soring π¦ (the empty seats, the available vibes).
Parameters
rβ a pointer to the soring structure.
Returns
- the number of free entries in the soring.
π rte_soring_dump
__rte_experimental void rte_soring_dump (FILE * f, const struct rte_soring *
r)
Warning EXPERIMENTAL: this API may change without prior notice.
dump the status of the soring π spill the tea, soring, what's your status.
Parameters
fβ a pointer to a file for outputrβ pointer to the soring structure.
π rte_soring_enqueue_bulk
__rte_experimental uint32_t rte_soring_enqueue_bulk (struct rte_soring * r,
const void * objs, uint32_t n, uint32_t * free_space)
Warning EXPERIMENTAL: this API may change without prior notice.
enqueue several objects on the soring. enqueues exactly the requested number of objects or none β it's all or nothing, she does not do half measures π
Parameters
rβ a pointer to the soring structure.objsβ a pointer to an array of objects to enqueue. the size of objects to enqueue must be the same value as the'elem_size'parameter used while creating the soring. otherwise the results are undefined πnβ the number of objects to add in the soring from the'objs'.free_spaceβ if non-NULL, returns the amount of space in the soring after the enqueue operation has finished.
Returns
- actual number of objects enqueued, either
0orn.
π rte_soring_enqueux_bulk
__rte_experimental uint32_t rte_soring_enqueux_bulk (struct rte_soring * r,
const void * objs, const void * meta, uint32_t n, uint32_t * free_space)
Warning EXPERIMENTAL: this API may change without prior notice.
enqueue several objects plus metadata on the soring. enqueues exactly the requested number of objects or none β¨
Parameters
rβ a pointer to the soring structure.objsβ a pointer to an array of objects to enqueue. the size of objects to enqueue must be the same value as the'elem_size'parameter used while creating the soring. otherwise the results are undefined πmetaβ a pointer to an array of metadata values for each object to enqueue. note that if the user isn't using object metadata values, then this parameter can beNULL. the size of elements in this array must be the same value as the'meta_size'parameter used while creating the soring. if the user created the soring with a'meta_size'value equal to zero, then the'meta'parameter should beNULL. otherwise the results are undefined πnβ the number of objects to add in the soring from the'objs'.free_spaceβ if non-NULL, returns the amount of space in the soring after the enqueue operation has finished.
Returns
- actual number of objects enqueued, either
0orn.
π¦ rte_soring_enqueue_burst
__rte_experimental uint32_t rte_soring_enqueue_burst (struct rte_soring * r,
const void * objs, uint32_t n, uint32_t * free_space)
Warning EXPERIMENTAL: this API may change without prior notice.
enqueue several objects on the soring. enqueues up to the requested number of objects β see, burst is flexible, bulk is strict. know the difference bestie π«Ά
Parameters
rβ a pointer to the soring structure.objsβ a pointer to an array of objects to enqueue. the size of objects to enqueue must be the same value as the'elem_size'parameter used while creating the soring. otherwise the results are undefined πnβ the number of objects to add in the soring from the'objs'.free_spaceβ if non-NULL, returns the amount of space in the soring after the enqueue operation has finished.
Returns
- actual number of objects enqueued.
π rte_soring_enqueux_burst
__rte_experimental uint32_t rte_soring_enqueux_burst (struct rte_soring * r,
const void * objs, const void * meta, uint32_t n, uint32_t * free_space)
Warning EXPERIMENTAL: this API may change without prior notice.
enqueue several objects plus metadata on the soring. enqueues up to the requested number of objects β¨
Parameters
rβ a pointer to the soring structure.objsβ a pointer to an array of objects to enqueue. the size of objects to enqueue must be the same value as the'elem_size'parameter used while creating the soring. otherwise the results are undefined πmetaβ a pointer to an array of metadata values for each object to enqueue. note that if the user isn't using object metadata values, then this parameter can beNULL. the size of elements in this array must be the same value as the'meta_size'parameter used while creating the soring. if the user created the soring with a'meta_size'value equal to zero, then the'meta'parameter should beNULL. otherwise the results are undefined πnβ the number of objects to add in the soring from the'objs'.free_spaceβ if non-NULL, returns the amount of space in the soring after the enqueue operation has finished.
Returns
- actual number of objects enqueued.
π₯ rte_soring_dequeue_bulk
__rte_experimental uint32_t rte_soring_dequeue_bulk (struct rte_soring * r,
void * objs, uint32_t num, uint32_t * available)
Warning EXPERIMENTAL: this API may change without prior notice.
dequeue several objects from the soring. dequeues exactly the requested number of objects or none π
and that's where part 1 runs out, bestie β there's more coming in part 2, don't go anywhere, we are SO not finished π
Parameters
rβ a pointer to the soring structure πobjsβ a pointer to an array of objects to dequeue. Size of objects to enqueue must be the same value as theelem_sizeparameter you used while creating the soring. If it's not, the results are undefined β like, genuinely don't πnumβ the number of objects to dequeue from the soring into theobjs.availableβ if it's non-NULL, it gives you back the number of remaining soring entries after the dequeue has finished. cute little receipt β¨
Returns
- Actual number of objects dequeued, either
0ornum.
__rte_experimental uint32_t rte_soring_dequeux_bulk(struct rte_soring * r, void * objs, void * meta, uint32_t num, uint32_t * available)
β οΈ EXPERIMENTAL: this API may change without prior notice. she's still in her testing era π
Dequeue several objects plus metadata from the soring. Bestie, it's all-or-nothing: it dequeues exactly the requested number of objects, or none. No in-between, that's the vibe π
Parameters
rβ a pointer to the soring structure.objsβ a pointer to an array of objects to dequeue. Size of objects to enqueue must be the same value as theelem_sizeparameter used while creating the soring. Otherwise the results are undefined π«metaβ a pointer to an array of metadata values, one for each object to dequeue. Quick note: if you're not using object metadata values, this parameter can beNULL. The size of the elements in this array must be the same value as themeta_sizeparameter used while creating the soring. And if you created the soring withmeta_sizeequal to zero, thenmetashould beNULL. Otherwise the results are undefined, fr fr.numβ the number of objects to dequeue from the soring into theobjs.availableβ if non-NULL, returns the number of remaining soring entries after the dequeue has finished.
Returns
- Actual number of objects dequeued, either
0ornum.
__rte_experimental uint32_t rte_soring_dequeue_burst(struct rte_soring * r, void * objs, uint32_t num, uint32_t * available)
β οΈ EXPERIMENTAL: this API may change without prior notice.
Dequeue several objects from the soring β and this one is the chill version, she dequeues up to the requested number of objects πΈ
Parameters
rβ a pointer to the soring structure.objsβ a pointer to an array of objects to dequeue. Size of objects to enqueue must be the same value as theelem_sizeparameter used while creating the soring. Otherwise the results are undefined.numβ the number of objects to dequeue from the soring into theobjs.availableβ if non-NULL, returns the number of remaining soring entries after the dequeue has finished.
Returns
- Actual number of objects dequeued. (Could be fewer than
num, that's just her.)
__rte_experimental uint32_t rte_soring_dequeux_burst(struct rte_soring * r, void * objs, void * meta, uint32_t num, uint32_t * available)
β οΈ EXPERIMENTAL: this API may change without prior notice.
Dequeue several objects plus metadata from the soring, up to the requested number of objects π« it's giving "burst but make it fancy."
Parameters
rβ a pointer to the soring structure.objsβ a pointer to an array of objects to dequeue. Size of objects to enqueue must be the same value as theelem_sizeparameter used while creating the soring. Otherwise the results are undefined.metaβ a pointer to an array of metadata values for each object to dequeue. Note that if the user isn't using object metadata values, this parameter can beNULL. The size of the elements in this array must be the same value as themeta_sizeparameter used while creating the soring. If the user created the soring withmeta_sizeequal to zero, thenmetashould beNULL. Otherwise the results are undefined πnumβ the number of objects to dequeue from the soring into theobjs.availableβ if non-NULL, returns the number of remaining soring entries after the dequeue has finished.
Returns
- Actual number of objects dequeued.
__rte_experimental uint32_t rte_soring_acquire_bulk(struct rte_soring * r, void * objs, uint32_t stage, uint32_t num, uint32_t * ftoken, uint32_t * available)
β οΈ EXPERIMENTAL: this API may change without prior notice.
Acquire several objects from the soring for a given stage π― Again: exactly the requested number of objects, or none. Iconic commitment, honestly. π
Parameters
rβ a pointer to the soring structure.objsβ a pointer to an array of objects to acquire. Size of objects must be the same value as theelem_sizeparameter used while creating the soring. Otherwise the results are undefined.stageβ the stage to acquire objects for.numβ the number of objects to acquire.ftokenβ a pointer to the opaquetokenvalue used by therelease()op. You, bestie, have to store this value somewhere, and hand it back later torelease(). Don't lose it πavailableβ if non-NULL, returns the number of remaining soring entries for the given stage after the acquire has finished.
Returns
- Actual number of objects acquired, either
0ornum.
__rte_experimental uint32_t rte_soring_acquirx_bulk(struct rte_soring * r, void * objs, void * meta, uint32_t stage, uint32_t num, uint32_t * ftoken, uint32_t * available)
β οΈ EXPERIMENTAL: this API may change without prior notice.
Acquire several objects plus metadata from the soring for a given stage. Acquires exactly the requested number of objects, or none β the x in the name is the main character energy β¨
Parameters
rβ a pointer to the soring structure.objsβ a pointer to an array of objects to acquire. Size of objects must be the same value as theelem_sizeparameter used while creating the soring. Otherwise the results are undefined.metaβ a pointer to an array of metadata values for each acquired object. Note that if the user isn't using object metadata values, this parameter can beNULL. The size of the elements in this array must be the same value as themeta_sizeparameter used while creating the soring. If the user created the soring withmeta_sizeequal to zero, thenmetashould beNULL. Otherwise the results are undefined πstageβ the stage to acquire objects for.numβ the number of objects to acquire.ftokenβ a pointer to the opaquetokenvalue used by therelease()op. You have to store this value somewhere and later provide it to therelease(). Guard it with your life π«Άavailableβ if non-NULL, returns the number of remaining soring entries for the given stage after the acquire has finished.
Returns
- Actual number of objects acquired, either
0ornum.
__rte_experimental uint32_t rte_soring_acquire_burst(struct rte_soring * r, void * objs, uint32_t stage, uint32_t num, uint32_t * ftoken, uint32_t * available)
β οΈ EXPERIMENTAL: this API may change without prior notice.
Acquire several objects from the soring for a given stage β up to the requested number of objects this time π she's flexible like that.
Parameters
rβ a pointer to the soring structure.objsβ a pointer to an array of objects to acquire. Size of objects must be the same value as theelem_sizeparameter used while creating the soring. Otherwise the results are undefined.stageβ the stage to acquire objects for.numβ the number of objects to acquire.ftokenβ a pointer to the opaquetokenvalue used by therelease()op. The user has to store this value somewhere, and later provide it to therelease(). No storing it in your camera roll and forgetting, okay πavailableβ if non-NULL, returns the number of remaining soring entries for the given stage after the acquire has finished.
Returns
- Actual number of objects acquired.
__rte_experimental uint32_t rte_soring_acquirx_burst(struct rte_soring * r, void * objs, void * meta, uint32_t stage, uint32_t num, uint32_t * ftoken, uint32_t * available)
β οΈ EXPERIMENTAL: this API may change without prior notice.
Acquire several objects plus metadata from the soring for a given stage, up to the requested number of objects π the deluxe combo, the full set, the whole package.
Parameters
rβ a pointer to the soring structure.objsβ a pointer to an array of objects to acquire. Size of objects must be the same value as theelem_sizeparameter used while creating the soring. Otherwise the results are undefined.metaβ a pointer to an array of metadata values for each acquired object. Note that if the user isn't using object metadata values, this parameter can beNULL. The size of the elements in this array must be the same value as themeta_sizeparameter used while creating the soring. If the user created the soring withmeta_sizeequal to zero, thenmetashould beNULL. Otherwise the results are undefined πstageβ the stage to acquire objects for.numβ the number of objects to acquire.ftokenβ a pointer to the opaquetokenvalue used by therelease()op. The user has to store this value somewhere, and later provide it to therelease(). Treasure it. Put it in a little box. πavailableβ if non-NULL, returns the number of remaining soring entries for the given stage after the acquire has finished.
Returns
- Actual number of objects acquired.
__rte_experimental void rte_soring_release(struct rte_soring * r, const void * objs, uint32_t stage, uint32_t n, uint32_t ftoken)
β οΈ EXPERIMENTAL: this API may change without prior notice.
Release several objects for a given stage back to the soring π¦ Heads up though: this means these objects become available for the next stage or for dequeue. You're handing them back to the group chat, they're circulating again.
Parameters
rβ a pointer to the soring structure.objsβ a pointer to an array of objects to release. Note that unless the user needs to overwrite soring objects, this parameter can beNULL. Size of objects must be the same value as theelem_sizeparameter used while creating the soring. Otherwise the results are undefined.stageβ the current stage.nβ the number of objects to release. Has to be the same value as what was returned by theacquire()op. Matching values only, bestie, it's a duo costume situation π―ftokenβ the opaquetokenvalue obtained from theacquire()op.
__rte_experimental void rte_soring_releasx(struct rte_soring * r, const void * objs, const void * meta, uint32_t stage, uint32_t n, uint32_t ftoken)
β οΈ EXPERIMENTAL: this API may change without prior notice.
Release several objects plus metadata for a given stage back to the soring πΈ And yeah, same deal as before: this means these objects become available for the next stage or dequeue. She's back in circulation, periodt.
π Parameters π
okay bestie, here's the tea on every single argument this release op takes ββ¨ no skipping, we list them ALL:
rβ a pointer to the soring structure. that's it, that's the whole vibe π«Άobjsβ a pointer to an array of objects you wanna release. important note: unless you actually need to overwrite the soring objects, this parameter can beNULL. but the size of your objects has to be the exact same value as theelem_sizeparameter you used when you created the soring π if it isn't?? the results are undefined β like, no cap, undefined. we don't do that here πmetaβ a pointer to an array of metadata values, one for each object you're releasing. another note: if you're not using object metadata values at all, then this parameter can beNULL, easy. but the size of the elements in this array has to match themeta_sizeparameter you used when creating the soring β¨ and if you created the soring withmeta_sizeequal to zero, thenmetashould beNULL. otherwise the results are undefined β periodt, don't test it πstageβ the current stage. just... the stage π¦nβ the number of objects to release. this one has to be the same value as what theacquire()op returned. no creative liberties allowed, bestie πftokenβ the opaque'token'value you got from theacquire()op. opaque means don't peek inside it, just hand it back like a good girlie π₯
π Author π
generated automatically by Doxygen for DPDK from the source code. i did NOT hand-write that part, the robots handled it and honestly? they ate π€β¨
aaaaand that's a wrap on rte_soring.h(3) β sourced from DPDK, Version 25.11.3, and this whole glow-up was brought to you by the rte_soring.h(3) page itself πΈ go forth and sort, you absolute icon, i'm literally so proud of you πππ¦
π¦ where this page comes from
- ubuntu resolute: dpdk-doc 25.11.3-0ubuntu0.26.04.1 Β· BSD-3-Clause
- ubuntu stonking: dpdk-doc 25.11.3-1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms