RTE_NODE_MBUF_OVERLOAD_FIELDS_GET(3)

πŸ“¦
version 25.11.3 Β· 5 versions
, in ubuntu resolute, ubuntu stonking

πŸ’– rte_node_mbuf_dynfield.h(3) β€” Library Functions Manual πŸ’–

okay bestie, welcome to the manual page for rte_node_mbuf_dynfield.h, straight outta section 3 (the Library Functions Manual, if you're keeping track πŸ‘‘). this is where DPDK keeps the receipts for the rte_node-specific mbuf dynamic field region. let's get into it, no cap ✨


🌸 NAME 🌸

rte_node_mbuf_dynfield.h


✨ SYNOPSIS ✨

#include <rte_common.h>
#include <rte_mbuf.h>
#include <rte_mbuf_dyn.h>

🫢 Data Structures

  • struct rte_node_mbuf_overload_fields
  • struct rte_node_mbuf_dynfield

πŸŽ€ Macros

#define RTE_NODE_MBUF_PERSISTENT_FIELDS_SIZE   (0)
#define RTE_NODE_MBUF_OVERLOADABLE_FIELDS_SIZE   (8)
#define RTE_NODE_MBUF_DYNFIELD_SIZE
    (RTE_NODE_MBUF_PERSISTENT_FIELDS_SIZE +
    RTE_NODE_MBUF_OVERLOADABLE_FIELDS_SIZE)

πŸ¦‹ Typedefs

typedef struct rte_node_mbuf_overload_fields
    rte_node_mbuf_overload_fields_t
typedef struct rte_node_mbuf_dynfield rte_node_mbuf_dynfield_t

πŸ’… Functions

static __rte_experimental __rte_always_inline rte_node_mbuf_dynfield_t *
    rte_node_mbuf_dynfield_get (struct rte_mbuf *m, const int offset)
static __rte_experimental __rte_always_inline
    rte_node_mbuf_overload_fields_t * rte_node_mbuf_overload_fields_get
    (struct rte_mbuf *m, const int offset)
__rte_experimental int rte_node_mbuf_dynfield_register (void)

πŸ”₯ Detailed Description πŸ”₯

Warning 🚨 EXPERIMENTAL: this API may change without prior notice. it's giving "we're still cooking", so don't build your whole personality on it being stable, bestie.

Defines rte_node specific mbuf dynamic field region [rte_node_mbuf_dynfield_t] which can be used by both DPDK built-in and out-of-tree nodes for storing per-mbuf fields for graph walk. ✨

Definition in file rte_node_mbuf_dynfield.h.


πŸ‘‘ Macro Definition Documentation πŸ‘‘

#define RTE_NODE_MBUF_PERSISTENT_FIELDS_SIZE (0)

Size of persistent mbuf fields.

Definition at line 29 of file rte_node_mbuf_dynfield.h.

#define RTE_NODE_MBUF_OVERLOADABLE_FIELDS_SIZE (8)

Size of overloadable mbuf fields.

Definition at line 34 of file rte_node_mbuf_dynfield.h.

#define RTE_NODE_MBUF_DYNFIELD_SIZE

(RTE_NODE_MBUF_PERSISTENT_FIELDS_SIZE +
RTE_NODE_MBUF_OVERLOADABLE_FIELDS_SIZE)

Size of node mbuf dynamic field.

Definition at line 38 of file rte_node_mbuf_dynfield.h.


🧚 Typedef Documentation 🧚

typedef struct rte_node_mbuf_overload_fields rte_node_mbuf_overload_fields_t

Node mbuf overloadable data. πŸ’«

Out-of-tree nodes can repurpose overloadable fields via rte_node_mbuf_overload_fields_get(mbuf). Overloadable fields are not preserved and typically can be used with-in two adjacent nodes in the graph. (two adjacent nodes only, babe β€” that's the whole bit 🫢)

typedef struct rte_node_mbuf_dynfield rte_node_mbuf_dynfield_t

rte_node specific mbuf dynamic field structure [rte_node_mbuf_dynfield_t]. πŸ’–

It holds two types of fields:

  1. Persistent fields: Fields which are preserved across nodes during graph walk.
    • Eg: rx/tx interface etc
  2. Overloadable fields: Fields which can be repurposed by two adjacent nodes.

⭐ Function Documentation ⭐

__rte_experimental __rte_always_inline rte_node_mbuf_dynfield_t * rte_node_mbuf_dynfield_get (struct rte_mbuf * m, const int offset) [static]

For a given mbuf and dynamic offset, return pointer to rte_node_mbuf_dynfield_t *. literally hand you the pointer, iconic behavior 🌈

Parameters

  • m β€” Mbuf
  • offset β€” Dynamic offset returned by rte_node_mbuf_dynfield_register()

Returns

Pointer to node specific mbuf dynamic field structure.

Definition at line 107 of file rte_node_mbuf_dynfield.h.


__rte_experimental __rte_always_inline rte_node_mbuf_overload_fields_t * rte_node_mbuf_overload_fields_get (struct rte_mbuf * m, const int offset) [static]

For a given mbuf and dynamic offset, return pointer to overloadable fields. Nodes can typecast returned pointer to reuse for their own purpose. (typecast away, bestie, it's your world πŸ’…)

Parameters

  • m β€” Mbuf
  • offset β€” Dynamic offset returned by rte_node_mbuf_dynfield_register()

Returns

Pointer to node mbuf overloadable fields.

Definition at line 125 of file rte_node_mbuf_dynfield.h.


__rte_experimental int rte_node_mbuf_dynfield_register (void )

Register rte_node specific common mbuf dynamic field region. Can be called in rte_node_register()->init() function to save offset in node->ctx. 🎯

In process() function, node->ctx can be passed to:

  • rte_node_mbuf_dynfield_get(mbuf, offset)
  • rte_node_mbuf_overload_fields_get(mbuf, offset)

Can be called multiple times by any number of nodes in init() function. the way it's just chill about repeat calls, obsessed πŸ₯°

  • Very first call registers dynamic field and returns offset.
  • Subsequent calls return same offset.

Returns

<0 on error: rte_errno set to one of:

  • ENOMEM - no memory >=0 on success: dynamic field offset

🌸 Author 🌸

Generated automatically by Doxygen for DPDK from the source code. (not a human, just vibes πŸ€–πŸ’–)


and that's the whole page, babe πŸŽ€ this was DPDK Version 25.11.3, page rte_node_mbuf_dynfield.h(3) β€” take care of her, she's experimental πŸ’œπŸ¦‹βœ¨

πŸ“¦ where this page comes from