| 1254 | } |
| 1255 | |
| 1256 | int |
| 1257 | main(int argc, char **argv) |
| 1258 | { |
| 1259 | struct l2fwd_macsec_options options = {0}; |
| 1260 | struct lcore_queue_conf *qconf; |
| 1261 | int ret; |
| 1262 | uint16_t nb_ports; |
| 1263 | uint16_t nb_ports_available = 0; |
| 1264 | uint16_t portid, last_port; |
| 1265 | unsigned int lcore_id, rx_lcore_id; |
| 1266 | unsigned int nb_ports_in_mask = 0; |
| 1267 | unsigned int nb_lcores = 0; |
| 1268 | unsigned int nb_mbufs; |
| 1269 | uint16_t nb_sess = 512; |
| 1270 | uint32_t sess_sz; |
| 1271 | char s[64]; |
| 1272 | |
| 1273 | /* Init EAL. 8< */ |
| 1274 | ret = rte_eal_init(argc, argv); |
| 1275 | if (ret < 0) |
| 1276 | rte_exit(EXIT_FAILURE, "Invalid EAL arguments\n"); |
| 1277 | argc -= ret; |
| 1278 | argv += ret; |
| 1279 | |
| 1280 | force_quit = false; |
| 1281 | signal(SIGINT, signal_handler); |
| 1282 | signal(SIGTERM, signal_handler); |
| 1283 | |
| 1284 | /* parse application arguments (after the EAL ones) */ |
| 1285 | ret = l2fwd_parse_args(&options, argc, argv); |
| 1286 | if (ret < 0) |
| 1287 | rte_exit(EXIT_FAILURE, "Invalid L2FWD arguments\n"); |
| 1288 | /* >8 End of init EAL. */ |
| 1289 | |
| 1290 | printf("MAC updating %s\n", mac_updating ? "enabled" : "disabled"); |
| 1291 | |
| 1292 | /* convert to number of cycles */ |
| 1293 | timer_period *= rte_get_timer_hz(); |
| 1294 | |
| 1295 | nb_ports = rte_eth_dev_count_avail(); |
| 1296 | if (nb_ports == 0) |
| 1297 | rte_exit(EXIT_FAILURE, "No Ethernet ports - bye\n"); |
| 1298 | |
| 1299 | if (port_pair_params != NULL) { |
| 1300 | if (check_port_pair_config() < 0) |
| 1301 | rte_exit(EXIT_FAILURE, "Invalid port pair config\n"); |
| 1302 | } |
| 1303 | |
| 1304 | /* check port mask to possible port mask */ |
| 1305 | if (l2fwd_enabled_port_mask & ~((1 << nb_ports) - 1)) |
| 1306 | rte_exit(EXIT_FAILURE, "Invalid portmask; possible (0x%x)\n", |
| 1307 | (1 << nb_ports) - 1); |
| 1308 | |
| 1309 | /* Initialization of the driver. 8< */ |
| 1310 | |
| 1311 | /* reset l2fwd_dst_ports */ |
| 1312 | for (portid = 0; portid < RTE_MAX_ETHPORTS; portid++) |
| 1313 | l2fwd_dst_ports[portid] = 0; |
nothing calls this directly
no test coverage detected