MCPcopy Create free account
hub / github.com/F-Stack/f-stack / main

Function main

dpdk/examples/ipv4_multicast/main.c:644–831  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

642}
643
644int
645main(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 */

Callers

nothing calls this directly

Calls 15

rte_exitFunction · 0.85
rte_pktmbuf_pool_createFunction · 0.85
rte_socket_idFunction · 0.85
rte_eth_dev_count_availFunction · 0.85
rte_lcore_countFunction · 0.85
rte_eth_dev_info_getFunction · 0.85
rte_lcore_is_enabledFunction · 0.85
rte_eth_dev_configureFunction · 0.85
rte_eth_macaddr_getFunction · 0.85
rte_eth_rx_queue_setupFunction · 0.85
rte_eth_dev_socket_idFunction · 0.85

Tested by

no test coverage detected