| 857 | } |
| 858 | |
| 859 | int |
| 860 | main(int argc, char **argv) |
| 861 | { |
| 862 | struct lcore_queue_conf *qconf; |
| 863 | struct rte_eth_dev_info dev_info; |
| 864 | struct rte_eth_txconf *txconf; |
| 865 | struct rx_queue *rxq; |
| 866 | int socket, ret; |
| 867 | uint16_t nb_ports; |
| 868 | uint16_t queueid = 0; |
| 869 | unsigned lcore_id = 0, rx_lcore_id = 0; |
| 870 | uint32_t n_tx_queue, nb_lcores; |
| 871 | uint16_t portid; |
| 872 | |
| 873 | /* init EAL */ |
| 874 | ret = rte_eal_init(argc, argv); |
| 875 | if (ret < 0) |
| 876 | rte_exit(EXIT_FAILURE, "rte_eal_init failed"); |
| 877 | argc -= ret; |
| 878 | argv += ret; |
| 879 | |
| 880 | /* parse application arguments (after the EAL ones) */ |
| 881 | ret = parse_args(argc, argv); |
| 882 | if (ret < 0) |
| 883 | rte_exit(EXIT_FAILURE, "Invalid arguments"); |
| 884 | |
| 885 | nb_ports = rte_eth_dev_count_avail(); |
| 886 | if (nb_ports == 0) |
| 887 | rte_exit(EXIT_FAILURE, "No ports found!\n"); |
| 888 | |
| 889 | nb_lcores = rte_lcore_count(); |
| 890 | |
| 891 | /* initialize structures (mempools, lpm etc.) */ |
| 892 | if (init_mem() < 0) |
| 893 | rte_panic("Cannot initialize memory structures!\n"); |
| 894 | |
| 895 | /* check if portmask has non-existent ports */ |
| 896 | if (enabled_port_mask & ~(RTE_LEN2MASK(nb_ports, unsigned))) |
| 897 | rte_exit(EXIT_FAILURE, "Non-existent ports in portmask!\n"); |
| 898 | |
| 899 | /* initialize all ports */ |
| 900 | RTE_ETH_FOREACH_DEV(portid) { |
| 901 | struct rte_eth_conf local_port_conf = port_conf; |
| 902 | struct rte_eth_rxconf rxq_conf; |
| 903 | |
| 904 | /* skip ports that are not enabled */ |
| 905 | if ((enabled_port_mask & (1 << portid)) == 0) { |
| 906 | printf("Skipping disabled port %d\n", portid); |
| 907 | continue; |
| 908 | } |
| 909 | |
| 910 | qconf = &lcore_queue_conf[rx_lcore_id]; |
| 911 | |
| 912 | /* limit the frame size to the maximum supported by NIC */ |
| 913 | ret = rte_eth_dev_info_get(portid, &dev_info); |
| 914 | if (ret != 0) |
| 915 | rte_exit(EXIT_FAILURE, |
| 916 | "Error during getting device (port %u) info: %s\n", |
nothing calls this directly
no test coverage detected