MCPcopy Create free account
hub / github.com/F-Stack/f-stack / graph_init

Function graph_init

dpdk/app/test/test_graph_perf.c:316–609  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

314}
315
316static int
317graph_init(const char *gname, uint8_t nb_srcs, uint8_t nb_sinks,
318 uint32_t stages, uint16_t nodes_per_stage,
319 uint8_t src_map[][nodes_per_stage], uint8_t snk_map[][nb_sinks],
320 uint8_t edge_map[][nodes_per_stage][nodes_per_stage],
321 uint8_t burst_one)
322{
323 struct test_graph_perf *graph_data;
324 char nname[RTE_NODE_NAMESIZE / 2];
325 struct test_node_data *node_data;
326 char *ename[nodes_per_stage];
327 struct rte_graph_param gconf = {0};
328 const struct rte_memzone *mz;
329 uint8_t total_percent = 0;
330 rte_node_t *src_nodes;
331 rte_node_t *snk_nodes;
332 rte_node_t **node_map;
333 char **node_patterns;
334 rte_graph_t graph_id;
335 rte_edge_t edges;
336 rte_edge_t count;
337 uint32_t i, j, k;
338
339 mz = rte_memzone_reserve(TEST_GRAPH_PERF_MZ,
340 sizeof(struct test_graph_perf), 0, 0);
341 if (mz == NULL) {
342 printf("Failed to allocate graph common memory\n");
343 return -ENOMEM;
344 }
345
346 graph_data = mz->addr;
347 graph_data->nb_nodes = 0;
348 graph_data->node_data =
349 malloc(sizeof(struct test_node_data) *
350 (nb_srcs + nb_sinks + stages * nodes_per_stage));
351 if (graph_data->node_data == NULL) {
352 printf("Failed to reserve memzone for graph data\n");
353 goto memzone_free;
354 }
355
356 node_patterns = malloc(sizeof(char *) *
357 (nb_srcs + nb_sinks + stages * nodes_per_stage));
358 if (node_patterns == NULL) {
359 printf("Failed to reserve memory for node patterns\n");
360 goto data_free;
361 }
362
363 src_nodes = malloc(sizeof(rte_node_t) * nb_srcs);
364 if (src_nodes == NULL) {
365 printf("Failed to reserve memory for src nodes\n");
366 goto pattern_free;
367 }
368
369 snk_nodes = malloc(sizeof(rte_node_t) * nb_sinks);
370 if (snk_nodes == NULL) {
371 printf("Failed to reserve memory for snk nodes\n");
372 goto src_free;
373 }

Callers 7

graph_init_hrFunction · 0.70
graph_init_hr_brst_oneFunction · 0.70
graph_init_hr_multi_srcFunction · 0.70
graph_init_hr_multi_snkFunction · 0.70
graph_init_treeFunction · 0.70
graph_init_reverse_treeFunction · 0.70
graph_init_parallel_treeFunction · 0.70

Calls 12

rte_memzone_reserveFunction · 0.85
mallocFunction · 0.85
snprintfFunction · 0.85
graph_node_getFunction · 0.85
rte_node_id_to_nameFunction · 0.85
graph_get_node_dataFunction · 0.85
graph_node_count_edgesFunction · 0.85
rte_node_edge_updateFunction · 0.85
rte_graph_createFunction · 0.85
rte_memzone_freeFunction · 0.85
printfFunction · 0.50
freeFunction · 0.50

Tested by

no test coverage detected