.TH "rte_graph.h" 3 "Version 25.11.0" "DPDK" \" -*- nroff -*-
.ad l
.nh
.SH NAME
rte_graph.h
.SH SYNOPSIS
.br
.PP
\fR#include <stdbool\&.h>\fP
.br
\fR#include <stdio\&.h>\fP
.br
\fR#include <rte_common\&.h>\fP
.br
\fR#include <rte_compat\&.h>\fP
.br

.SS "Data Structures"

.in +1c
.ti -1c
.RI "struct \fBrte_graph_param\fP"
.br
.ti -1c
.RI "struct \fBrte_graph_cluster_stats_param\fP"
.br
.ti -1c
.RI "struct \fBrte_graph_cluster_node_stats\fP"
.br
.ti -1c
.RI "struct \fBrte_node_xstats\fP"
.br
.ti -1c
.RI "struct \fBrte_node_register\fP"
.br
.in -1c
.SS "Macros"

.in +1c
.ti -1c
.RI "#define \fBRTE_GRAPH_NAMESIZE\fP   64"
.br
.ti -1c
.RI "#define \fBRTE_NODE_NAMESIZE\fP   64"
.br
.ti -1c
.RI "#define \fBRTE_NODE_XSTAT_DESC_SIZE\fP   64"
.br
.ti -1c
.RI "#define \fBRTE_GRAPH_PCAP_FILE_SZ\fP   64"
.br
.ti -1c
.RI "#define \fBRTE_GRAPH_OFF_INVALID\fP   UINT32_MAX"
.br
.ti -1c
.RI "#define \fBRTE_NODE_ID_INVALID\fP   UINT32_MAX"
.br
.ti -1c
.RI "#define \fBRTE_EDGE_ID_INVALID\fP   UINT16_MAX"
.br
.ti -1c
.RI "#define \fBRTE_GRAPH_ID_INVALID\fP   UINT16_MAX"
.br
.ti -1c
.RI "#define \fBRTE_GRAPH_FENCE\fP   0xdeadbeef12345678ULL"
.br
.ti -1c
.RI "#define \fBrte_graph_foreach_node\fP(count,  off,  graph,  node)"
.br
.ti -1c
.RI "#define \fBRTE_NODE_SOURCE_F\fP   (1ULL << 0)"
.br
.ti -1c
.RI "#define \fBRTE_NODE_REGISTER\fP(node)"
.br
.in -1c
.SS "Typedefs"

.in +1c
.ti -1c
.RI "\fBtypedef\fP uint32_t \fBrte_graph_off_t\fP"
.br
.ti -1c
.RI "\fBtypedef\fP uint32_t \fBrte_node_t\fP"
.br
.ti -1c
.RI "\fBtypedef\fP uint16_t \fBrte_edge_t\fP"
.br
.ti -1c
.RI "\fBtypedef\fP uint16_t \fBrte_graph_t\fP"
.br
.ti -1c
.RI "\fBtypedef\fP uint16_t(* \fBrte_node_process_t\fP) (struct rte_graph *graph, struct rte_node *node, void **objs, uint16_t nb_objs)"
.br
.ti -1c
.RI "\fBtypedef\fP int(* \fBrte_node_init_t\fP) (const struct rte_graph *graph, struct rte_node *node)"
.br
.ti -1c
.RI "\fBtypedef\fP void(* \fBrte_node_fini_t\fP) (const struct rte_graph *graph, struct rte_node *node)"
.br
.ti -1c
.RI "\fBtypedef\fP int(* \fBrte_graph_cluster_stats_cb_t\fP) (bool is_first, bool is_last, void *cookie, const struct \fBrte_graph_cluster_node_stats\fP *stats)"
.br
.ti -1c
.RI "\fBtypedef\fP void(* \fBpackets_enqueued_cb\fP) (struct rte_graph *graph, uint64_t cb_priv)"
.br
.in -1c
.SS "Functions"

