Lines Matching refs:graph
14 graph_fp_mem_calc_size(struct graph *graph) in graph_fp_mem_calc_size() argument
23 sz += sizeof(rte_graph_off_t) * graph->src_node_count; in graph_fp_mem_calc_size()
25 val = rte_align32pow2(graph->node_count * sizeof(rte_graph_off_t)); in graph_fp_mem_calc_size()
27 graph->cir_start = sz; in graph_fp_mem_calc_size()
28 graph->cir_mask = rte_align32pow2(graph->node_count) - 1; in graph_fp_mem_calc_size()
33 graph->nodes_start = sz; in graph_fp_mem_calc_size()
35 STAILQ_FOREACH(graph_node, &graph->node_list, next) { in graph_fp_mem_calc_size()
42 graph->mem_sz = sz; in graph_fp_mem_calc_size()
47 graph_header_popluate(struct graph *_graph) in graph_header_popluate()
49 struct rte_graph *graph = _graph->graph; in graph_header_popluate() local
51 graph->tail = 0; in graph_header_popluate()
52 graph->head = (int32_t)-_graph->src_node_count; in graph_header_popluate()
53 graph->cir_mask = _graph->cir_mask; in graph_header_popluate()
54 graph->nb_nodes = _graph->node_count; in graph_header_popluate()
55 graph->cir_start = RTE_PTR_ADD(graph, _graph->cir_start); in graph_header_popluate()
56 graph->nodes_start = _graph->nodes_start; in graph_header_popluate()
57 graph->socket = _graph->socket; in graph_header_popluate()
58 graph->id = _graph->id; in graph_header_popluate()
59 memcpy(graph->name, _graph->name, RTE_GRAPH_NAMESIZE); in graph_header_popluate()
60 graph->fence = RTE_GRAPH_FENCE; in graph_header_popluate()
64 graph_nodes_populate(struct graph *_graph) in graph_nodes_populate()
67 struct rte_graph *graph = _graph->graph; in graph_nodes_populate() local
74 struct rte_node *node = RTE_PTR_ADD(graph, off); in graph_nodes_populate()
99 __rte_node_stream_alloc(graph, node); in graph_nodes_populate()
104 graph_node_id_to_ptr(const struct rte_graph *graph, rte_node_t id) in graph_node_id_to_ptr() argument
110 rte_graph_foreach_node(count, off, graph, node) in graph_node_id_to_ptr()
118 graph_node_name_to_ptr(const struct rte_graph *graph, const char *name) in graph_node_name_to_ptr() argument
124 rte_graph_foreach_node(count, off, graph, node) in graph_node_name_to_ptr()
132 graph_node_nexts_populate(struct graph *_graph) in graph_node_nexts_populate()
137 const struct rte_graph *graph = _graph->graph; in graph_node_nexts_populate() local
140 rte_graph_foreach_node(count, off, graph, node) { in graph_node_nexts_populate()
143 node->nodes[val] = graph_node_name_to_ptr(graph, name); in graph_node_nexts_populate()
155 graph_src_nodes_populate(struct graph *_graph) in graph_src_nodes_populate()
157 struct rte_graph *graph = _graph->graph; in graph_src_nodes_populate() local
166 node = graph_node_name_to_ptr(graph, name); in graph_src_nodes_populate()
170 __rte_node_stream_alloc(graph, node); in graph_src_nodes_populate()
171 graph->cir_start[head--] = node->off; in graph_src_nodes_populate()
181 graph_fp_mem_populate(struct graph *graph) in graph_fp_mem_populate() argument
185 graph_header_popluate(graph); in graph_fp_mem_populate()
186 graph_nodes_populate(graph); in graph_fp_mem_populate()
187 rc = graph_node_nexts_populate(graph); in graph_fp_mem_populate()
188 rc |= graph_src_nodes_populate(graph); in graph_fp_mem_populate()
194 graph_fp_mem_create(struct graph *graph) in graph_fp_mem_create() argument
199 sz = graph_fp_mem_calc_size(graph); in graph_fp_mem_create()
200 mz = rte_memzone_reserve(graph->name, sz, graph->socket, 0); in graph_fp_mem_create()
203 graph->name); in graph_fp_mem_create()
205 graph->graph = mz->addr; in graph_fp_mem_create()
206 graph->mz = mz; in graph_fp_mem_create()
208 return graph_fp_mem_populate(graph); in graph_fp_mem_create()
214 graph_nodes_mem_destroy(struct rte_graph *graph) in graph_nodes_mem_destroy() argument
220 if (graph == NULL) in graph_nodes_mem_destroy()
223 rte_graph_foreach_node(count, off, graph, node) in graph_nodes_mem_destroy()
228 graph_fp_mem_destroy(struct graph *graph) in graph_fp_mem_destroy() argument
230 graph_nodes_mem_destroy(graph->graph); in graph_fp_mem_destroy()
231 return rte_memzone_free(graph->mz); in graph_fp_mem_destroy()