DPDK 21.11.9
|
Go to the source code of this file.
Data Structures | |
struct | rte_graph_param |
struct | rte_graph_cluster_stats_param |
struct | rte_graph_cluster_node_stats |
struct | rte_node_register |
Macros | |
#define | RTE_GRAPH_NAMESIZE 64 |
#define | RTE_NODE_NAMESIZE 64 |
#define | RTE_GRAPH_OFF_INVALID UINT32_MAX |
#define | RTE_NODE_ID_INVALID UINT32_MAX |
#define | RTE_EDGE_ID_INVALID UINT16_MAX |
#define | RTE_GRAPH_ID_INVALID UINT16_MAX |
#define | RTE_GRAPH_FENCE 0xdeadbeef12345678ULL |
#define | rte_graph_foreach_node(count, off, graph, node) |
#define | RTE_NODE_SOURCE_F (1ULL << 0) |
#define | RTE_NODE_REGISTER(node) |
Typedefs | |
typedef uint32_t | rte_graph_off_t |
typedef uint32_t | rte_node_t |
typedef uint16_t | rte_edge_t |
typedef uint16_t | rte_graph_t |
typedef uint16_t(* | rte_node_process_t) (struct rte_graph *graph, struct rte_node *node, void **objs, uint16_t nb_objs) |
typedef int(* | rte_node_init_t) (const struct rte_graph *graph, struct rte_node *node) |
typedef void(* | rte_node_fini_t) (const struct rte_graph *graph, struct rte_node *node) |
typedef int(* | rte_graph_cluster_stats_cb_t) (bool is_first, bool is_last, void *cookie, const struct rte_graph_cluster_node_stats *stats) |
Functions | |
__rte_experimental rte_graph_t | rte_graph_create (const char *name, struct rte_graph_param *prm) |
__rte_experimental int | rte_graph_destroy (rte_graph_t id) |
__rte_experimental rte_graph_t | rte_graph_from_name (const char *name) |
__rte_experimental char * | rte_graph_id_to_name (rte_graph_t id) |
__rte_experimental int | rte_graph_export (const char *name, FILE *f) |
__rte_experimental struct rte_graph * | rte_graph_lookup (const char *name) |
__rte_experimental rte_graph_t | rte_graph_max_count (void) |
__rte_experimental void | rte_graph_dump (FILE *f, rte_graph_t id) |
__rte_experimental void | rte_graph_list_dump (FILE *f) |
__rte_experimental void | rte_graph_obj_dump (FILE *f, struct rte_graph *graph, bool all) |
__rte_experimental struct rte_node * | rte_graph_node_get (rte_graph_t graph_id, rte_node_t node_id) |
__rte_experimental struct rte_node * | rte_graph_node_get_by_name (const char *graph, const char *name) |
__rte_experimental struct rte_graph_cluster_stats * | rte_graph_cluster_stats_create (const struct rte_graph_cluster_stats_param *prm) |
__rte_experimental void | rte_graph_cluster_stats_destroy (struct rte_graph_cluster_stats *stat) |
__rte_experimental void | rte_graph_cluster_stats_get (struct rte_graph_cluster_stats *stat, bool skip_cb) |
__rte_experimental void | rte_graph_cluster_stats_reset (struct rte_graph_cluster_stats *stat) |
__rte_experimental rte_node_t | __rte_node_register (const struct rte_node_register *node) |
__rte_experimental rte_node_t | rte_node_clone (rte_node_t id, const char *name) |
__rte_experimental rte_node_t | rte_node_from_name (const char *name) |
__rte_experimental char * | rte_node_id_to_name (rte_node_t id) |
__rte_experimental rte_edge_t | rte_node_edge_count (rte_node_t id) |
__rte_experimental rte_edge_t | rte_node_edge_update (rte_node_t id, rte_edge_t from, const char **next_nodes, uint16_t nb_edges) |
__rte_experimental rte_edge_t | rte_node_edge_shrink (rte_node_t id, rte_edge_t size) |
__rte_experimental rte_node_t | rte_node_edge_get (rte_node_t id, char *next_nodes[]) |
__rte_experimental rte_node_t | rte_node_max_count (void) |
__rte_experimental void | rte_node_dump (FILE *f, rte_node_t id) |
__rte_experimental void | rte_node_list_dump (FILE *f) |
static __rte_always_inline int | rte_node_is_invalid (rte_node_t id) |
static __rte_always_inline int | rte_edge_is_invalid (rte_edge_t id) |
static __rte_always_inline int | rte_graph_is_invalid (rte_graph_t id) |
static __rte_always_inline int | rte_graph_has_stats_feature (void) |
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.
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.
Definition in file rte_graph.h.
#define RTE_GRAPH_NAMESIZE 64 |
Max length of graph name.
Definition at line 36 of file rte_graph.h.
#define RTE_NODE_NAMESIZE 64 |
Max length of node name.
Definition at line 37 of file rte_graph.h.
#define RTE_GRAPH_OFF_INVALID UINT32_MAX |
Invalid graph offset.
Definition at line 38 of file rte_graph.h.
#define RTE_NODE_ID_INVALID UINT32_MAX |
Invalid node id.
Definition at line 39 of file rte_graph.h.
#define RTE_EDGE_ID_INVALID UINT16_MAX |
Invalid edge id.
Definition at line 40 of file rte_graph.h.
#define RTE_GRAPH_ID_INVALID UINT16_MAX |
#define RTE_GRAPH_FENCE 0xdeadbeef12345678ULL |
Graph fence data.
Definition at line 42 of file rte_graph.h.
#define rte_graph_foreach_node | ( | count, | |
off, | |||
graph, | |||
node | |||
) |
Macro to browse rte_node object after the graph creation
Definition at line 343 of file rte_graph.h.
#define RTE_NODE_SOURCE_F (1ULL << 0) |
Node type is source.
Definition at line 430 of file rte_graph.h.
#define RTE_NODE_REGISTER | ( | node | ) |
Register a static node.
The static node is registered through the constructor scheme, thereby, it can be used in a multi-process scenario.
node | Valid node pointer with name, process function, and next_nodes. |
Definition at line 465 of file rte_graph.h.
typedef uint32_t rte_graph_off_t |
Graph offset type.
Definition at line 44 of file rte_graph.h.
typedef uint32_t rte_node_t |
Node id type.
Definition at line 45 of file rte_graph.h.
typedef uint16_t rte_edge_t |
Edge id type.
Definition at line 46 of file rte_graph.h.
typedef uint16_t rte_graph_t |
Graph id type.
Definition at line 47 of file rte_graph.h.
typedef 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.
The function invoked when the worker thread walks on nodes using rte_graph_walk().
graph | Pointer to the graph object. |
node | Pointer to the node object. |
objs | Pointer to an array of objects to be processed. |
nb_objs | Number of objects in the array. |
Definition at line 99 of file rte_graph.h.
typedef int(* rte_node_init_t) (const struct rte_graph *graph, struct rte_node *node) |
Node initialization function.
The function invoked when the user creates the graph using rte_graph_create()
graph | Pointer to the graph object. |
node | Pointer to the node object. |
Definition at line 119 of file rte_graph.h.
typedef void(* rte_node_fini_t) (const struct rte_graph *graph, struct rte_node *node) |
Node finalization function.
The function invoked when the user destroys the graph using rte_graph_destroy().
graph | Pointer to the graph object. |
node | Pointer to the node object. |
Definition at line 135 of file rte_graph.h.
typedef int(* rte_graph_cluster_stats_cb_t) (bool is_first, bool is_last, void *cookie, const struct rte_graph_cluster_node_stats *stats) |
Graph cluster stats callback.
is_first | Flag to denote that stats are of the first node. |
is_last | Flag to denote that stats are of the last node. |
cookie | Cookie supplied during stats creation. |
stats | Node cluster stats data. |
Definition at line 154 of file rte_graph.h.
__rte_experimental rte_graph_t rte_graph_create | ( | const char * | name, |
struct rte_graph_param * | prm | ||
) |
Create Graph.
Create memory reel, detect loops and find isolated nodes.
name | Unique name for this graph. |
prm | Graph parameter, includes node names and count to be included in this graph. |
__rte_experimental int rte_graph_destroy | ( | rte_graph_t | id | ) |
Destroy Graph.
Free Graph memory reel.
id | id of the graph to destroy. |
__rte_experimental rte_graph_t rte_graph_from_name | ( | const char * | name | ) |
Get graph id from graph name.
name | Name of the graph to get id. |
__rte_experimental char * rte_graph_id_to_name | ( | rte_graph_t | id | ) |
Get graph name from graph id.
id | id of the graph to get name. |
__rte_experimental int rte_graph_export | ( | const char * | name, |
FILE * | f | ||
) |
Export the graph as graph viz dot file
name | Name of the graph to export. |
f | File pointer to export the graph. |
__rte_experimental struct rte_graph * rte_graph_lookup | ( | const char * | name | ) |
Get graph object from its name.
Typical usage of this API to get graph objects in the worker thread and followed calling rte_graph_walk() in a loop.
name | Name of the graph. |
__rte_experimental rte_graph_t rte_graph_max_count | ( | void | ) |
Get maximum number of graph available.
__rte_experimental void rte_graph_dump | ( | FILE * | f, |
rte_graph_t | id | ||
) |
Dump the graph information to file.
f | File pointer to dump graph info. |
id | Graph id to get graph info. |
__rte_experimental void rte_graph_list_dump | ( | FILE * | f | ) |
Dump all graphs information to file
f | File pointer to dump graph info. |
__rte_experimental void rte_graph_obj_dump | ( | FILE * | f, |
struct rte_graph * | graph, | ||
bool | all | ||
) |
Dump graph information along with node info to file
f | File pointer to dump graph info. |
graph | Graph pointer to get graph info. |
all | true to dump nodes in the graph. |
__rte_experimental struct rte_node * rte_graph_node_get | ( | rte_graph_t | graph_id, |
rte_node_t | node_id | ||
) |
Get node object with in graph from id.
graph_id | Graph id to get node pointer from. |
node_id | Node id to get node pointer. |
__rte_experimental struct rte_node * rte_graph_node_get_by_name | ( | const char * | graph, |
const char * | name | ||
) |
Get node pointer with in graph from name.
graph | Graph name to get node pointer from. |
name | Node name to get the node pointer. |
__rte_experimental struct rte_graph_cluster_stats * rte_graph_cluster_stats_create | ( | const struct rte_graph_cluster_stats_param * | prm | ) |
Create graph stats cluster to aggregate runtime node stats.
prm | Parameters including file pointer to dump stats, Graph pattern to create cluster and callback function. |
__rte_experimental void rte_graph_cluster_stats_destroy | ( | struct rte_graph_cluster_stats * | stat | ) |
Destroy cluster stats.
stat | Valid cluster pointer to destroy. |
__rte_experimental void rte_graph_cluster_stats_get | ( | struct rte_graph_cluster_stats * | stat, |
bool | skip_cb | ||
) |
Get stats to application.
[out] | stat | Cluster status. |
skip_cb | true to skip callback function invocation. |
__rte_experimental void rte_graph_cluster_stats_reset | ( | struct rte_graph_cluster_stats * | stat | ) |
Reset cluster stats to zero.
stat | Valid cluster stats pointer. |
__rte_experimental rte_node_t __rte_node_register | ( | const struct rte_node_register * | node | ) |
Register new packet processing node. Nodes can be registered dynamically via this call or statically via the RTE_NODE_REGISTER macro.
node | Valid node pointer with name, process function and next_nodes. |
__rte_experimental rte_node_t rte_node_clone | ( | rte_node_t | id, |
const char * | name | ||
) |
Clone a node from static node(node created from RTE_NODE_REGISTER).
id | Static node id to clone from. |
name | 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. |
__rte_experimental rte_node_t rte_node_from_name | ( | const char * | name | ) |
Get node id from node name.
name | Valid node name. In the case of the cloned node, the name will be "parent node name" + "-" + name. |
__rte_experimental char * rte_node_id_to_name | ( | rte_node_t | id | ) |
Get node name from node id.
id | Valid node id. |
__rte_experimental rte_edge_t rte_node_edge_count | ( | rte_node_t | id | ) |
Get the number of edges(next-nodes) for a node from node id.
id | Valid node id. |
__rte_experimental rte_edge_t rte_node_edge_update | ( | rte_node_t | id, |
rte_edge_t | from, | ||
const char ** | next_nodes, | ||
uint16_t | nb_edges | ||
) |
Update the edges for a node from node id.
id | Valid node id. |
from | 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. |
next_nodes | Name of the edges to update. |
nb_edges | Number of edges to update. |
__rte_experimental rte_edge_t rte_node_edge_shrink | ( | rte_node_t | id, |
rte_edge_t | size | ||
) |
Shrink the edges to a given size.
id | Valid node id. |
size | New size to shrink the edges. |
__rte_experimental rte_node_t rte_node_edge_get | ( | rte_node_t | id, |
char * | next_nodes[] | ||
) |
Get the edge names from a given node.
id | Valid node id. | |
[out] | next_nodes | 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. |
__rte_experimental rte_node_t rte_node_max_count | ( | void | ) |
Get maximum nodes available.
__rte_experimental void rte_node_dump | ( | FILE * | f, |
rte_node_t | id | ||
) |
Dump node info to file.
f | File pointer to dump the node info. |
id | Node id to get the info. |
__rte_experimental void rte_node_list_dump | ( | FILE * | f | ) |
Dump all node info to file.
f | File pointer to dump the node info. |
|
static |
Test the validity of node id.
id | Node id to check. |
Definition at line 614 of file rte_graph.h.
|
static |
Test the validity of edge id.
id | Edge node id to check. |
Definition at line 629 of file rte_graph.h.
|
static |
Test the validity of graph id.
id | Graph id to check. |
Definition at line 644 of file rte_graph.h.
|
static |
Test stats feature support.
Definition at line 656 of file rte_graph.h.