.in +1c
.ti -1c
.RI "\fBrte_graph_t\fP \fBrte_graph_create\fP (const char *name, struct \fBrte_graph_param\fP *prm)"
.br
.ti -1c
.RI "int \fBrte_graph_destroy\fP (\fBrte_graph_t\fP id)"
.br
.ti -1c
.RI "\fBrte_graph_t\fP \fBrte_graph_clone\fP (\fBrte_graph_t\fP id, const char *name, struct \fBrte_graph_param\fP *prm)"
.br
.ti -1c
.RI "\fBrte_graph_t\fP \fBrte_graph_from_name\fP (const char *name)"
.br
.ti -1c
.RI "char * \fBrte_graph_id_to_name\fP (\fBrte_graph_t\fP id)"
.br
.ti -1c
.RI "int \fBrte_graph_export\fP (const char *name, FILE *f)"
.br
.ti -1c
.RI "int \fBrte_graph_model_mcore_dispatch_core_bind\fP (\fBrte_graph_t\fP id, int lcore)"
.br
.ti -1c
.RI "void \fBrte_graph_model_mcore_dispatch_core_unbind\fP (\fBrte_graph_t\fP id)"
.br
.ti -1c
.RI "struct rte_graph * \fBrte_graph_lookup\fP (const char *name)"
.br
.ti -1c
.RI "\fBrte_graph_t\fP \fBrte_graph_max_count\fP (void)"
.br
.ti -1c
.RI "void \fBrte_graph_dump\fP (FILE *f, \fBrte_graph_t\fP id)"
.br
.ti -1c
.RI "void \fBrte_graph_list_dump\fP (FILE *f)"
.br
.ti -1c
.RI "void \fBrte_graph_obj_dump\fP (FILE *f, struct rte_graph *graph, bool all)"
.br
.ti -1c
.RI "struct rte_node * \fBrte_graph_node_get\fP (\fBrte_graph_t\fP graph_id, \fBrte_node_t\fP node_id)"
.br
.ti -1c
.RI "struct rte_node * \fBrte_graph_node_get_by_name\fP (const char *graph, const char *name)"
.br
.ti -1c
.RI "struct rte_graph_cluster_stats * \fBrte_graph_cluster_stats_create\fP (const struct \fBrte_graph_cluster_stats_param\fP *prm)"
.br
.ti -1c
.RI "void \fBrte_graph_cluster_stats_destroy\fP (struct rte_graph_cluster_stats *stat)"
.br
.ti -1c
.RI "void \fBrte_graph_cluster_stats_get\fP (struct rte_graph_cluster_stats *stat, bool skip_cb)"
.br
.ti -1c
.RI "void \fBrte_graph_cluster_stats_reset\fP (struct rte_graph_cluster_stats *stat)"
.br
.ti -1c
.RI "\fBrte_node_t\fP \fB__rte_node_register\fP (const struct \fBrte_node_register\fP *node)"
.br
.ti -1c
.RI "\fBrte_node_t\fP \fBrte_node_clone\fP (\fBrte_node_t\fP id, const char *name)"
.br
.ti -1c
.RI "\fBrte_node_t\fP \fBrte_node_from_name\fP (const char *name)"
.br
.ti -1c
.RI "char * \fBrte_node_id_to_name\fP (\fBrte_node_t\fP id)"
.br
.ti -1c
.RI "\fBrte_edge_t\fP \fBrte_node_edge_count\fP (\fBrte_node_t\fP id)"
.br
.ti -1c
.RI "\fBrte_edge_t\fP \fBrte_node_edge_update\fP (\fBrte_node_t\fP id, \fBrte_edge_t\fP from, const char **next_nodes, uint16_t nb_edges)"
.br
.ti -1c
.RI "\fBrte_edge_t\fP \fBrte_node_edge_shrink\fP (\fBrte_node_t\fP id, \fBrte_edge_t\fP size)"
.br
.ti -1c
.RI "\fBrte_node_t\fP \fBrte_node_edge_get\fP (\fBrte_node_t\fP id, char *next_nodes[])"
.br
.ti -1c
.RI "\fBrte_node_t\fP \fBrte_node_max_count\fP (void)"
.br
.ti -1c
.RI "void \fBrte_node_dump\fP (FILE *f, \fBrte_node_t\fP id)"
.br
.ti -1c
.RI "void \fBrte_node_list_dump\fP (FILE *f)"
.br
.ti -1c
.RI "static \fB__rte_always_inline\fP int \fBrte_node_is_invalid\fP (\fBrte_node_t\fP id)"
.br
.ti -1c
.RI "__rte_experimental int \fBrte_node_free\fP (\fBrte_node_t\fP id)"
.br
.ti -1c
.RI "static \fB__rte_always_inline\fP int \fBrte_edge_is_invalid\fP (\fBrte_edge_t\fP id)"
.br
.ti -1c
.RI "static \fB__rte_always_inline\fP int \fBrte_graph_is_invalid\fP (\fBrte_graph_t\fP id)"
.br
.ti -1c
.RI "static \fB__rte_always_inline\fP int \fBrte_graph_has_stats_feature\fP (void)"
.br
.in -1c
.SH "Detailed Description"
.PP 
Graph architecture abstracts the data processing functions as "node" and "link" them together to create a complex "graph" to enable reusable/modular data processing functions\&.

.PP
This API enables graph framework operations such as create, lookup, dump and destroy on graph and node operations such as clone, edge update, and edge shrink, etc\&. The API also allows to create the stats cluster to monitor per graph and per node stats\&. 
.PP
Definition in file \fBrte_graph\&.h\fP\&.
.SH "Macro Definition Documentation"
.PP 
.SS "#define RTE_GRAPH_NAMESIZE   64"
Max length of graph name\&. 
.PP
Definition at line \fB31\fP of file \fBrte_graph\&.h\fP\&.
.SS "#define RTE_NODE_NAMESIZE   64"
Max length of node name\&. 
.PP
Definition at line \fB32\fP of file \fBrte_graph\&.h\fP\&.
.SS "#define RTE_NODE_XSTAT_DESC_SIZE   64"
Max length of node xstat description\&. 
.PP
Definition at line \fB33\fP of file \fBrte_graph\&.h\fP\&.
.SS "#define RTE_GRAPH_PCAP_FILE_SZ   64"
Max length of pcap file name\&. 
.PP
Definition at line \fB34\fP of file \fBrte_graph\&.h\fP\&.
.SS "#define RTE_GRAPH_OFF_INVALID   UINT32_MAX"
Invalid graph offset\&. 
.PP
Definition at line \fB35\fP of file \fBrte_graph\&.h\fP\&.
.SS "#define RTE_NODE_ID_INVALID   UINT32_MAX"
Invalid node id\&. 
.PP
Definition at line \fB36\fP of file \fBrte_graph\&.h\fP\&.
.SS "#define RTE_EDGE_ID_INVALID   UINT16_MAX"
Invalid edge id\&. 
.PP
Definition at line \fB37\fP of file \fBrte_graph\&.h\fP\&.
.SS "#define RTE_GRAPH_ID_INVALID   UINT16_MAX"
Invalid graph id\&. 
.PP
Definition at line \fB38\fP of file \fBrte_graph\&.h\fP\&.
.SS "#define RTE_GRAPH_FENCE   0xdeadbeef12345678ULL"
Graph fence data\&. 
.PP
Definition at line \fB39\fP of file \fBrte_graph\&.h\fP\&.
.SS "#define rte_graph_foreach_node( count,  off,  graph,  node)"
\fBValue:\fP
.nf
    for (count = 0, off = graph\->nodes_start,                              \\
         node = RTE_PTR_ADD(graph, off);                                   \\
         count < graph\->nb_nodes;                                          \\
         off = node\->next, node = RTE_PTR_ADD(graph, off), count++)
