| 961 | } |
| 962 | |
| 963 | static void |
| 964 | graph_config_rtc(struct rte_graph_param graph_conf) |
| 965 | { |
| 966 | uint16_t nb_patterns = graph_conf.nb_node_patterns; |
| 967 | struct lcore_conf *qconf; |
| 968 | rte_graph_t graph_id; |
| 969 | uint32_t lcore_id; |
| 970 | rte_edge_t i; |
| 971 | |
| 972 | for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) { |
| 973 | if (rte_lcore_is_enabled(lcore_id) == 0) |
| 974 | continue; |
| 975 | |
| 976 | qconf = &lcore_conf[lcore_id]; |
| 977 | /* Skip graph creation if no source exists */ |
| 978 | if (!qconf->n_rx_queue) |
| 979 | continue; |
| 980 | /* Add rx node patterns of this lcore */ |
| 981 | for (i = 0; i < qconf->n_rx_queue; i++) { |
| 982 | graph_conf.node_patterns[nb_patterns + i] = |
| 983 | qconf->rx_queue_list[i].node_name; |
| 984 | } |
| 985 | graph_conf.nb_node_patterns = nb_patterns + i; |
| 986 | graph_conf.socket_id = rte_lcore_to_socket_id(lcore_id); |
| 987 | snprintf(qconf->name, sizeof(qconf->name), "worker_%u", |
| 988 | lcore_id); |
| 989 | graph_id = rte_graph_create(qconf->name, &graph_conf); |
| 990 | if (graph_id == RTE_GRAPH_ID_INVALID) |
| 991 | rte_exit(EXIT_FAILURE, |
| 992 | "rte_graph_create(): graph_id invalid for lcore %u\n", |
| 993 | lcore_id); |
| 994 | qconf->graph_id = graph_id; |
| 995 | qconf->graph = rte_graph_lookup(qconf->name); |
| 996 | if (!qconf->graph) |
| 997 | rte_exit(EXIT_FAILURE, |
| 998 | "rte_graph_lookup(): graph %s not found\n", |
| 999 | qconf->name); |
| 1000 | } |
| 1001 | } |
| 1002 | |
| 1003 | int |
| 1004 | main(int argc, char **argv) |
no test coverage detected