rte_graph_...c_worker.h(3)

๐Ÿ“ฆ
version 25.11.3 ยท 5 versions
, in ubuntu resolute, ubuntu stonking

โœจ rte_graph_feature_arc_worker.h โ€” Library Functions Manual, section 3 โœจ

okay bestie sit DOWN because we're doing the header file of header files ๐Ÿ’– this is rte_graph_feature_arc_worker.h, it lives in the Library Functions Manual (that's the manual name, section 3, iykyk), and it is entirely about the fast path of graph feature arcs. no cap.


๐ŸŒธ NAME ๐ŸŒธ

rte_graph_feature_arc_worker.h โ€” yes that's the whole name. iconic, brief, unbothered.


๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

First things first, the includes, literally copy-paste these:

#include <stddef.h>
#include <rte_graph_feature_arc.h>
#include <rte_bitops.h>
#include <rte_mbuf.h>
#include <rte_mbuf_dyn.h>

๐Ÿ‘‘ Data Structures

the squad of structs showing up in this file:

  • struct rte_graph_feature_arc
  • struct rte_feature_arc_main
  • struct rte_graph_feature_data
  • struct rte_graph_feature_arc_mbuf_dynfields

๐ŸŽ€ Macros

the four macros, right there in the synopsis:

  • #define RTE_GRAPH_FEATURE_ARC_DYNFIELD_NAME โ†’ '__rte_graph_feature_arc_mbuf_dynfield'
  • #define RTE_GRAPH_FEATURE_DATA_SIZE_LOG2 3
  • #define RTE_GRAPH_FEATURE_DATA_NUM_PER_FEATURE(arc)
  • #define RTE_GRAPH_FEATURE_TO_FEATURE_DATA(arc, feature, index)

๐Ÿ’œ Typedefs

just the one, but she's important:

  • typedef struct rte_feature_arc_main rte_graph_feature_arc_main_t

๐Ÿ’… Functions

every single one of these, exactly as declared, no edits, no shortcuts, we don't do that here:

static __rte_experimental __rte_always_inline struct
    rte_graph_feature_arc_mbuf_dynfields *
    rte_graph_feature_arc_mbuf_dynfields_get (struct rte_mbuf *mbuf,
    const int dyn_offset)
static __rte_experimental __rte_always_inline int
    rte_graph_feature_is_valid (rte_graph_feature_t feature)
static __rte_experimental __rte_always_inline int
    rte_graph_feature_data_is_valid (rte_graph_feature_data_t
    feature_data)
static __rte_experimental __rte_always_inline struct
    rte_graph_feature_arc * rte_graph_feature_arc_get
    (rte_graph_feature_arc_t arc)
static __rte_experimental __rte_always_inline struct
    rte_graph_feature_data * __rte_graph_feature_data_get (struct
    rte_graph_feature_arc *arc, rte_graph_feature_data_t fdata)
static __rte_experimental __rte_always_inline rte_edge_t
    __rte_graph_feature_data_edge_get (struct rte_graph_feature_data
    *fdata)
static __rte_experimental __rte_always_inline uint16_t
    __rte_graph_feature_data_app_cookie_get (struct
    rte_graph_feature_data *fdata)
static __rte_experimental __rte_always_inline rte_graph_feature_data_t
    __rte_graph_feature_data_next_feature_get (struct
    rte_graph_feature_data *fdata)
static __rte_experimental __rte_always_inline uint16_t
    rte_graph_feature_data_app_cookie_get (struct rte_graph_feature_arc
    *arc, rte_graph_feature_data_t fdata)
static __rte_experimental __rte_always_inline int
    rte_graph_feature_data_next_feature_get (struct
    rte_graph_feature_arc *arc, rte_graph_feature_data_t *fdata,
    rte_edge_t *next_edge)
static __rte_experimental __rte_always_inline struct
    rte_graph_feature_data * rte_graph_feature_data_get (struct
    rte_graph_feature_arc *arc, rte_graph_feature_data_t fdata)
static __rte_experimental __rte_always_inline int
    rte_graph_feature_data_first_feature_get (struct
    rte_graph_feature_arc *arc, uint32_t index, rte_graph_feature_data_t
    *fdata, rte_edge_t *edge)
static __rte_experimental __rte_always_inline uint64_t
    rte_graph_feature_arc_is_any_feature_enabled (struct
    rte_graph_feature_arc *arc)
