| 661 | } |
| 662 | |
| 663 | static int |
| 664 | test_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 | |
| 698 | static int |
| 699 | test_graph_id_collisions(void) |
nothing calls this directly
no test coverage detected