25 #include <rte_compat.h> 31 #define RTE_GRAPH_NAMESIZE 64 32 #define RTE_NODE_NAMESIZE 64 33 #define RTE_NODE_XSTAT_DESC_SIZE 64 34 #define RTE_GRAPH_PCAP_FILE_SZ 64 35 #define RTE_GRAPH_OFF_INVALID UINT32_MAX 36 #define RTE_NODE_ID_INVALID UINT32_MAX 37 #define RTE_EDGE_ID_INVALID UINT16_MAX 38 #define RTE_GRAPH_ID_INVALID UINT16_MAX 39 #define RTE_GRAPH_FENCE 0xdeadbeef12345678ULL 41 typedef uint32_t rte_graph_off_t; 42 typedef uint32_t rte_node_t; 43 typedef uint16_t rte_edge_t; 44 typedef uint16_t rte_graph_t; 47 #if RTE_GRAPH_BURST_SIZE == 1 48 #define RTE_GRAPH_BURST_SIZE_LOG2 0 49 #elif RTE_GRAPH_BURST_SIZE == 2 50 #define RTE_GRAPH_BURST_SIZE_LOG2 1 51 #elif RTE_GRAPH_BURST_SIZE == 4 52 #define RTE_GRAPH_BURST_SIZE_LOG2 2 53 #elif RTE_GRAPH_BURST_SIZE == 8 54 #define RTE_GRAPH_BURST_SIZE_LOG2 3 55 #elif RTE_GRAPH_BURST_SIZE == 16 56 #define RTE_GRAPH_BURST_SIZE_LOG2 4 57 #elif RTE_GRAPH_BURST_SIZE == 32 58 #define RTE_GRAPH_BURST_SIZE_LOG2 5 59 #elif RTE_GRAPH_BURST_SIZE == 64 60 #define RTE_GRAPH_BURST_SIZE_LOG2 6 61 #elif RTE_GRAPH_BURST_SIZE == 128 62 #define RTE_GRAPH_BURST_SIZE_LOG2 7 63 #elif RTE_GRAPH_BURST_SIZE == 256 64 #define RTE_GRAPH_BURST_SIZE_LOG2 8 66 #error "Unsupported burst size" 72 struct rte_graph_cluster_stats;
96 struct rte_node *node,
void **objs,
116 struct rte_node *node);
132 struct rte_node *node);
408 #define rte_graph_foreach_node(count, off, graph, node) \ 409 for (count = 0, off = graph->nodes_start, \ 410 node = RTE_PTR_ADD(graph, off); \ 411 count < graph->nb_nodes; \ 412 off = node->next, node = RTE_PTR_ADD(graph, off), count++) 498 #define RTE_NODE_SOURCE_F (1ULL << 0) 499 rte_node_process_t process; 500 rte_node_init_t init; 501 rte_node_fini_t fini; 502 struct rte_node_xstats *xstats; 504 rte_node_t parent_id; 506 const char *next_nodes[]; 533 #define RTE_NODE_REGISTER(node) \ 534 RTE_INIT(rte_node_register_##node) \ 536 node.parent_id = RTE_NODE_ID_INVALID; \ 537 node.id = __rte_node_register(&node); \ 730 #ifdef RTE_LIBRTE_GRAPH_STATS 731 return RTE_LIBRTE_GRAPH_STATS;
void rte_graph_dump(FILE *f, rte_graph_t id)
#define __rte_always_inline
rte_node_t rte_node_max_count(void)
uint64_t num_pkt_to_capture
const char * next_nodes[]
rte_graph_t rte_graph_from_name(const char *name)
struct rte_graph_cluster_stats * rte_graph_cluster_stats_create(const struct rte_graph_cluster_stats_param *prm)
#define RTE_NODE_NAMESIZE
static __rte_always_inline int rte_graph_has_stats_feature(void)
void rte_graph_cluster_stats_reset(struct rte_graph_cluster_stats *stat)
uint16_t(* rte_node_process_t)(struct rte_graph *graph, struct rte_node *node, void **objs, uint16_t nb_objs)
struct rte_node * rte_graph_node_get(rte_graph_t graph_id, rte_node_t node_id)
void rte_graph_cluster_stats_get(struct rte_graph_cluster_stats *stat, bool skip_cb)
static __rte_always_inline int rte_node_is_invalid(rte_node_t id)
#define RTE_GRAPH_ID_INVALID
void(* packets_enqueued_cb)(struct rte_graph *graph, uint64_t cb_priv)
#define __rte_cache_aligned
void rte_node_list_dump(FILE *f)
int rte_graph_model_mcore_dispatch_core_bind(rte_graph_t id, int lcore)
struct rte_node * rte_graph_node_get_by_name(const char *graph, const char *name)
rte_node_t __rte_node_register(const struct rte_node_register *node)
char * rte_graph_id_to_name(rte_graph_t id)
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_node_t rte_node_from_name(const char *name)
rte_edge_t rte_node_edge_shrink(rte_node_t id, rte_edge_t size)
#define RTE_NODE_XSTAT_DESC_SIZE
char xstat_desc[][RTE_NODE_XSTAT_DESC_SIZE]
int rte_graph_destroy(rte_graph_t id)
rte_graph_t rte_graph_clone(rte_graph_t id, const char *name, struct rte_graph_param *prm)
int(* rte_graph_cluster_stats_cb_t)(bool is_first, bool is_last, void *cookie, const struct rte_graph_cluster_node_stats *stats)
int(* rte_node_init_t)(const struct rte_graph *graph, struct rte_node *node)
const char ** graph_patterns
int rte_graph_export(const char *name, FILE *f)
rte_edge_t rte_node_edge_count(rte_node_t id)
char name[RTE_NODE_NAMESIZE]
rte_edge_t rte_node_edge_update(rte_node_t id, rte_edge_t from, const char **next_nodes, uint16_t nb_edges)
char * rte_node_id_to_name(rte_node_t id)
rte_graph_t rte_graph_create(const char *name, struct rte_graph_param *prm)
rte_graph_cluster_stats_cb_t fn
static __rte_always_inline int rte_edge_is_invalid(rte_edge_t id)
void rte_graph_cluster_stats_destroy(struct rte_graph_cluster_stats *stat)
struct rte_graph * rte_graph_lookup(const char *name)
rte_node_t rte_node_clone(rte_node_t id, const char *name)
rte_node_t rte_node_edge_get(rte_node_t id, char *next_nodes[])
void rte_graph_list_dump(FILE *f)
static __rte_always_inline int rte_graph_is_invalid(rte_graph_t id)
__rte_experimental int rte_node_free(rte_node_t id)
#define RTE_NODE_ID_INVALID
const char ** node_patterns
void rte_graph_obj_dump(FILE *f, struct rte_graph *graph, bool all)
void rte_graph_model_mcore_dispatch_core_unbind(rte_graph_t id)
rte_graph_t rte_graph_max_count(void)
void rte_node_dump(FILE *f, rte_node_t id)
#define RTE_EDGE_ID_INVALID