| 180 | } |
| 181 | |
| 182 | int |
| 183 | main(int argc, char **argv) |
| 184 | { |
| 185 | int rc; |
| 186 | |
| 187 | /* Parse application arguments */ |
| 188 | rc = app_args_parse(argc, argv); |
| 189 | if (rc < 0) |
| 190 | return rc; |
| 191 | |
| 192 | /* EAL */ |
| 193 | rc = rte_eal_init(argc, argv); |
| 194 | if (rc < 0) { |
| 195 | printf("Error: EAL initialization failed (%d)\n", rc); |
| 196 | return rc; |
| 197 | }; |
| 198 | |
| 199 | force_quit = false; |
| 200 | signal(SIGINT, signal_handler); |
| 201 | signal(SIGTERM, signal_handler); |
| 202 | |
| 203 | cli_init(); |
| 204 | |
| 205 | /* Script */ |
| 206 | if (app.script_name) { |
| 207 | cli_script_process(app.script_name, app.conn.msg_in_len_max, |
| 208 | app.conn.msg_out_len_max, NULL); |
| 209 | } |
| 210 | |
| 211 | /* Connectivity */ |
| 212 | app.conn.msg_handle_arg = NULL; |
| 213 | conn = conn_init(&app.conn); |
| 214 | if (!conn) { |
| 215 | printf("Error: Connectivity initialization failed\n"); |
| 216 | goto exit; |
| 217 | }; |
| 218 | |
| 219 | rte_delay_ms(1); |
| 220 | printf("Press enter to exit\n"); |
| 221 | |
| 222 | /* Dispatch loop */ |
| 223 | while (!force_quit) { |
| 224 | conn_req_poll(conn); |
| 225 | |
| 226 | conn_msg_poll(conn); |
| 227 | if (app_graph_exit()) |
| 228 | force_quit = true; |
| 229 | } |
| 230 | |
| 231 | exit: |
| 232 | conn_free(conn); |
| 233 | ethdev_stop(); |
| 234 | cli_exit(); |
| 235 | rte_eal_cleanup(); |
| 236 | return 0; |
| 237 | } |
nothing calls this directly
no test coverage detected