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

Function test_graph_clone

dpdk/app/test/test_graph.c:663–696  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

661}
662
663static int
664test_graph_clone(void)
665{
666 rte_graph_t cloned_graph_id = RTE_GRAPH_ID_INVALID;
667 rte_graph_t main_graph_id = RTE_GRAPH_ID_INVALID;
668 struct rte_graph_param graph_conf = {0};
669 int ret = 0;
670
671 main_graph_id = rte_graph_from_name("worker0");
672 if (main_graph_id == RTE_GRAPH_ID_INVALID) {
673 printf("Must create main graph first\n");
674 ret = -1;
675 }
676
677 graph_conf.dispatch.mp_capacity = 1024;
678 graph_conf.dispatch.wq_size_max = 32;
679
680 cloned_graph_id = rte_graph_clone(main_graph_id, "cloned-test0", &graph_conf);
681
682 if (cloned_graph_id == RTE_GRAPH_ID_INVALID) {
683 printf("Graph creation failed with error = %d\n", rte_errno);
684 ret = -1;
685 }
686
687 if (strcmp(rte_graph_id_to_name(cloned_graph_id), "worker0-cloned-test0")) {
688 printf("Cloned graph should name as %s but get %s\n", "worker0-cloned-test",
689 rte_graph_id_to_name(cloned_graph_id));
690 ret = -1;
691 }
692
693 rte_graph_destroy(cloned_graph_id);
694
695 return ret;
696}
697
698static int
699test_graph_id_collisions(void)

Callers

nothing calls this directly

Calls 6

rte_graph_from_nameFunction · 0.85
rte_graph_cloneFunction · 0.85
strcmpFunction · 0.85
rte_graph_id_to_nameFunction · 0.85
rte_graph_destroyFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected