.TH "rte_node_mbuf_dynfield.h" 3 "Version 25.11.3" "DPDK" \" -*- nroff -*-
.ad l
.nh
.SH NAME
rte_node_mbuf_dynfield.h
.SH SYNOPSIS
.br
.PP
\fR#include <rte_common\&.h>\fP
.br
\fR#include <rte_mbuf\&.h>\fP
.br
\fR#include <rte_mbuf_dyn\&.h>\fP
.br

.SS "Data Structures"

.in +1c
.ti -1c
.RI "struct \fBrte_node_mbuf_overload_fields\fP"
.br
.ti -1c
.RI "struct \fBrte_node_mbuf_dynfield\fP"
.br
.in -1c
.SS "Macros"

.in +1c
.ti -1c
.RI "#define \fBRTE_NODE_MBUF_PERSISTENT_FIELDS_SIZE\fP   (0)"
.br
.ti -1c
.RI "#define \fBRTE_NODE_MBUF_OVERLOADABLE_FIELDS_SIZE\fP   (8)"
.br
.ti -1c
.RI "#define \fBRTE_NODE_MBUF_DYNFIELD_SIZE\fP       (\fBRTE_NODE_MBUF_PERSISTENT_FIELDS_SIZE\fP + \fBRTE_NODE_MBUF_OVERLOADABLE_FIELDS_SIZE\fP)"
.br
.in -1c
.SS "Typedefs"

.in +1c
.ti -1c
.RI "\fBtypedef\fP struct \fBrte_node_mbuf_overload_fields\fP \fBrte_node_mbuf_overload_fields_t\fP"
.br
.ti -1c
.RI "\fBtypedef\fP struct \fBrte_node_mbuf_dynfield\fP \fBrte_node_mbuf_dynfield_t\fP"
.br
.in -1c
.SS "Functions"

.in +1c
.ti -1c
.RI "static __rte_experimental \fB__rte_always_inline\fP \fBrte_node_mbuf_dynfield_t\fP * \fBrte_node_mbuf_dynfield_get\fP (struct \fBrte_mbuf\fP *m, const int offset)"
.br
.ti -1c
.RI "static __rte_experimental \fB__rte_always_inline\fP \fBrte_node_mbuf_overload_fields_t\fP * \fBrte_node_mbuf_overload_fields_get\fP (struct \fBrte_mbuf\fP *m, const int offset)"
.br
.ti -1c
.RI "__rte_experimental int \fBrte_node_mbuf_dynfield_register\fP (void)"
.br
.in -1c
.SH "Detailed Description"
.PP 

.PP
\fBWarning\fP
.RS 4
\fBEXPERIMENTAL:\fP this API may change without prior notice\&.
.RE
.PP
Defines rte_node specific mbuf dynamic field region [\fBrte_node_mbuf_dynfield_t\fP] which can be used by both DPDK built-in and out-of-tree nodes for storing per-mbuf fields for graph walk\&. 
.PP
Definition in file \fBrte_node_mbuf_dynfield\&.h\fP\&.
.SH "Macro Definition Documentation"
.PP 
.SS "#define RTE_NODE_MBUF_PERSISTENT_FIELDS_SIZE   (0)"
Size of persistent mbuf fields 
.PP
Definition at line \fB29\fP of file \fBrte_node_mbuf_dynfield\&.h\fP\&.
.SS "#define RTE_NODE_MBUF_OVERLOADABLE_FIELDS_SIZE   (8)"
Size of overloadable mbuf fields 
.PP
Definition at line \fB34\fP of file \fBrte_node_mbuf_dynfield\&.h\fP\&.
.SS "#define RTE_NODE_MBUF_DYNFIELD_SIZE       (\fBRTE_NODE_MBUF_PERSISTENT_FIELDS_SIZE\fP + \fBRTE_NODE_MBUF_OVERLOADABLE_FIELDS_SIZE\fP)"
Size of node mbuf dynamic field 
.PP
Definition at line \fB38\fP of file \fBrte_node_mbuf_dynfield\&.h\fP\&.
.SH "Typedef Documentation"
.PP 
.SS "\fBtypedef\fP struct \fBrte_node_mbuf_overload_fields\fP \fBrte_node_mbuf_overload_fields_t\fP"
Node mbuf overloadable data\&.

.PP
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\&. 
.SS "\fBtypedef\fP struct \fBrte_node_mbuf_dynfield\fP \fBrte_node_mbuf_dynfield_t\fP"
rte_node specific mbuf dynamic field structure [\fBrte_node_mbuf_dynfield_t\fP]

.PP
It holds two types of fields:
.IP "1." 4
Persistent fields: Fields which are preserved across nodes during graph walk\&.
.IP "  \(bu" 4
Eg: rx/tx interface etc
.PP

.IP "2." 4
Overloadable fields: Fields which can be repurposed by two adjacent nodes\&. 
.PP

.SH "Function Documentation"
.PP 
.SS "__rte_experimental \fB__rte_always_inline\fP \fBrte_node_mbuf_dynfield_t\fP * rte_node_mbuf_dynfield_get (struct \fBrte_mbuf\fP * m, const int offset)\fR [static]\fP"
For a given mbuf and dynamic offset, return pointer to \fBrte_node_mbuf_dynfield_t\fP *

.PP
\fBParameters\fP
.RS 4
\fIm\fP Mbuf 
.br
\fIoffset\fP Dynamic offset returned by \fBrte_node_mbuf_dynfield_register()\fP 
.RE
.PP
\fBReturns\fP
.RS 4
Pointer to node specific mbuf dynamic field structure 
.RE
.PP

.PP
Definition at line \fB107\fP of file \fBrte_node_mbuf_dynfield\&.h\fP\&.
.SS "__rte_experimental \fB__rte_always_inline\fP \fBrte_node_mbuf_overload_fields_t\fP * rte_node_mbuf_overload_fields_get (struct \fBrte_mbuf\fP * m, const int offset)\fR [static]\fP"
For a given mbuf and dynamic offset, return pointer to overloadable fields\&. Nodes can typecast returned pointer to reuse for their own purpose\&.

.PP
\fBParameters\fP
.RS 4
\fIm\fP Mbuf 
.br
\fIoffset\fP Dynamic offset returned by \fBrte_node_mbuf_dynfield_register()\fP 
.RE
.PP
\fBReturns\fP
.RS 4
Pointer to node mbuf overloadable fields 
.RE
.PP

.PP
Definition at line \fB125\fP of file \fBrte_node_mbuf_dynfield\&.h\fP\&.
.SS "__rte_experimental int rte_node_mbuf_dynfield_register (void )"
Register rte_node specific common mbuf dynamic field region\&. Can be called in \fBrte_node_register()\fP->init() function to save offset in node->ctx

.PP
In process() function, node->ctx can be passed to
.IP "\(bu" 2
rte_node_mbuf_dynfield_get(mbuf, offset)
.IP "\(bu" 2
rte_node_mbuf_overload_fields_get(mbuf, offset)
.PP

.PP
Can be called multiple times by any number of nodes in init() function\&.
.IP "\(bu" 2
Very first call registers dynamic field and returns offset\&.
.IP "\(bu" 2
Subsequent calls return same offset\&.
.PP

.PP
\fBReturns\fP
.RS 4
<0 on error: rte_errno set to one of:
.IP "\(bu" 2
ENOMEM - no memory >=0 on success: dynamic field offset 
.PP
.RE
.PP

.SH "Author"
.PP 
Generated automatically by Doxygen for DPDK from the source code\&.
