| 642 | } |
| 643 | |
| 644 | int |
| 645 | main(int argc, char **argv) |
| 646 | { |
| 647 | struct lcore_queue_conf *qconf; |
| 648 | struct rte_eth_dev_info dev_info; |
| 649 | struct rte_eth_txconf *txconf; |
| 650 | int ret; |
| 651 | uint16_t queueid; |
| 652 | unsigned lcore_id = 0, rx_lcore_id = 0; |
| 653 | uint32_t n_tx_queue, nb_lcores; |
| 654 | uint16_t portid; |
| 655 | |
| 656 | /* init EAL */ |
| 657 | ret = rte_eal_init(argc, argv); |
| 658 | if (ret < 0) |
| 659 | rte_exit(EXIT_FAILURE, "Invalid EAL parameters\n"); |
| 660 | argc -= ret; |
| 661 | argv += ret; |
| 662 | |
| 663 | /* parse application arguments (after the EAL ones) */ |
| 664 | ret = parse_args(argc, argv); |
| 665 | if (ret < 0) |
| 666 | rte_exit(EXIT_FAILURE, "Invalid IPV4_MULTICAST parameters\n"); |
| 667 | |
| 668 | /* Create the mbuf pools. 8< */ |
| 669 | packet_pool = rte_pktmbuf_pool_create("packet_pool", NB_PKT_MBUF, 32, |
| 670 | 0, PKT_MBUF_DATA_SIZE, rte_socket_id()); |
| 671 | |
| 672 | if (packet_pool == NULL) |
| 673 | rte_exit(EXIT_FAILURE, "Cannot init packet mbuf pool\n"); |
| 674 | |
| 675 | header_pool = rte_pktmbuf_pool_create("header_pool", NB_HDR_MBUF, 32, |
| 676 | 0, HDR_MBUF_DATA_SIZE, rte_socket_id()); |
| 677 | |
| 678 | if (header_pool == NULL) |
| 679 | rte_exit(EXIT_FAILURE, "Cannot init header mbuf pool\n"); |
| 680 | |
| 681 | clone_pool = rte_pktmbuf_pool_create("clone_pool", NB_CLONE_MBUF, 32, |
| 682 | 0, 0, rte_socket_id()); |
| 683 | |
| 684 | if (clone_pool == NULL) |
| 685 | rte_exit(EXIT_FAILURE, "Cannot init clone mbuf pool\n"); |
| 686 | /* >8 End of create mbuf pools. */ |
| 687 | |
| 688 | nb_ports = rte_eth_dev_count_avail(); |
| 689 | if (nb_ports == 0) |
| 690 | rte_exit(EXIT_FAILURE, "No physical ports!\n"); |
| 691 | if (nb_ports > MAX_PORTS) |
| 692 | nb_ports = MAX_PORTS; |
| 693 | |
| 694 | nb_lcores = rte_lcore_count(); |
| 695 | |
| 696 | /* initialize all ports */ |
| 697 | RTE_ETH_FOREACH_DEV(portid) { |
| 698 | struct rte_eth_rxconf rxq_conf; |
| 699 | struct rte_eth_conf local_port_conf = port_conf; |
| 700 | |
| 701 | /* skip ports that are not enabled */ |
nothing calls this directly
no test coverage detected