.PP
.fi
Macro to browse rte_node object after the graph creation 
.PP
Definition at line \fB408\fP of file \fBrte_graph\&.h\fP\&.
.SS "#define RTE_NODE_SOURCE_F   (1ULL << 0)"
Node type is source\&. 
.PP
Definition at line \fB498\fP of file \fBrte_graph\&.h\fP\&.
.SS "#define RTE_NODE_REGISTER( node)"
\fBValue:\fP
.nf
    RTE_INIT(rte_node_register_##node)                                     \\
    {                                                                      \\
        node\&.parent_id = RTE_NODE_ID_INVALID;                          \\
        node\&.id = __rte_node_register(&node);                          \\
    }
.PP
.fi
Register a static node\&.

.PP
The static node is registered through the constructor scheme, thereby, it can be used in a multi-process scenario\&.

.PP
\fBParameters\fP
.RS 4
\fInode\fP Valid node pointer with name, process function, and next_nodes\&. 
.RE
.PP

.PP
Definition at line \fB533\fP of file \fBrte_graph\&.h\fP\&.
.SH "Typedef Documentation"
.PP 
.SS "\fBtypedef\fP uint32_t \fBrte_graph_off_t\fP"
Graph offset type\&. 
.PP
Definition at line \fB41\fP of file \fBrte_graph\&.h\fP\&.
.SS "\fBtypedef\fP uint32_t \fBrte_node_t\fP"
Node id type\&. 
.PP
Definition at line \fB42\fP of file \fBrte_graph\&.h\fP\&.
.SS "\fBtypedef\fP uint16_t \fBrte_edge_t\fP"
Edge id type\&. 
.PP
Definition at line \fB43\fP of file \fBrte_graph\&.h\fP\&.
.SS "\fBtypedef\fP uint16_t \fBrte_graph_t\fP"
Graph id type\&. 
.PP
Definition at line \fB44\fP of file \fBrte_graph\&.h\fP\&.
.SS "\fBtypedef\fP uint16_t(* rte_node_process_t) (struct rte_graph *graph, struct rte_node *node, void **objs, uint16_t nb_objs)"
Node stats within cluster of graphs Node process function\&.

.PP
The function invoked when the worker thread walks on nodes using rte_graph_walk()\&.

.PP
\fBParameters\fP
.RS 4
\fIgraph\fP Pointer to the graph object\&. 
.br
\fInode\fP Pointer to the node object\&. 
.br
\fIobjs\fP Pointer to an array of objects to be processed\&. 
.br
\fInb_objs\fP Number of objects in the array\&.
.RE
.PP
\fBReturns\fP
.RS 4
Number of objects processed\&.
.RE
.PP
\fBSee also\fP
.RS 4
rte_graph_walk() 
.RE
.PP

.PP
Definition at line \fB95\fP of file \fBrte_graph\&.h\fP\&.
.SS "\fBtypedef\fP int(* rte_node_init_t) (const struct rte_graph *graph, struct rte_node *node)"
Node initialization function\&.

.PP
The function invoked when the user creates the graph using \fBrte_graph_create()\fP

.PP
\fBParameters\fP
.RS 4
\fIgraph\fP Pointer to the graph object\&. 
.br
\fInode\fP Pointer to the node object\&.
.RE
.PP
\fBReturns\fP
.RS 4
.IP "\(bu" 2
0: Success\&. -<0: Failure\&.
.PP
.RE
.PP
\fBSee also\fP
.RS 4
\fBrte_graph_create()\fP 
.RE
.PP

.PP
Definition at line \fB115\fP of file \fBrte_graph\&.h\fP\&.
.SS "\fBtypedef\fP void(* rte_node_fini_t) (const struct rte_graph *graph, struct rte_node *node)"
Node finalization function\&.

.PP
The function invoked when the user destroys the graph using \fBrte_graph_destroy()\fP\&.

.PP
\fBParameters\fP
.RS 4
\fIgraph\fP Pointer to the graph object\&. 
.br
\fInode\fP Pointer to the node object\&.
.RE
.PP
\fBSee also\fP
.RS 4
\fBrte_graph_destroy()\fP 
.RE
.PP

.PP
Definition at line \fB131\fP of file \fBrte_graph\&.h\fP\&.
.SS "\fBtypedef\fP int(* rte_graph_cluster_stats_cb_t) (bool is_first, bool is_last, void *cookie, const struct \fBrte_graph_cluster_node_stats\fP *stats)"
Graph cluster stats callback\&.

.PP
\fBParameters\fP
.RS 4
\fIis_first\fP Flag to denote that stats are of the first node\&. 
.br
\fIis_last\fP Flag to denote that stats are of the last node\&. 
.br
\fIcookie\fP Cookie supplied during stats creation\&. 
.br
\fIstats\fP Node cluster stats data\&.
.RE
.PP
\fBReturns\fP
.RS 4
.IP "\(bu" 2
0: Success\&. -<0: Failure\&. 
.PP
.RE
.PP

.PP
Definition at line \fB150\fP of file \fBrte_graph\&.h\fP\&.
.SS "\fBtypedef\fP void(* packets_enqueued_cb) (struct rte_graph *graph, uint64_t cb_priv)"
Graph dispatch enqueue notification callback\&.

.PP
\fBParameters\fP
.RS 4
\fIgraph\fP Current graph\&. 
.br
\fIcb_priv\fP Opaque argument given to the callback\&. 
.RE
.PP

.PP
Definition at line \fB161\fP of file \fBrte_graph\&.h\fP\&.
.SH "Function Documentation"
.PP 
.SS "\fBrte_graph_t\fP rte_graph_create (const char * name, struct \fBrte_graph_param\fP * prm)"
Create Graph\&.

.PP
Create memory reel, detect loops and find isolated nodes\&.

.PP
\fBParameters\fP
.RS 4
\fIname\fP Unique name for this graph\&. 
.br
\fIprm\fP Graph parameter, includes node names and count to be included in this graph\&.
.RE
.PP
\fBReturns\fP
.RS 4
Unique graph id on success, RTE_GRAPH_ID_INVALID otherwise\&. 
.RE
.PP

.SS "int rte_graph_destroy (\fBrte_graph_t\fP id)"
Destroy Graph\&.

.PP
Free Graph memory reel\&.

.PP
\fBParameters\fP
.RS 4
\fIid\fP id of the graph to destroy\&.
.RE
.PP
\fBReturns\fP
.RS 4
0 on success, error otherwise\&. 
.RE
.PP

.SS "\fBrte_graph_t\fP rte_graph_clone (\fBrte_graph_t\fP id, const char * name, struct \fBrte_graph_param\fP * prm)"
Clone Graph\&.

.PP
Clone a graph from static graph (graph created from \fBrte_graph_create()\fP)\&. And all cloned graphs attached to the parent graph MUST be destroyed together for fast schedule design limitation (stop ALL graph walk firstly)\&.

.PP
\fBParameters\fP
.RS 4
\fIid\fP Static graph id to clone from\&. 
.br
\fIname\fP Name of the new graph\&. The library prepends the parent graph name to the user-specified name\&. The final graph name will be, "parent graph name" + "-" + name\&. 
.br
\fIprm\fP Graph parameter, includes model-specific parameters in this graph\&.
.RE
.PP
\fBReturns\fP
.RS 4
Valid graph id on success, RTE_GRAPH_ID_INVALID otherwise\&. 
.RE
.PP

.SS "\fBrte_graph_t\fP rte_graph_from_name (const char * name)"
Get graph id from graph name\&.

.PP
\fBParameters\fP
.RS 4
\fIname\fP Name of the graph to get id\&.
.RE
.PP
\fBReturns\fP
.RS 4
Graph id on success, RTE_GRAPH_ID_INVALID otherwise\&. 
.RE
.PP

.SS "char * rte_graph_id_to_name (\fBrte_graph_t\fP id)"
Get graph name from graph id\&.

.PP
\fBParameters\fP
.RS 4
\fIid\fP id of the graph to get name\&.
.RE
.PP
\fBReturns\fP
.RS 4
Graph name on success, NULL otherwise\&. 
.RE
.PP

.SS "int rte_graph_export (const char * name, FILE * f)"
Export the graph as graph viz dot file

.PP
\fBParameters\fP
.RS 4
\fIname\fP Name of the graph to export\&. 
.br
\fIf\fP File pointer to export the graph\&.
.RE
.PP
\fBReturns\fP
.RS 4
0 on success, error otherwise\&. 
.RE
.PP

.SS "int rte_graph_model_mcore_dispatch_core_bind (\fBrte_graph_t\fP id, int lcore)"
Bind graph with specific lcore for mcore dispatch model\&.

.PP
\fBParameters\fP
.RS 4
\fIid\fP Graph id to get the pointer of graph object 
.br
\fIlcore\fP The lcore where the graph will run on 
.RE
.PP
\fBReturns\fP
.RS 4
0 on success, error otherwise\&. 
.RE
.PP

.SS "void rte_graph_model_mcore_dispatch_core_unbind (\fBrte_graph_t\fP id)"
Unbind graph with lcore for mcore dispatch model

.PP
\fBParameters\fP
.RS 4
\fIid\fP Graph id to get the pointer of graph object 
.RE
.PP

.SS "struct rte_graph * rte_graph_lookup (const char * name)"
Get graph object from its name\&.

.PP
Typical usage of this API to get graph objects in the worker thread and followed calling rte_graph_walk() in a loop\&.

.PP
\fBParameters\fP
.RS 4
\fIname\fP Name of the graph\&.
.RE
.PP
\fBReturns\fP
.RS 4
Graph pointer on success, NULL otherwise\&.
.RE
.PP
\fBSee also\fP
.RS 4
rte_graph_walk() 
.RE
.PP

.SS "\fBrte_graph_t\fP rte_graph_max_count (void )"
Get maximum number of graph available\&.

.PP
\fBReturns\fP
.RS 4
Maximum graph count\&. 
.RE
.PP

.SS "void rte_graph_dump (FILE * f, \fBrte_graph_t\fP id)"
Dump the graph information to file\&.

.PP
\fBParameters\fP
.RS 4
\fIf\fP File pointer to dump graph info\&. 
.br
\fIid\fP Graph id to get graph info\&. 
.RE
.PP

.SS "void rte_graph_list_dump (FILE * f)"
Dump all graphs information to file

.PP
\fBParameters\fP
.RS 4
\fIf\fP File pointer to dump graph info\&. 
.RE
.PP

.SS "void rte_graph_obj_dump (FILE * f, struct rte_graph * graph, bool all)"
Dump graph information along with node info to file

.PP
\fBParameters\fP
.RS 4
\fIf\fP File pointer to dump graph info\&. 
.br
\fIgraph\fP Graph pointer to get graph info\&. 
.br
\fIall\fP true to dump nodes in the graph\&. 
.RE
.PP

.SS "struct rte_node * rte_graph_node_get (\fBrte_graph_t\fP graph_id, \fBrte_node_t\fP node_id)"
Get node object with in graph from id\&.

.PP
\fBParameters\fP
.RS 4
\fIgraph_id\fP Graph id to get node pointer from\&. 
.br
\fInode_id\fP Node id to get node pointer\&.
.RE
.PP
\fBReturns\fP
.RS 4
Node pointer on success, NULL otherwise\&. 
.RE
.PP

.SS "struct rte_node * rte_graph_node_get_by_name (const char * graph, const char * name)"
Get node pointer with in graph from name\&.

.PP
\fBParameters\fP
.RS 4
\fIgraph\fP Graph name to get node pointer from\&. 
.br
\fIname\fP Node name to get the node pointer\&.
.RE
.PP
\fBReturns\fP
.RS 4
Node pointer on success, NULL otherwise\&. 
.RE
.PP

.SS "struct rte_graph_cluster_stats * rte_graph_cluster_stats_create (const struct \fBrte_graph_cluster_stats_param\fP * prm)"
Create graph stats cluster to aggregate runtime node stats\&.

.PP
\fBParameters\fP
.RS 4
\fIprm\fP Parameters including file pointer to dump stats, Graph pattern to create cluster and callback function\&.
.RE
.PP
\fBReturns\fP
.RS 4
Valid pointer on success, NULL otherwise\&. 
.RE
.PP

.SS "void rte_graph_cluster_stats_destroy (struct rte_graph_cluster_stats * stat)"
Destroy cluster stats\&.

.PP
\fBParameters\fP
.RS 4
\fIstat\fP Valid cluster pointer to destroy\&. 
.RE
.PP

.SS "void rte_graph_cluster_stats_get (struct rte_graph_cluster_stats * stat, bool skip_cb)"
Get stats to application\&.

.PP
\fBParameters\fP
.RS 4
\fIstat\fP Cluster status\&. 
.br
\fIskip_cb\fP true to skip callback function invocation\&. 
.RE
.PP

.SS "void rte_graph_cluster_stats_reset (struct rte_graph_cluster_stats * stat)"
Reset cluster stats to zero\&.

.PP
\fBParameters\fP
.RS 4
\fIstat\fP Valid cluster stats pointer\&. 
.RE
.PP

.SS "\fBrte_node_t\fP __rte_node_register (const struct \fBrte_node_register\fP * node)"
Register new packet processing node\&. Nodes can be registered dynamically via this call or statically via the RTE_NODE_REGISTER macro\&.

.PP
\fBParameters\fP
.RS 4
\fInode\fP Valid node pointer with name, process function and next_nodes\&.
.RE
.PP
\fBReturns\fP
.RS 4
Valid node id on success, RTE_NODE_ID_INVALID otherwise\&.
.RE
.PP
\fBSee also\fP
.RS 4
\fBRTE_NODE_REGISTER()\fP 
.RE
.PP

.SS "\fBrte_node_t\fP rte_node_clone (\fBrte_node_t\fP id, const char * name)"
Clone a node from static node(node created from RTE_NODE_REGISTER)\&.

.PP
\fBParameters\fP
.RS 4
\fIid\fP Static node id to clone from\&. 
.br
\fIname\fP Name of the new node\&. The library prepends the parent node name to the user-specified name\&. The final node name will be, "parent node name" + "-" + name\&.
.RE
.PP
\fBReturns\fP
.RS 4
Valid node id on success, RTE_NODE_ID_INVALID otherwise\&. 
.RE
.PP

.SS "\fBrte_node_t\fP rte_node_from_name (const char * name)"
Get node id from node name\&.

.PP
\fBParameters\fP
.RS 4
\fIname\fP Valid node name\&. In the case of the cloned node, the name will be "parent node name" + "-" + name\&.
.RE
.PP
\fBReturns\fP
.RS 4
Valid node id on success, RTE_NODE_ID_INVALID otherwise\&. 
.RE
.PP

.SS "char * rte_node_id_to_name (\fBrte_node_t\fP id)"
Get node name from node id\&.

.PP
\fBParameters\fP
.RS 4
\fIid\fP Valid node id\&.
.RE
.PP
\fBReturns\fP
.RS 4
Valid node name on success, NULL otherwise\&. 
.RE
.PP

.SS "\fBrte_edge_t\fP rte_node_edge_count (\fBrte_node_t\fP id)"
Get the number of edges(next-nodes) for a node from node id\&.

.PP
\fBParameters\fP
.RS 4
\fIid\fP Valid node id\&.
.RE
.PP
\fBReturns\fP
.RS 4
Valid edge count on success, RTE_EDGE_ID_INVALID otherwise\&. 
.RE
.PP

.SS "\fBrte_edge_t\fP rte_node_edge_update (\fBrte_node_t\fP id, \fBrte_edge_t\fP from, const char ** next_nodes, uint16_t nb_edges)"
Update the edges for a node from node id\&.

.PP
\fBParameters\fP
.RS 4
\fIid\fP Valid node id\&. 
.br
\fIfrom\fP Index to update the edges from\&. RTE_EDGE_ID_INVALID is valid, in that case, it will be added to the end of the list\&. 
.br
\fInext_nodes\fP Name of the edges to update\&. 
.br
\fInb_edges\fP Number of edges to update\&.
.RE
.PP
\fBReturns\fP
.RS 4
Valid edge count on success, 0 otherwise\&. 
.RE
.PP

.SS "\fBrte_edge_t\fP rte_node_edge_shrink (\fBrte_node_t\fP id, \fBrte_edge_t\fP size)"
Shrink the edges to a given size\&.

.PP
\fBParameters\fP
.RS 4
\fIid\fP Valid node id\&. 
.br
\fIsize\fP New size to shrink the edges\&.
.RE
.PP
\fBReturns\fP
.RS 4
New size on success, RTE_EDGE_ID_INVALID otherwise\&. 
.RE
.PP

.SS "\fBrte_node_t\fP rte_node_edge_get (\fBrte_node_t\fP id, char * next_nodes[])"
Get the edge names from a given node\&.

.PP
\fBParameters\fP
.RS 4
\fIid\fP Valid node id\&. 
.br
\fInext_nodes\fP Buffer to copy the edge names\&. The NULL value is allowed in that case, the function returns the size of the array that needs to be allocated\&.
.RE
.PP
\fBReturns\fP
.RS 4
When next_nodes == NULL, it returns the size of the array else number of item copied\&. 
.RE
.PP

.SS "\fBrte_node_t\fP rte_node_max_count (void )"
Get maximum nodes available\&.

.PP
\fBReturns\fP
.RS 4
Maximum nodes count\&. 
.RE
.PP

.SS "void rte_node_dump (FILE * f, \fBrte_node_t\fP id)"
Dump node info to file\&.

.PP
\fBParameters\fP
.RS 4
\fIf\fP File pointer to dump the node info\&. 
.br
\fIid\fP Node id to get the info\&. 
.RE
.PP

.SS "void rte_node_list_dump (FILE * f)"
Dump all node info to file\&.

.PP
\fBParameters\fP
.RS 4
\fIf\fP File pointer to dump the node info\&. 
.RE
.PP

.SS "\fB__rte_always_inline\fP int rte_node_is_invalid (\fBrte_node_t\fP id)\fR [static]\fP"
Test the validity of node id\&.

.PP
\fBParameters\fP
.RS 4
\fIid\fP Node id to check\&.
.RE
.PP
\fBReturns\fP
.RS 4
1 if valid id, 0 otherwise\&. 
.RE
.PP

.PP
Definition at line \fB672\fP of file \fBrte_graph\&.h\fP\&.
.SS "__rte_experimental int rte_node_free (\fBrte_node_t\fP id)"
Release the memory allocated for a node created using RTE_NODE_REGISTER or rte_node_clone, if it is not linked to any graphs\&.

.PP
\fBParameters\fP
.RS 4
\fIid\fP Node id to check\&.
.RE
.PP
\fBReturns\fP
.RS 4
.IP "\(bu" 2
0: Success\&. -<0: Failure\&. 
.PP
.RE
.PP

.SS "\fB__rte_always_inline\fP int rte_edge_is_invalid (\fBrte_edge_t\fP id)\fR [static]\fP"
Test the validity of edge id\&.

.PP
\fBParameters\fP
.RS 4
\fIid\fP Edge node id to check\&.
.RE
.PP
\fBReturns\fP
.RS 4
1 if valid id, 0 otherwise\&. 
.RE
.PP

.PP
Definition at line \fB701\fP of file \fBrte_graph\&.h\fP\&.
.SS "\fB__rte_always_inline\fP int rte_graph_is_invalid (\fBrte_graph_t\fP id)\fR [static]\fP"
Test the validity of graph id\&.

.PP
\fBParameters\fP
.RS 4
\fIid\fP Graph id to check\&.
.RE
.PP
\fBReturns\fP
.RS 4
1 if valid id, 0 otherwise\&. 
.RE
.PP

.PP
Definition at line \fB716\fP of file \fBrte_graph\&.h\fP\&.
.SS "\fB__rte_always_inline\fP int rte_graph_has_stats_feature (void )\fR [static]\fP"
Test stats feature support\&.

.PP
\fBReturns\fP
.RS 4
1 if stats enabled, 0 otherwise\&. 
.RE
.PP

.PP
Definition at line \fB728\fP of file \fBrte_graph\&.h\fP\&.
.SH "Author"
.PP 
Generated automatically by Doxygen for DPDK from the source code\&.
