1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(C) 2020 Marvell International Ltd.
5 #ifndef _RTE_GRAPH_PRIVATE_H_
6 #define _RTE_GRAPH_PRIVATE_H_
11 #include <rte_common.h>
14 #include "rte_graph.h"
17 #define ID_CHECK(id, id_max) \
19 if ((id) >= (id_max)) { \
29 * Structure that holds node internal data.
32 STAILQ_ENTRY(node) next; /**< Next node in the list. */
33 char name[RTE_NODE_NAMESIZE]; /**< Name of the node. */
34 uint64_t flags; /**< Node configuration flag. */
35 rte_node_process_t process; /**< Node process function. */
36 rte_node_init_t init; /**< Node init function. */
37 rte_node_fini_t fini; /**< Node fini function. */
38 rte_node_t id; /**< Allocated identifier for the node. */
39 rte_node_t parent_id; /**< Parent node identifier. */
40 rte_edge_t nb_edges; /**< Number of edges from this node. */
41 char next_nodes[][RTE_NODE_NAMESIZE]; /**< Names of next nodes. */
45 STAILQ_HEAD(node_head, node);
50 * Get the head of the node list.
53 * Pointer to the node head.
55 struct node_head *node_list_head_get(void);
60 * Get node pointer from node name.
63 * Pointer to character string containing the node name.
66 * Pointer to the node.
68 struct node *node_from_name(const char *name);
74 * Take a lock on the graph internal spin lock.
76 void graph_spinlock_lock(void);
81 * Release a lock on the graph internal spin lock.
83 void graph_spinlock_unlock(void);
88 * Dump internal node object data.
91 * FILE pointer to dump the info.
93 * Pointer to the internal node object.
95 void node_dump(FILE *f, struct node *n);
97 #endif /* _RTE_GRAPH_PRIVATE_H_ */