static __rte_experimental __rte_always_inline void
    rte_graph_feature_arc_prefetch (struct rte_graph_feature_arc *arc)
static __rte_experimental __rte_always_inline void
    rte_graph_feature_arc_feature_data_prefetch (struct
    rte_graph_feature_arc *arc, rte_graph_feature_data_t fdata)

โญ Variables

one glorious global, that's it:

  • rte_graph_feature_arc_main_t * __rte_graph_feature_arc_main

๐ŸŒˆ Detailed Description ๐ŸŒˆ

โš ๏ธ Warning โ€” EXPERIMENTAL: every single function in this file can be changed or removed without prior notice. fr fr. do not get attached, she is โœจunstableโœจ and that is on purpose.

so basically: this is the Fast path Graph feature arc API ๐Ÿ’ซ

Definition in file rte_graph_feature_arc_worker.h.


๐Ÿ’– Macro Definition Documentation ๐Ÿ’–

#define RTE_GRAPH_FEATURE_ARC_DYNFIELD_NAME

'__rte_graph_feature_arc_mbuf_dynfield'

okay so this one is the name of the dynamic mbuf field offset that gets registered over in rte_graph_feature_arc_init() ๐Ÿ‘€ so when you see that dynfield name floating around in your mbufs, you know exactly who put it there.

Definition at line 262 of file rte_graph_feature_arc_worker.h.


#define RTE_GRAPH_FEATURE_DATA_SIZE_LOG2 3

literally just log2(sizeof (struct rte_graph_feature_data)) โ€” the log squared business for sizing, nothing scary, it's giving "trust the math" ๐Ÿงฎโœจ

Definition at line 265 of file rte_graph_feature_arc_worker.h.


#define RTE_GRAPH_FEATURE_DATA_NUM_PER_FEATURE( arc)

Value:

(arc->feature_size >> RTE_GRAPH_FEATURE_DATA_SIZE_LOG2)

this is the number of struct rte_graph_feature_data per feature ๐Ÿ’– like how many feature-data slots each feature gets to claim. divide by shifting, slay.

Definition at line 268 of file rte_graph_feature_arc_worker.h.


#define RTE_GRAPH_FEATURE_TO_FEATURE_DATA( arc, feature, index)

Value:

((rte_graph_feature_data_t)                 \
 ((RTE_GRAPH_FEATURE_DATA_NUM_PER_FEATURE(arc) * (feature)) + (index)))

this is the glow-up conversion: get a rte_graph_feature_data_t from a rte_graph_feature_t โœจ you hand it the arc, the feature and the index, and it hands you back the feature-data. main character energy honestly.

Definition at line 272 of file rte_graph_feature_arc_worker.h.


๐Ÿซถ Typedef Documentation ๐Ÿซถ

typedef struct rte_feature_arc_main rte_graph_feature_arc_main_t

Feature arc main object ๐Ÿ‘‘

she holds all feature arcs created by application โ€” every single one, no feature arc left behind, that's the vibe.


๐Ÿ’ซ FUNCTION DOCUMENTATION ๐Ÿ’ซ


๐ŸŒธ rte_graph_feature_arc_mbuf_dynfields_get

__rte_experimental __rte_always_inline struct
    rte_graph_feature_arc_mbuf_dynfields *
    rte_graph_feature_arc_mbuf_dynfields_get (struct rte_mbuf * mbuf, const
    int dyn_offset) [static]

okay bestie, this one gets you the dynfield offset for the feature-arc-specific fields living inside the mbuf ๐Ÿ”ฅ

So the feature arc mbuf dynamic field is separate so that it can use mbuf->dynfield2 instead of dynfield1. not me being all about that dynfield2 life ๐Ÿ’…

This arc-specific dynamic offset gets registered as part of rte_graph_feature_arc_init() and then copied into every arc for fast path access. the whole point? it stops nodes from having to maintain a dynamic offset themselves for the feature arc, and if we're lucky the field gets allocated from mbuf->dynfield2. if we're not lucky, then every node has to maintain at least two dynamic offsets in the fast path ๐Ÿ˜ญ

Parameters

  • mbuf โ€” pointer to mbuf
  • dyn_offset โ€” retrieved from arc->mbuf_dyn_offset

Returns

  • NULL โ€” on failure
  • Non-NULL pointer โ€” on success โœจ

Defined at line 307 of file rte_graph_feature_arc_worker.h.


๐ŸŒธ rte_graph_feature_is_valid

