| 647 | } |
| 648 | |
| 649 | int |
| 650 | main(int argc, char **argv) |
| 651 | { |
| 652 | struct lcore_queue_conf *qconf; |
| 653 | int ret; |
| 654 | uint16_t nb_ports; |
| 655 | uint16_t nb_ports_available = 0; |
| 656 | uint16_t portid, last_port; |
| 657 | unsigned lcore_id, rx_lcore_id; |
| 658 | unsigned nb_ports_in_mask = 0; |
| 659 | unsigned int nb_lcores = 0; |
| 660 | unsigned int nb_mbufs; |
| 661 | |
| 662 | /* Init EAL. 8< */ |
| 663 | ret = rte_eal_init(argc, argv); |
| 664 | if (ret < 0) |
| 665 | rte_exit(EXIT_FAILURE, "Invalid EAL arguments\n"); |
| 666 | argc -= ret; |
| 667 | argv += ret; |
| 668 | |
| 669 | force_quit = false; |
| 670 | signal(SIGINT, signal_handler); |
| 671 | signal(SIGTERM, signal_handler); |
| 672 | |
| 673 | /* parse application arguments (after the EAL ones) */ |
| 674 | ret = l2fwd_parse_args(argc, argv); |
| 675 | if (ret < 0) |
| 676 | rte_exit(EXIT_FAILURE, "Invalid L2FWD arguments\n"); |
| 677 | /* >8 End of init EAL. */ |
| 678 | |
| 679 | printf("MAC updating %s\n", mac_updating ? "enabled" : "disabled"); |
| 680 | |
| 681 | /* convert to number of cycles */ |
| 682 | timer_period *= rte_get_timer_hz(); |
| 683 | |
| 684 | nb_ports = rte_eth_dev_count_avail(); |
| 685 | if (nb_ports == 0) |
| 686 | rte_exit(EXIT_FAILURE, "No Ethernet ports - bye\n"); |
| 687 | |
| 688 | if (port_pair_params != NULL) { |
| 689 | if (check_port_pair_config() < 0) |
| 690 | rte_exit(EXIT_FAILURE, "Invalid port pair config\n"); |
| 691 | } |
| 692 | |
| 693 | /* check port mask to possible port mask */ |
| 694 | if (l2fwd_enabled_port_mask & ~((1 << nb_ports) - 1)) |
| 695 | rte_exit(EXIT_FAILURE, "Invalid portmask; possible (0x%x)\n", |
| 696 | (1 << nb_ports) - 1); |
| 697 | |
| 698 | /* Initialization of the driver. 8< */ |
| 699 | |
| 700 | /* reset l2fwd_dst_ports */ |
| 701 | for (portid = 0; portid < RTE_MAX_ETHPORTS; portid++) |
| 702 | l2fwd_dst_ports[portid] = 0; |
| 703 | last_port = 0; |
| 704 | |
| 705 | /* populate destination port details */ |
| 706 | if (port_pair_params != NULL) { |
nothing calls this directly
no test coverage detected