30 #include <rte_compat.h> 36 #define RTE_GRAPH_NAMESIZE 64 37 #define RTE_NODE_NAMESIZE 64 38 #define RTE_GRAPH_PCAP_FILE_SZ 64 39 #define RTE_GRAPH_OFF_INVALID UINT32_MAX 40 #define RTE_NODE_ID_INVALID UINT32_MAX 41 #define RTE_EDGE_ID_INVALID UINT16_MAX 42 #define RTE_GRAPH_ID_INVALID UINT16_MAX 43 #define RTE_GRAPH_FENCE 0xdeadbeef12345678ULL 45 typedef uint32_t rte_graph_off_t; 46 typedef uint32_t rte_node_t; 47 typedef uint16_t rte_edge_t; 48 typedef uint16_t rte_graph_t; 51 #if RTE_GRAPH_BURST_SIZE == 1 52 #define RTE_GRAPH_BURST_SIZE_LOG2 0 53 #elif RTE_GRAPH_BURST_SIZE == 2 54 #define RTE_GRAPH_BURST_SIZE_LOG2 1 55 #elif RTE_GRAPH_BURST_SIZE == 4 56 #define RTE_GRAPH_BURST_SIZE_LOG2 2 57 #elif RTE_GRAPH_BURST_SIZE == 8 58 #define RTE_GRAPH_BURST_SIZE_LOG2 3 59 #elif RTE_GRAPH_BURST_SIZE == 16 60 #define RTE_GRAPH_BURST_SIZE_LOG2 4 61 #elif RTE_GRAPH_BURST_SIZE == 32 62 #define RTE_GRAPH_BURST_SIZE_LOG2 5 63 #elif RTE_GRAPH_BURST_SIZE == 64 64 #define RTE_GRAPH_BURST_SIZE_LOG2 6 65 #elif RTE_GRAPH_BURST_SIZE == 128 66 #define RTE_GRAPH_BURST_SIZE_LOG2 7 67 #elif RTE_GRAPH_BURST_SIZE == 256 68 #define RTE_GRAPH_BURST_SIZE_LOG2 8 70 #error "Unsupported burst size" 76 struct rte_graph_cluster_stats;
101 struct rte_node *node,
void **objs,
121 struct rte_node *node);
137 struct rte_node *node);
348 #define rte_graph_foreach_node(count, off, graph, node) \ 349 for (count = 0, off = graph->nodes_start, \ 350 node = RTE_PTR_ADD(graph, off); \ 351 count < graph->nb_nodes; \ 352 off = node->next, node = RTE_PTR_ADD(graph, off), count++) 435 #define RTE_NODE_SOURCE_F (1ULL << 0) 436 rte_node_process_t process; 437 rte_node_init_t init; 438 rte_node_fini_t fini; 440 rte_node_t parent_id; 442 const char *next_nodes[]; 470 #define RTE_NODE_REGISTER(node) \ 471 RTE_INIT(rte_node_register_##node) \ 473 node.parent_id = RTE_NODE_ID_INVALID; \ 474 node.id = __rte_node_register(&node); \ 548 const char **next_nodes, uint16_t nb_edges);
663 #ifdef RTE_LIBRTE_GRAPH_STATS 664 return RTE_LIBRTE_GRAPH_STATS;
#define __rte_always_inline
uint64_t num_pkt_to_capture
__rte_experimental rte_node_t rte_node_clone(rte_node_t id, 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 rte_node_t rte_node_from_name(const char *name)
#define RTE_NODE_NAMESIZE
__rte_experimental void rte_graph_cluster_stats_destroy(struct rte_graph_cluster_stats *stat)
static __rte_always_inline int rte_graph_has_stats_feature(void)
__rte_experimental rte_node_t rte_node_edge_get(rte_node_t id, char *next_nodes[])
__rte_experimental rte_node_t __rte_node_register(const struct rte_node_register *node)
__rte_experimental int rte_graph_destroy(rte_graph_t id)
__rte_experimental char * rte_node_id_to_name(rte_node_t id)
uint16_t(* rte_node_process_t)(struct rte_graph *graph, struct rte_node *node, void **objs, uint16_t nb_objs)
__rte_experimental char * rte_graph_id_to_name(rte_graph_t id)
__rte_experimental rte_node_t rte_node_max_count(void)
__rte_experimental struct rte_node * rte_graph_node_get_by_name(const char *graph, const char *name)
static __rte_always_inline int rte_node_is_invalid(rte_node_t id)
#define RTE_GRAPH_ID_INVALID
__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)
void(* rte_node_fini_t)(const struct rte_graph *graph, struct rte_node *node)
uint16_t nb_graph_patterns
uint16_t nb_node_patterns
__rte_experimental void rte_graph_list_dump(FILE *f)
__rte_experimental void rte_node_list_dump(FILE *f)
int(* rte_graph_cluster_stats_cb_t)(bool is_first, bool is_last, void *cookie, const struct rte_graph_cluster_node_stats *stats)
__rte_experimental struct rte_node * rte_graph_node_get(rte_graph_t graph_id, rte_node_t node_id)
int(* rte_node_init_t)(const struct rte_graph *graph, struct rte_node *node)
__rte_experimental void rte_node_dump(FILE *f, rte_node_t id)
const char ** graph_patterns
__rte_experimental void rte_graph_cluster_stats_reset(struct rte_graph_cluster_stats *stat)
__rte_experimental rte_graph_t rte_graph_max_count(void)
__rte_experimental rte_graph_t rte_graph_create(const char *name, struct rte_graph_param *prm)
#define __rte_cache_aligned
rte_graph_cluster_stats_cb_t fn
static __rte_always_inline int rte_edge_is_invalid(rte_edge_t id)
__rte_experimental rte_edge_t rte_node_edge_shrink(rte_node_t id, rte_edge_t size)
__rte_experimental rte_graph_t rte_graph_from_name(const char *name)
__rte_experimental struct rte_graph * rte_graph_lookup(const char *name)
__rte_experimental void rte_graph_obj_dump(FILE *f, struct rte_graph *graph, bool all)
__rte_experimental void rte_graph_dump(FILE *f, rte_graph_t id)
__rte_experimental void rte_graph_cluster_stats_get(struct rte_graph_cluster_stats *stat, bool skip_cb)
static __rte_always_inline int rte_graph_is_invalid(rte_graph_t id)
__rte_experimental rte_edge_t rte_node_edge_count(rte_node_t id)
#define RTE_NODE_ID_INVALID
const char ** node_patterns
__rte_experimental int rte_graph_export(const char *name, FILE *f)
#define RTE_EDGE_ID_INVALID