__rte_experimental __rte_always_inline int rte_graph_feature_is_valid
    (rte_graph_feature_t feature) [static]

The API that tells you whether a feature is valid or not โ€” the vibe check, basically ๐Ÿฆ‹

Parameters

  • feature โ€” rte_graph_feature_t

Returns

  • 1 โ€” if feature is valid
  • 0 โ€” if feature is invalid

Defined at line 326 of file rte_graph_feature_arc_worker.h.


๐ŸŒธ rte_graph_feature_data_is_valid

__rte_experimental __rte_always_inline int rte_graph_feature_data_is_valid
    (rte_graph_feature_data_t feature_data) [static]

Same energy, but for feature data this time ๐Ÿซถ

Parameters

  • feature_data โ€” rte_graph_feature_data_t

Returns

  • 1 โ€” if feature data is valid
  • 0 โ€” if feature data is invalid

Defined at line 343 of file rte_graph_feature_arc_worker.h.


๐ŸŒธ rte_graph_feature_arc_get

__rte_experimental __rte_always_inline struct rte_graph_feature_arc *
    rte_graph_feature_arc_get (rte_graph_feature_arc_t arc) [static]

Grab yourself a pointer to the feature arc object from an rte_graph_feature_arc_t ๐Ÿ’–

Parameters

  • arc โ€” feature arc

Returns

  • NULL โ€” on failure
  • Non-NULL pointer โ€” on success

Defined at line 360 of file rte_graph_feature_arc_worker.h.


๐ŸŒธ __rte_graph_feature_data_get

__rte_experimental __rte_always_inline struct rte_graph_feature_data *
    __rte_graph_feature_data_get (struct rte_graph_feature_arc * arc,
    rte_graph_feature_data_t fdata) [static]

Get the rte_graph_feature_t out of a feature arc object โ€” and babe, no checks at all, this is the raw unhinged version ๐Ÿ’€ (that leading double underscore in the name is your lil warning label, iykyk)

Parameters

  • arc โ€” feature arc
  • fdata โ€” feature data object

Returns

  • Pointer to feature data object

Defined at line 387 of file rte_graph_feature_arc_worker.h.


๐ŸŒธ __rte_graph_feature_data_edge_get

__rte_experimental __rte_always_inline rte_edge_t
    __rte_graph_feature_data_edge_get (struct rte_graph_feature_data *
    fdata) [static]

Get the next edge from a feature data pointer. once again: without any check ๐Ÿ™ˆ

Parameters

  • fdata โ€” feature data object

Returns

  • next edge

Defined at line 405 of file rte_graph_feature_arc_worker.h.


__rte_experimental __rte_always_inline uint16_t
    __rte_graph_feature_data_app_cookie_get (struct rte_graph_feature_data *
    fdata) [static]

Get the app_cookie straight off the feature data pointer, and yep โ€” without any check, the theme continues ๐Ÿ˜Œ

Parameters

  • fdata โ€” feature data object

Returns

  • app_cookie set by the caller in rte_graph_feature_enable() API

Defined at line 421 of file rte_graph_feature_arc_worker.h.


๐ŸŒธ __rte_graph_feature_data_next_feature_get

__rte_experimental __rte_always_inline rte_graph_feature_data_t
    __rte_graph_feature_data_next_feature_get (struct rte_graph_feature_data
    * fdata) [static]

Pull next_enabled_feature_data from a pointer to feature data. without any check, bestie, we live dangerously here ๐Ÿ’…

Parameters

  • fdata โ€” feature data object

Returns

  • next enabled feature data from this feature data

Defined at line 437 of file rte_graph_feature_arc_worker.h.


__rte_experimental __rte_always_inline uint16_t
    rte_graph_feature_data_app_cookie_get (struct rte_graph_feature_arc *
    arc, rte_graph_feature_data_t fdata) [static]

The polite, well-behaved twin of the earlier one: get app_cookie from a feature data object, but this time with checks ๐ŸŽ€

Parameters

  • arc โ€” feature arc
  • fdata โ€” feature data object

Returns

  • app_cookie set by the caller in rte_graph_feature_enable() API

Defined at line 456 of file rte_graph_feature_arc_worker.h.


๐ŸŒธ rte_graph_feature_data_next_feature_get

__rte_experimental __rte_always_inline int
    rte_graph_feature_data_next_feature_get (struct rte_graph_feature_arc *
    arc, rte_graph_feature_data_t * fdata, rte_edge_t * next_edge) [static]

