Lines Matching refs:graph
16 graph_fp_mem_calc_size(struct graph *graph) in graph_fp_mem_calc_size() argument
25 sz += sizeof(rte_graph_off_t) * graph->src_node_count; in graph_fp_mem_calc_size()
27 val = rte_align32pow2(graph->node_count * sizeof(rte_graph_off_t)); in graph_fp_mem_calc_size()
29 graph->cir_start = sz; in graph_fp_mem_calc_size()
30 graph->cir_mask = rte_align32pow2(graph->node_count) - 1; in graph_fp_mem_calc_size()
35 graph->nodes_start = sz; in graph_fp_mem_calc_size()
37 STAILQ_FOREACH(graph_node, &graph->node_list, next) { in graph_fp_mem_calc_size()
44 graph->mem_sz = sz; in graph_fp_mem_calc_size()
49 graph_header_popluate(struct graph *_graph) in graph_header_popluate()
51 struct rte_graph *graph = _graph->graph; in graph_header_popluate() local
53 graph->tail = 0; in graph_header_popluate()
54 graph->head = (int32_t)-_graph->src_node_count; in graph_header_popluate()
55 graph->cir_mask = _graph->cir_mask; in graph_header_popluate()
56 graph->nb_nodes = _graph->node_count; in graph_header_popluate()
57 graph->cir_start = RTE_PTR_ADD(graph, _graph->cir_start); in graph_header_popluate()
58 graph->nodes_start = _graph->nodes_start; in graph_header_popluate()
59 graph->socket = _graph->socket; in graph_header_popluate()
60 graph->id = _graph->id; in graph_header_popluate()
61 memcpy(graph->name, _graph->name, RTE_GRAPH_NAMESIZE); in graph_header_popluate()
62 graph->fence = RTE_GRAPH_FENCE; in graph_header_popluate()
66 graph_nodes_populate(struct graph *_graph) in graph_nodes_populate()
69 struct rte_graph *graph = _graph->graph; in graph_nodes_populate() local
76 struct rte_node *node = RTE_PTR_ADD(graph, off); in graph_nodes_populate()
101 __rte_node_stream_alloc(graph, node); in graph_nodes_populate()
106 graph_node_id_to_ptr(const struct rte_graph *graph, rte_node_t id) in graph_node_id_to_ptr() argument
112 rte_graph_foreach_node(count, off, graph, node) in graph_node_id_to_ptr()
120 graph_node_name_to_ptr(const struct rte_graph *graph, const char *name) in graph_node_name_to_ptr() argument
126 rte_graph_foreach_node(count, off, graph, node) in graph_node_name_to_ptr()
134 graph_node_nexts_populate(struct graph *_graph) in graph_node_nexts_populate()
139 const struct rte_graph *graph = _graph->graph; in graph_node_nexts_populate() local
142 rte_graph_foreach_node(count, off, graph, node) { in graph_node_nexts_populate()
145 node->nodes[val] = graph_node_name_to_ptr(graph, name); in graph_node_nexts_populate()
157 graph_src_nodes_populate(struct graph *_graph) in graph_src_nodes_populate()
159 struct rte_graph *graph = _graph->graph; in graph_src_nodes_populate() local
168 node = graph_node_name_to_ptr(graph, name); in graph_src_nodes_populate()
172 __rte_node_stream_alloc(graph, node); in graph_src_nodes_populate()
173 graph->cir_start[head--] = node->off; in graph_src_nodes_populate()
183 graph_fp_mem_populate(struct graph *graph) in graph_fp_mem_populate() argument
187 graph_header_popluate(graph); in graph_fp_mem_populate()
188 graph_nodes_populate(graph); in graph_fp_mem_populate()
189 rc = graph_node_nexts_populate(graph); in graph_fp_mem_populate()
190 rc |= graph_src_nodes_populate(graph); in graph_fp_mem_populate()
196 graph_fp_mem_create(struct graph *graph) in graph_fp_mem_create() argument
201 sz = graph_fp_mem_calc_size(graph); in graph_fp_mem_create()
202 mz = rte_memzone_reserve(graph->name, sz, graph->socket, 0); in graph_fp_mem_create()
205 graph->name); in graph_fp_mem_create()
207 graph->graph = mz->addr; in graph_fp_mem_create()
208 graph->mz = mz; in graph_fp_mem_create()
210 return graph_fp_mem_populate(graph); in graph_fp_mem_create()
216 graph_nodes_mem_destroy(struct rte_graph *graph) in graph_nodes_mem_destroy() argument
222 if (graph == NULL) in graph_nodes_mem_destroy()
225 rte_graph_foreach_node(count, off, graph, node) in graph_nodes_mem_destroy()
230 graph_fp_mem_destroy(struct graph *graph) in graph_fp_mem_destroy() argument
232 graph_nodes_mem_destroy(graph->graph); in graph_fp_mem_destroy()
233 return rte_memzone_free(graph->mz); in graph_fp_mem_destroy()