| 1533 | #endif |
| 1534 | |
| 1535 | int |
| 1536 | main(int argc, char **argv) |
| 1537 | { |
| 1538 | #ifdef RTE_LIB_EVENTDEV |
| 1539 | struct l3fwd_event_resources *evt_rsrc; |
| 1540 | int i; |
| 1541 | #endif |
| 1542 | struct lcore_conf *qconf; |
| 1543 | uint16_t queueid, portid; |
| 1544 | unsigned int lcore_id; |
| 1545 | uint16_t queue; |
| 1546 | int ret; |
| 1547 | |
| 1548 | /* init EAL */ |
| 1549 | ret = rte_eal_init(argc, argv); |
| 1550 | if (ret < 0) |
| 1551 | rte_exit(EXIT_FAILURE, "Invalid EAL parameters\n"); |
| 1552 | argc -= ret; |
| 1553 | argv += ret; |
| 1554 | |
| 1555 | force_quit = false; |
| 1556 | signal(SIGINT, signal_handler); |
| 1557 | signal(SIGTERM, signal_handler); |
| 1558 | |
| 1559 | /* pre-init dst MACs for all ports to 02:00:00:00:00:xx */ |
| 1560 | for (portid = 0; portid < RTE_MAX_ETHPORTS; portid++) { |
| 1561 | dest_eth_addr[portid] = |
| 1562 | RTE_ETHER_LOCAL_ADMIN_ADDR + ((uint64_t)portid << 40); |
| 1563 | *(uint64_t *)(val_eth + portid) = dest_eth_addr[portid]; |
| 1564 | } |
| 1565 | |
| 1566 | #ifdef RTE_LIB_EVENTDEV |
| 1567 | evt_rsrc = l3fwd_get_eventdev_rsrc(); |
| 1568 | #endif |
| 1569 | /* parse application arguments (after the EAL ones) */ |
| 1570 | ret = parse_args(argc, argv); |
| 1571 | if (ret < 0) |
| 1572 | rte_exit(EXIT_FAILURE, "Invalid L3FWD parameters\n"); |
| 1573 | |
| 1574 | /* Setup function pointers for lookup method. */ |
| 1575 | setup_l3fwd_lookup_tables(); |
| 1576 | |
| 1577 | /* Add the config file rules */ |
| 1578 | l3fwd_lkp.read_config_files(); |
| 1579 | |
| 1580 | #ifdef RTE_LIB_EVENTDEV |
| 1581 | evt_rsrc->per_port_pool = per_port_pool; |
| 1582 | evt_rsrc->pkt_pool = pktmbuf_pool; |
| 1583 | evt_rsrc->vec_pool = vector_pool; |
| 1584 | evt_rsrc->port_mask = enabled_port_mask; |
| 1585 | /* Configure eventdev parameters if user has requested */ |
| 1586 | if (evt_rsrc->enabled) { |
| 1587 | l3fwd_event_resource_setup(&port_conf); |
| 1588 | if (lookup_mode == L3FWD_LOOKUP_EM) |
| 1589 | l3fwd_lkp.main_loop = evt_rsrc->ops.em_event_loop; |
| 1590 | else if (lookup_mode == L3FWD_LOOKUP_FIB) |
| 1591 | l3fwd_lkp.main_loop = evt_rsrc->ops.fib_event_loop; |
| 1592 | else |
nothing calls this directly
no test coverage detected