Get next_enabled_feature_data from the current feature data object, and this one does check for you ๐Ÿซถ

Parameters

  • arc โ€” feature arc
  • fdata โ€” pointer to feature data object
  • next_edge โ€” the next_edge from the current feature to the next enabled feature

Returns

  • 1 โ€” if next feature enabled on index
  • 0 โ€” if no feature is enabled on index

Defined at line 483 of file rte_graph_feature_arc_worker.h.


๐ŸŒธ rte_graph_feature_data_get

__rte_experimental __rte_always_inline struct rte_graph_feature_data *
    rte_graph_feature_data_get (struct rte_graph_feature_arc * arc,
    rte_graph_feature_data_t fdata) [static]

Get the struct rte_graph_feature_data from an rte_graph_feature_dat_t ๐Ÿ’œ

Parameters

  • arc โ€” feature arc
  • fdata โ€” feature data object

Returns

  • NULL โ€” on failure
  • Non-NULL pointer โ€” on success

Defined at line 511 of file rte_graph_feature_arc_worker.h.


๐ŸŒธ rte_graph_feature_data_first_feature_get

__rte_experimental __rte_always_inline int
    rte_graph_feature_data_first_feature_get (struct rte_graph_feature_arc *
    arc, uint32_t index, rte_graph_feature_data_t * fdata, rte_edge_t *
    edge) [static]

Get the feature data that corresponds to the first enabled feature on a given index โญ

Parameters

  • arc โ€” feature arc
  • index โ€” interface index
  • fdata โ€” feature data object
  • edge โ€” rte_edge object

Returns

  • 1 โ€” if any feature enabled on index, and it returns the corresponding valid feature data
  • 0 โ€” if no feature is enabled on index

Defined at line 539 of file rte_graph_feature_arc_worker.h.


๐ŸŒธ rte_graph_feature_arc_is_any_feature_enabled

__rte_experimental __rte_always_inline uint64_t
    rte_graph_feature_arc_is_any_feature_enabled (struct
    rte_graph_feature_arc * arc) [static]

Fast path API that checks whether any feature is enabled on a feature arc. typically you'd call this from arc->start_node's process function, main character energy ๐ŸŒˆ

Parameters

  • arc โ€” feature arc object

Returns

  • 0 โ€” if no feature is enabled
  • Non-zero โ€” a bitmask of the features that are enabled โœจ

Defined at line 580 of file rte_graph_feature_arc_worker.h.


๐ŸŒธ rte_graph_feature_arc_prefetch

__rte_experimental __rte_always_inline void rte_graph_feature_arc_prefetch
    (struct rte_graph_feature_arc * arc) [static]

Prefetch the feature arc fast path cache line so it's already warm when you need it โ€” manifesting that cache hit for you ๐Ÿงš

Parameters

  • arc โ€” RTE_GRAPH feature arc object

Defined at line 597 of file rte_graph_feature_arc_worker.h.


๐ŸŒธ rte_graph_feature_arc_feature_data_prefetch

__rte_experimental __rte_always_inline void
    rte_graph_feature_arc_feature_data_prefetch (struct
    rte_graph_feature_arc * arc, rte_graph_feature_data_t fdata) [static]

Same deal but for the feature-data-related fast path cache line ๐Ÿ“

Parameters

  • arc โ€” RTE_GRAPH feature arc object
  • fdata โ€” pointer to feature data object

Defined at line 612 of file rte_graph_feature_arc_worker.h.


๐Ÿ“ฆ VARIABLE DOCUMENTATION ๐Ÿ“ฆ

๐Ÿฆ‹ rte_graph_feature_arc_main_t* __rte_graph_feature_arc_main [extern]

Just your friendly neighbourhood extern variable ๐Ÿ‘‘ โ€” it's declared extern, so the actual storage lives somewhere else, as extern variables do.


โœ๏ธ AUTHOR โœ๏ธ

Generated automatically by Doxygen for DPDK from the source code. so technically the real author is a robot, and honestly? slay, the robot ate ๐Ÿค–๐Ÿ’…


and that's a wrap on part 2 bestie!! ๐ŸŽ€ this whole page was served fresh from the DPDK source code, Version 25.11.3, in the rte_graph_...c_worker.h(3) manual โ€” go forth and enable your features, ily, mwah ๐Ÿ’–โœจ


๐Ÿ“ฆ where this page comes from