RTE_NODE_NEXT_STREAM_GET(3)
π¦ rte_graph_worker_common.h π¦
okay bestie, buckle up π this one comes straight out of the Library Functions Manual, and it's the header that lets your worker threads walk a graph while your nodes go around creating, processing, enqueuing and moving whole streams of objects to the next nodes. it's giving graph-walker energy, no cap. π
β¨ NAME β¨
rte_graph_worker_common.h β literally what it says on the tin, the common worker header. π
πΈ SYNOPSIS πΈ
you gotta pull all of these in, bestie, no skipping π:
#include <assert.h>
#include <stdalign.h>
#include <stddef.h>
#include <rte_common.h>
#include <rte_cycles.h>
#include <rte_prefetch.h>
#include <rte_memcpy.h>
#include <rte_memory.h>
#include 'rte_graph.h'
π Data Structures π
struct rte_node::__rte_cache_alignedβ cache-aligned and thriving, as she should be β¨
π§ Macros π§
#define RTE_GRAPH_MODEL_RTC 0
#define RTE_GRAPH_MODEL_MCORE_DISPATCH 1
#define RTE_GRAPH_MODEL_DEFAULT RTE_GRAPH_MODEL_RTC
π Functions π
static void rte_node_enqueue (struct rte_graph *graph, struct rte_node *node, rte_edge_t next, void **objs, uint16_t nb_objs)static void rte_node_enqueue_x1 (struct rte_graph *graph, struct rte_node *node, rte_edge_t next, void *obj)static void rte_node_enqueue_x2 (struct rte_graph *graph, struct rte_node *node, rte_edge_t next, void *obj0, void *obj1)static void rte_node_enqueue_x4 (struct rte_graph *graph, struct rte_node *node, rte_edge_t next, void *obj0, void *obj1, void *obj2, void *obj3)static void rte_node_enqueue_next (struct rte_graph *graph, struct rte_node *node, rte_edge_t *nexts, void **objs, uint16_t nb_objs)static void ** rte_node_next_stream_get (struct rte_graph *graph, struct rte_node *node, rte_edge_t next, uint16_t nb_objs)static void rte_node_next_stream_put (struct rte_graph *graph, struct rte_node *node, rte_edge_t next, uint16_t idx)static void rte_node_next_stream_move (struct rte_graph *graph, struct rte_node *src, rte_edge_t next)bool rte_graph_model_is_valid (uint8_t model)int rte_graph_worker_model_set (uint8_t model)uint8_t rte_graph_worker_model_get (struct rte_graph *graph)static __rte_always_inline uint8_t rte_graph_worker_model_no_check_get (struct rte_graph *graph)static __rte_experimental void rte_node_xstat_increment (struct rte_node *node, uint16_t xstat_id, uint64_t value)
π Detailed Description π
so like, this API is the whole vibe: it lets a worker thread walk over a graph, and it lets nodes create, process, enqueue and move streams of objects on over to the next nodes. that's it, that's the assignment, and she ate. π₯
Definition in file rte_graph_worker_common.h.
π Macro Definition Documentation π
#define RTE_GRAPH_MODEL_RTC 0
Graph worker models β the Run-To-Completion model. and guess what bestie, it's the default model. main character behavior fr fr π
Definition at line 33 of file rte_graph_worker_common.h.
#define RTE_GRAPH_MODEL_MCORE_DISPATCH 1
Dispatch model, here to support cross-core dispatching within core affinity. π
Definition at line 34 of file rte_graph_worker_common.h.
#define RTE_GRAPH_MODEL_DEFAULT RTE_GRAPH_MODEL_RTC
the default graph model. iconic, we love a preset. β¨
Definition at line 36 of file rte_graph_worker_common.h.
π«Ά Function Documentation π«Ά
void rte_node_enqueue (struct rte_graph * graph, struct rte_node * node, rte_edge_t next, void ** objs, uint16_t nb_objs) [inline], [static]
Enqueue the objs to the next node for further processing, and set the next node to pending state in the circular buffer. π
Parameters
- graph β Graph pointer returned from
rte_graph_lookup(). - node β Current node pointer.
- next β Relative next node index to enqueue objs.
- objs β Objs to enqueue.
- nb_objs β Number of objs to enqueue.
Definition at line 310 of file rte_graph_worker_common.h.
void rte_node_enqueue_x1 (struct rte_graph * graph, struct rte_node * node, rte_edge_t next, void * obj) [inline], [static]
Enqueue only one obj to the next node for further processing, and set the next node to pending state in the circular buffer. one singular little guy, slay π
Parameters
- graph β Graph pointer returned from
rte_graph_lookup(). - node β Current node pointer.
- next β Relative next node index to enqueue objs.
- obj β Obj to enqueue.
Definition at line 336 of file rte_graph_worker_common.h.
void rte_node_enqueue_x2 (struct rte_graph * graph, struct rte_node * node, rte_edge_t next, void * obj0, void * obj1) [inline], [static]
Enqueue only two objs to the next node for further processing, and set the next node to pending state in the circular buffer. Same as rte_node_enqueue_x1 but enqueue two objs. two is a crowd and she's handling both π
Parameters
- graph β Graph pointer returned from
rte_graph_lookup(). - node β Current node pointer.
- next β Relative next node index to enqueue objs.
- obj0 β Obj to enqueue.
- obj1 β Obj to enqueue.
Definition at line 365 of file rte_graph_worker_common.h.
void rte_node_enqueue_x4 (struct rte_graph * graph, struct rte_node * node, rte_edge_t next, void * obj0, void * obj1, void * obj2, void * obj3) [inline], [static]
Enqueue only four objs to the next node for further processing, and set the next node to pending state in the circular buffer. Same as rte_node_enqueue_x1 but enqueue four objs. four whole objects?? she's built different π¦
Parameters
- graph β Graph pointer returned from
rte_graph_lookup(). - node β Current node pointer.
- next β Relative next node index to enqueue objs.
- obj0 β 1st obj to enqueue.
- obj1 β 2nd obj to enqueue.
- obj2 β 3rd obj to enqueue.
- obj3 β 4th obj to enqueue.
Definition at line 399 of file rte_graph_worker_common.h.
void rte_node_enqueue_next (struct rte_graph * graph, struct rte_node * node, rte_edge_t * nexts, void ** objs, uint16_t nb_objs) [inline], [static]
Enqueue objs to multiple next nodes for further processing, and set those next nodes to pending state in the circular buffer. plot twist: objs[i] will be enqueued to nexts[i]. π«
Parameters
- graph β Graph pointer returned from
rte_graph_lookup(). - node β Current node pointer.
- nexts β List of relative next node indices to enqueue objs.
- objs β List of objs to enqueue.
- nb_objs β Number of objs to enqueue.
Definition at line 432 of file rte_graph_worker_common.h.
void ** rte_node_next_stream_get (struct rte_graph * graph, struct rte_node * node, rte_edge_t next, uint16_t nb_objs) [inline], [static]
Get the stream of the next node so you can enqueue the objs into it. once you're done updating the objs, you have to call rte_node_next_stream_put to put the next node into pending state. don't forget, bestie, that's the whole deal π
Parameters
- graph β Graph pointer returned from
rte_graph_lookup(). - node β Current node pointer.
- next β Relative next node index to get stream.
- nb_objs β Requested free size of the next stream.
Returns
Valid next stream on success.
See also
rte_node_next_stream_put().
Definition at line 461 of file rte_graph_worker_common.h.
void rte_node_next_stream_put (struct rte_graph * graph, struct rte_node * node, rte_edge_t next, uint16_t idx) [inline], [static]
Put the next stream into pending state in the circular buffer for further processing. Should be invoked after rte_node_next_stream_get(). it's giving cleanup era π§Ήβ¨
Parameters
- graph β Graph pointer returned from
rte_graph_lookup(). - node β Current node pointer.
- next β Relative next node index..
- idx β Number of objs updated in the stream after getting the stream using
rte_node_next_stream_get.
See also
rte_node_next_stream_get().
Definition at line 491 of file rte_graph_worker_common.h.
void rte_node_next_stream_move (struct rte_graph * graph, struct rte_node * src, rte_edge_t next) [inline], [static]
Home run scenario π π₯ β Enqueue all the objs of the current node to the next node in an optimized way, by swapping the streams of both nodes. Performs good when the next node is already not in pending state. If the next node is already in pending state, then normal enqueue will be used. iykyk.
Parameters
- graph β Graph pointer returned from
rte_graph_lookup(). - src β Current node pointer.
- next β Relative next node index.
Definition at line 519 of file rte_graph_worker_common.h.
bool rte_graph_model_is_valid (uint8_t model)
Test the validity of the model. vibe check, but for graph models π
Parameters
- model β Model to check.
Returns
True if graph model is valid, false otherwise.
int rte_graph_worker_model_set (uint8_t model)
Note π¨ This function does not perform any locking, and is only safe to call before graph running. It will set all graphs the same model.
Parameters
- model β Name of the graph worker model.
Returns
0 on success, -1 otherwise.
uint8_t rte_graph_worker_model_get (struct rte_graph * graph)
Get the graph worker model. π
Note π¨ All graphs will use the same model, and this function will get the model from the first one. Used for slow path.
Parameters
- graph β Graph pointer.
Returns
Graph worker model on success.
__rte_always_inline uint8_t rte_graph_worker_model_no_check_get (struct rte_graph * graph) [static]
Get the graph worker model without check. no thoughts, head empty, just vibes π«Ά
Note π¨ All graphs will use the same model, and this function will get the model from the first one. Used for fast path.
Parameters
- graph β Graph pointer.
Returns
Graph worker model on success.
Definition at line 590 of file rte_graph_worker_common.h.
__rte_experimental void rte_node_xstat_increment (struct rte_node * node, uint16_t xstat_id, uint64_t value) [inline], [static]
Increment the Node xstat count. β¨
Increment the count of an xstat for a given node. little number goes up, we cheer π
Parameters
- node β Pointer to the node.
- xstat_id β xstat ID.
- value β Value to increment.
Definition at line 609 of file rte_graph_worker_common.h.
π Author π
Generated automatically by Doxygen for DPDK from the source code. yes bestie, a robot wrote the bones of this and i just gave it the glow-up π
and that's the whole page, bestie π mwah! this came to you courtesy of DPDK, Version 25.11.3, from rte_graph_...er_common.h(3) in the Library Functions Manual. go walk that graph, you gorgeous thing ππ
π¦ 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