1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2014 Intel Corporation
11 #include <sys/queue.h>
16 #include <rte_common.h>
17 #include <rte_byteorder.h>
19 #include <rte_memory.h>
20 #include <rte_memcpy.h>
22 #include <rte_launch.h>
23 #include <rte_cycles.h>
24 #include <rte_prefetch.h>
25 #include <rte_lcore.h>
26 #include <rte_per_lcore.h>
27 #include <rte_branch_prediction.h>
28 #include <rte_interrupts.h>
29 #include <rte_random.h>
30 #include <rte_debug.h>
31 #include <rte_ether.h>
32 #include <rte_ethdev.h>
33 #include <rte_mempool.h>
35 #include <rte_malloc.h>
36 #include <rte_fbk_hash.h>
39 #define RTE_LOGTYPE_IPv4_MULTICAST RTE_LOGTYPE_USER1
43 #define MCAST_CLONE_PORTS 2
44 #define MCAST_CLONE_SEGS 2
46 #define PKT_MBUF_DATA_SIZE RTE_MBUF_DEFAULT_BUF_SIZE
47 #define NB_PKT_MBUF 8192
49 #define HDR_MBUF_DATA_SIZE (2 * RTE_PKTMBUF_HEADROOM)
50 #define NB_HDR_MBUF (NB_PKT_MBUF * MAX_PORTS)
52 #define NB_CLONE_MBUF (NB_PKT_MBUF * MCAST_CLONE_PORTS * MCAST_CLONE_SEGS * 2)
54 /* allow max jumbo frame 9.5 KB */
55 #define JUMBO_FRAME_MAX_SIZE 0x2600
57 #define MAX_PKT_BURST 32
58 #define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */
60 /* Configure how many packets ahead to prefetch, when reading packets */
61 #define PREFETCH_OFFSET 3
64 * Construct Ethernet multicast address from IPv4 multicast address.
65 * Citing RFC 1112, section 6.4:
66 * "An IP host group address is mapped to an Ethernet multicast address
67 * by placing the low-order 23-bits of the IP address into the low-order
68 * 23 bits of the Ethernet multicast address 01-00-5E-00-00-00 (hex)."
71 /* Construct Ethernet multicast address from IPv4 multicast Address. 8< */
72 #define ETHER_ADDR_FOR_IPV4_MCAST(x) \
73 (rte_cpu_to_be_64(0x01005e000000ULL | ((x) & 0x7fffff)) >> 16)
74 /* >8 End of Construction of multicast address from IPv4 multicast address. */
77 * Configurable number of RX/TX ring descriptors
79 #define RTE_TEST_RX_DESC_DEFAULT 1024
80 #define RTE_TEST_TX_DESC_DEFAULT 1024
81 static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT;
82 static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT;
84 /* ethernet addresses of ports */
85 static struct rte_ether_addr ports_eth_addr[MAX_PORTS];
87 /* mask of enabled ports */
88 static uint32_t enabled_port_mask = 0;
90 static uint16_t nb_ports;
92 static int rx_queue_per_lcore = 1;
96 struct rte_mbuf *m_table[MAX_PKT_BURST];
99 #define MAX_RX_QUEUE_PER_LCORE 16
100 #define MAX_TX_QUEUE_PER_PORT 16
101 struct lcore_queue_conf {
104 uint8_t rx_queue_list[MAX_RX_QUEUE_PER_LCORE];
105 uint16_t tx_queue_id[MAX_PORTS];
106 struct mbuf_table tx_mbufs[MAX_PORTS];
107 } __rte_cache_aligned;
108 static struct lcore_queue_conf lcore_queue_conf[RTE_MAX_LCORE];
110 static struct rte_eth_conf port_conf = {
112 .max_rx_pkt_len = JUMBO_FRAME_MAX_SIZE,
114 .offloads = DEV_RX_OFFLOAD_JUMBO_FRAME,
117 .mq_mode = ETH_MQ_TX_NONE,
118 .offloads = DEV_TX_OFFLOAD_MULTI_SEGS,
122 static struct rte_mempool *packet_pool, *header_pool, *clone_pool;
126 static struct rte_fbk_hash_params mcast_hash_params = {
127 .name = "MCAST_HASH",
129 .entries_per_bucket = 4,
135 struct rte_fbk_hash_table *mcast_hash = NULL;
137 struct mcast_group_params {
142 static struct mcast_group_params mcast_group_table[] = {
143 {RTE_IPV4(224,0,0,101), 0x1},
144 {RTE_IPV4(224,0,0,102), 0x2},
145 {RTE_IPV4(224,0,0,103), 0x3},
146 {RTE_IPV4(224,0,0,104), 0x4},
147 {RTE_IPV4(224,0,0,105), 0x5},
148 {RTE_IPV4(224,0,0,106), 0x6},
149 {RTE_IPV4(224,0,0,107), 0x7},
150 {RTE_IPV4(224,0,0,108), 0x8},
151 {RTE_IPV4(224,0,0,109), 0x9},
152 {RTE_IPV4(224,0,0,110), 0xA},
153 {RTE_IPV4(224,0,0,111), 0xB},
154 {RTE_IPV4(224,0,0,112), 0xC},
155 {RTE_IPV4(224,0,0,113), 0xD},
156 {RTE_IPV4(224,0,0,114), 0xE},
157 {RTE_IPV4(224,0,0,115), 0xF},
160 /* Send burst of packets on an output interface */
162 send_burst(struct lcore_queue_conf *qconf, uint16_t port)
164 struct rte_mbuf **m_table;
168 queueid = qconf->tx_queue_id[port];
169 m_table = (struct rte_mbuf **)qconf->tx_mbufs[port].m_table;
170 n = qconf->tx_mbufs[port].len;
172 ret = rte_eth_tx_burst(port, queueid, m_table, n);
173 while (unlikely (ret < n)) {
174 rte_pktmbuf_free(m_table[ret]);
178 qconf->tx_mbufs[port].len = 0;
181 /* Get number of bits set. 8< */
182 static inline uint32_t
187 for (n = 0; v != 0; v &= v - 1, n++)
192 /* >8 End of getting number of bits set. */
195 * Create the output multicast packet based on the given input packet.
196 * There are two approaches for creating outgoing packet, though both
197 * are based on data zero-copy idea, they differ in few details:
198 * First one creates a clone of the input packet, e.g - walk though all
199 * segments of the input packet, and for each of them create a new packet
200 * mbuf and attach that new mbuf to the segment (refer to rte_pktmbuf_clone()
201 * for more details). Then new mbuf is allocated for the packet header
202 * and is prepended to the 'clone' mbuf.
203 * Second approach doesn't make a clone, it just increment refcnt for all
204 * input packet segments. Then it allocates new mbuf for the packet header
205 * and prepends it to the input packet.
206 * Basically first approach reuses only input packet's data, but creates
207 * it's own copy of packet's metadata. Second approach reuses both input's
208 * packet data and metadata.
209 * The advantage of first approach - is that each outgoing packet has it's
210 * own copy of metadata, so we can safely modify data pointer of the
211 * input packet. That allows us to skip creation if the output packet for
212 * the last destination port, but instead modify input packet's header inplace,
213 * e.g: for N destination ports we need to invoke mcast_out_pkt (N-1) times.
214 * The advantage of second approach - less work for each outgoing packet,
215 * e.g: we skip "clone" operation completely. Though it comes with a price -
216 * input packet's metadata has to be intact. So for N destination ports we
217 * need to invoke mcast_out_pkt N times.
218 * So for small number of outgoing ports (and segments in the input packet)
219 * first approach will be faster.
220 * As number of outgoing ports (and/or input segments) will grow,
221 * second way will become more preferable.
226 * Control which of the two approaches described above should be used:
227 * - 0 - use second approach:
228 * Don't "clone" input packet.
229 * Prepend new header directly to the input packet
230 * - 1 - use first approach:
231 * Make a "clone" of input packet first.
232 * Prepend new header to the clone of the input packet
234 * - The pointer to the new outgoing packet.
235 * - NULL if operation failed.
238 /* mcast_out_pkt 8< */
239 static inline struct rte_mbuf *
240 mcast_out_pkt(struct rte_mbuf *pkt, int use_clone)
242 struct rte_mbuf *hdr;
244 /* Create new mbuf for the header. */
245 if (unlikely ((hdr = rte_pktmbuf_alloc(header_pool)) == NULL))
248 /* If requested, then make a new clone packet. */
249 if (use_clone != 0 &&
250 unlikely ((pkt = rte_pktmbuf_clone(pkt, clone_pool)) == NULL)) {
251 rte_pktmbuf_free(hdr);
255 /* prepend new header */
258 /* update header's fields */
259 hdr->pkt_len = (uint16_t)(hdr->data_len + pkt->pkt_len);
260 hdr->nb_segs = pkt->nb_segs + 1;
262 __rte_mbuf_sanity_check(hdr, 1);
265 /* >8 End of mcast_out_kt. */
268 * Write new Ethernet header to the outgoing packet,
269 * and put it into the outgoing queue for the given port.
272 /* Write new Ethernet header to outgoing packets. 8< */
274 mcast_send_pkt(struct rte_mbuf *pkt, struct rte_ether_addr *dest_addr,
275 struct lcore_queue_conf *qconf, uint16_t port)
277 struct rte_ether_hdr *ethdr;
280 /* Construct Ethernet header. */
281 ethdr = (struct rte_ether_hdr *)
282 rte_pktmbuf_prepend(pkt, (uint16_t)sizeof(*ethdr));
283 RTE_ASSERT(ethdr != NULL);
285 rte_ether_addr_copy(dest_addr, ðdr->dst_addr);
286 rte_ether_addr_copy(&ports_eth_addr[port], ðdr->src_addr);
287 ethdr->ether_type = rte_be_to_cpu_16(RTE_ETHER_TYPE_IPV4);
289 /* Put new packet into the output queue */
290 len = qconf->tx_mbufs[port].len;
291 qconf->tx_mbufs[port].m_table[len] = pkt;
292 qconf->tx_mbufs[port].len = ++len;
294 /* Transmit packets */
295 if (unlikely(MAX_PKT_BURST == len))
296 send_burst(qconf, port);
298 /* >8 End of writing new Ethernet headers. */
300 /* Multicast forward of the input packet */
302 mcast_forward(struct rte_mbuf *m, struct lcore_queue_conf *qconf)
305 struct rte_ipv4_hdr *iphdr;
306 uint32_t dest_addr, port_mask, port_num, use_clone;
311 struct rte_ether_addr as_addr;
314 /* Remove the Ethernet header from the input packet. 8< */
315 iphdr = (struct rte_ipv4_hdr *)
316 rte_pktmbuf_adj(m, (uint16_t)sizeof(struct rte_ether_hdr));
317 RTE_ASSERT(iphdr != NULL);
319 dest_addr = rte_be_to_cpu_32(iphdr->dst_addr);
320 /* >8 End of removing the Ethernet header from the input packet. */
323 * Check that it is a valid multicast address and
324 * we have some active ports assigned to it.
327 /* Check valid multicast address. 8< */
328 if (!RTE_IS_IPV4_MCAST(dest_addr) ||
329 (hash = rte_fbk_hash_lookup(mcast_hash, dest_addr)) <= 0 ||
330 (port_mask = hash & enabled_port_mask) == 0) {
334 /* >8 End of valid multicast address check. */
336 /* Calculate number of destination ports. */
337 port_num = bitcnt(port_mask);
339 /* Should we use rte_pktmbuf_clone() or not. 8< */
340 use_clone = (port_num <= MCAST_CLONE_PORTS &&
341 m->nb_segs <= MCAST_CLONE_SEGS);
342 /* >8 End of using rte_pktmbuf_clone(). */
344 /* Mark all packet's segments as referenced port_num times */
346 rte_pktmbuf_refcnt_update(m, (uint16_t)port_num);
348 /* Construct destination ethernet address. 8< */
349 dst_eth_addr.as_int = ETHER_ADDR_FOR_IPV4_MCAST(dest_addr);
350 /* >8 End of constructing destination ethernet address. */
352 /* Packets dispatched to destination ports. 8< */
353 for (port = 0; use_clone != port_mask; port_mask >>= 1, port++) {
355 /* Prepare output packet and send it out. */
356 if ((port_mask & 1) != 0) {
357 if (likely ((mc = mcast_out_pkt(m, use_clone)) != NULL))
358 mcast_send_pkt(mc, &dst_eth_addr.as_addr,
360 else if (use_clone == 0)
364 /* >8 End of packets dispatched to destination ports. */
367 * If we making clone packets, then, for the last destination port,
368 * we can overwrite input packet's metadata.
371 mcast_send_pkt(m, &dst_eth_addr.as_addr, qconf, port);
376 /* Send burst of outgoing packet, if timeout expires. */
378 send_timeout_burst(struct lcore_queue_conf *qconf)
382 const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) / US_PER_S * BURST_TX_DRAIN_US;
384 cur_tsc = rte_rdtsc();
385 if (likely (cur_tsc < qconf->tx_tsc + drain_tsc))
388 for (portid = 0; portid < MAX_PORTS; portid++) {
389 if (qconf->tx_mbufs[portid].len != 0)
390 send_burst(qconf, portid);
392 qconf->tx_tsc = cur_tsc;
395 /* main processing loop */
397 main_loop(__rte_unused void *dummy)
399 struct rte_mbuf *pkts_burst[MAX_PKT_BURST];
403 struct lcore_queue_conf *qconf;
405 lcore_id = rte_lcore_id();
406 qconf = &lcore_queue_conf[lcore_id];
409 if (qconf->n_rx_queue == 0) {
410 RTE_LOG(INFO, IPv4_MULTICAST, "lcore %u has nothing to do\n",
415 RTE_LOG(INFO, IPv4_MULTICAST, "entering main loop on lcore %u\n",
418 for (i = 0; i < qconf->n_rx_queue; i++) {
420 portid = qconf->rx_queue_list[i];
421 RTE_LOG(INFO, IPv4_MULTICAST, " -- lcoreid=%u portid=%d\n",
428 * Read packet from RX queues
430 for (i = 0; i < qconf->n_rx_queue; i++) {
432 portid = qconf->rx_queue_list[i];
433 nb_rx = rte_eth_rx_burst(portid, 0, pkts_burst,
436 /* Prefetch first packets */
437 for (j = 0; j < PREFETCH_OFFSET && j < nb_rx; j++) {
438 rte_prefetch0(rte_pktmbuf_mtod(
439 pkts_burst[j], void *));
442 /* Prefetch and forward already prefetched packets */
443 for (j = 0; j < (nb_rx - PREFETCH_OFFSET); j++) {
444 rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[
445 j + PREFETCH_OFFSET], void *));
446 mcast_forward(pkts_burst[j], qconf);
449 /* Forward remaining prefetched packets */
450 for (; j < nb_rx; j++) {
451 mcast_forward(pkts_burst[j], qconf);
455 /* Send out packets from TX queues */
456 send_timeout_burst(qconf);
462 print_usage(const char *prgname)
464 printf("%s [EAL options] -- -p PORTMASK [-q NQ]\n"
465 " -p PORTMASK: hexadecimal bitmask of ports to configure\n"
466 " -q NQ: number of queue (=ports) per lcore (default is 1)\n",
471 parse_portmask(const char *portmask)
476 /* parse hexadecimal string */
477 pm = strtoul(portmask, &end, 16);
478 if ((portmask[0] == '\0') || (end == NULL) || (*end != '\0'))
485 parse_nqueue(const char *q_arg)
490 /* parse numerical string */
492 n = strtoul(q_arg, &end, 0);
493 if (errno != 0 || end == NULL || *end != '\0' ||
494 n == 0 || n >= MAX_RX_QUEUE_PER_LCORE)
500 /* Parse the argument given in the command line of the application */
502 parse_args(int argc, char **argv)
507 char *prgname = argv[0];
508 static struct option lgopts[] = {
514 while ((opt = getopt_long(argc, argvopt, "p:q:",
515 lgopts, &option_index)) != EOF) {
520 enabled_port_mask = parse_portmask(optarg);
521 if (enabled_port_mask == 0) {
522 printf("invalid portmask\n");
523 print_usage(prgname);
530 rx_queue_per_lcore = parse_nqueue(optarg);
531 if (rx_queue_per_lcore < 0) {
532 printf("invalid queue number\n");
533 print_usage(prgname);
539 print_usage(prgname);
545 argv[optind-1] = prgname;
548 optind = 1; /* reset getopt lib */
553 print_ethaddr(const char *name, struct rte_ether_addr *eth_addr)
555 char buf[RTE_ETHER_ADDR_FMT_SIZE];
556 rte_ether_format_addr(buf, RTE_ETHER_ADDR_FMT_SIZE, eth_addr);
557 printf("%s%s", name, buf);
560 /* Hash object is created and loaded. 8< */
562 init_mcast_hash(void)
566 mcast_hash_params.socket_id = rte_socket_id();
567 mcast_hash = rte_fbk_hash_create(&mcast_hash_params);
568 if (mcast_hash == NULL){
572 for (i = 0; i < RTE_DIM(mcast_group_table); i++) {
573 if (rte_fbk_hash_add_key(mcast_hash,
574 mcast_group_table[i].ip,
575 mcast_group_table[i].port_mask) < 0) {
582 /* >8 End of hash object is created and loaded. */
584 /* Check the link status of all ports in up to 9s, and print them finally */
586 check_all_ports_link_status(uint32_t port_mask)
588 #define CHECK_INTERVAL 100 /* 100ms */
589 #define MAX_CHECK_TIME 90 /* 9s (90 * 100ms) in total */
591 uint8_t count, all_ports_up, print_flag = 0;
592 struct rte_eth_link link;
594 char link_status_text[RTE_ETH_LINK_MAX_STR_LEN];
596 printf("\nChecking link status");
598 for (count = 0; count <= MAX_CHECK_TIME; count++) {
600 RTE_ETH_FOREACH_DEV(portid) {
601 if ((port_mask & (1 << portid)) == 0)
603 memset(&link, 0, sizeof(link));
604 ret = rte_eth_link_get_nowait(portid, &link);
608 printf("Port %u link get failed: %s\n",
609 portid, rte_strerror(-ret));
612 /* print link status if flag set */
613 if (print_flag == 1) {
614 rte_eth_link_to_str(link_status_text,
615 sizeof(link_status_text),
617 printf("Port %d %s\n", portid,
621 /* clear all_ports_up flag if any link down */
622 if (link.link_status == ETH_LINK_DOWN) {
627 /* after finally printing all link status, get out */
631 if (all_ports_up == 0) {
634 rte_delay_ms(CHECK_INTERVAL);
637 /* set the print_flag if all ports up or timeout */
638 if (all_ports_up == 1 || count == (MAX_CHECK_TIME - 1)) {
646 main(int argc, char **argv)
648 struct lcore_queue_conf *qconf;
649 struct rte_eth_dev_info dev_info;
650 struct rte_eth_txconf *txconf;
653 unsigned lcore_id = 0, rx_lcore_id = 0;
654 uint32_t n_tx_queue, nb_lcores;
658 ret = rte_eal_init(argc, argv);
660 rte_exit(EXIT_FAILURE, "Invalid EAL parameters\n");
664 /* parse application arguments (after the EAL ones) */
665 ret = parse_args(argc, argv);
667 rte_exit(EXIT_FAILURE, "Invalid IPV4_MULTICAST parameters\n");
669 /* Create the mbuf pools. 8< */
670 packet_pool = rte_pktmbuf_pool_create("packet_pool", NB_PKT_MBUF, 32,
671 0, PKT_MBUF_DATA_SIZE, rte_socket_id());
673 if (packet_pool == NULL)
674 rte_exit(EXIT_FAILURE, "Cannot init packet mbuf pool\n");
676 header_pool = rte_pktmbuf_pool_create("header_pool", NB_HDR_MBUF, 32,
677 0, HDR_MBUF_DATA_SIZE, rte_socket_id());
679 if (header_pool == NULL)
680 rte_exit(EXIT_FAILURE, "Cannot init header mbuf pool\n");
682 clone_pool = rte_pktmbuf_pool_create("clone_pool", NB_CLONE_MBUF, 32,
683 0, 0, rte_socket_id());
685 if (clone_pool == NULL)
686 rte_exit(EXIT_FAILURE, "Cannot init clone mbuf pool\n");
687 /* >8 End of create mbuf pools. */
689 nb_ports = rte_eth_dev_count_avail();
691 rte_exit(EXIT_FAILURE, "No physical ports!\n");
692 if (nb_ports > MAX_PORTS)
693 nb_ports = MAX_PORTS;
695 nb_lcores = rte_lcore_count();
697 /* initialize all ports */
698 RTE_ETH_FOREACH_DEV(portid) {
699 struct rte_eth_rxconf rxq_conf;
700 struct rte_eth_conf local_port_conf = port_conf;
702 /* skip ports that are not enabled */
703 if ((enabled_port_mask & (1 << portid)) == 0) {
704 printf("Skipping disabled port %d\n", portid);
708 qconf = &lcore_queue_conf[rx_lcore_id];
710 /* limit the frame size to the maximum supported by NIC */
711 ret = rte_eth_dev_info_get(portid, &dev_info);
713 rte_exit(EXIT_FAILURE,
714 "Error during getting device (port %u) info: %s\n",
715 portid, strerror(-ret));
717 local_port_conf.rxmode.max_rx_pkt_len = RTE_MIN(
718 dev_info.max_rx_pktlen,
719 local_port_conf.rxmode.max_rx_pkt_len);
721 /* get the lcore_id for this port */
722 while (rte_lcore_is_enabled(rx_lcore_id) == 0 ||
723 qconf->n_rx_queue == (unsigned)rx_queue_per_lcore) {
726 qconf = &lcore_queue_conf[rx_lcore_id];
728 if (rx_lcore_id >= RTE_MAX_LCORE)
729 rte_exit(EXIT_FAILURE, "Not enough cores\n");
731 qconf->rx_queue_list[qconf->n_rx_queue] = portid;
735 printf("Initializing port %d on lcore %u... ", portid,
739 n_tx_queue = nb_lcores;
740 if (n_tx_queue > MAX_TX_QUEUE_PER_PORT)
741 n_tx_queue = MAX_TX_QUEUE_PER_PORT;
743 ret = rte_eth_dev_configure(portid, 1, (uint16_t)n_tx_queue,
746 rte_exit(EXIT_FAILURE, "Cannot configure device: err=%d, port=%d\n",
749 ret = rte_eth_dev_adjust_nb_rx_tx_desc(portid, &nb_rxd,
752 rte_exit(EXIT_FAILURE,
753 "Cannot adjust number of descriptors: err=%d, port=%d\n",
756 ret = rte_eth_macaddr_get(portid, &ports_eth_addr[portid]);
758 rte_exit(EXIT_FAILURE,
759 "Cannot get MAC address: err=%d, port=%d\n",
762 print_ethaddr(" Address:", &ports_eth_addr[portid]);
765 /* init one RX queue */
767 printf("rxq=%hu ", queueid);
769 rxq_conf = dev_info.default_rxconf;
770 rxq_conf.offloads = local_port_conf.rxmode.offloads;
771 ret = rte_eth_rx_queue_setup(portid, queueid, nb_rxd,
772 rte_eth_dev_socket_id(portid),
776 rte_exit(EXIT_FAILURE, "rte_eth_tx_queue_setup: err=%d, port=%d\n",
779 /* init one TX queue per couple (lcore,port) */
782 RTE_LCORE_FOREACH(lcore_id) {
783 if (rte_lcore_is_enabled(lcore_id) == 0)
785 printf("txq=%u,%hu ", lcore_id, queueid);
788 txconf = &dev_info.default_txconf;
789 txconf->offloads = local_port_conf.txmode.offloads;
790 ret = rte_eth_tx_queue_setup(portid, queueid, nb_txd,
791 rte_lcore_to_socket_id(lcore_id), txconf);
793 rte_exit(EXIT_FAILURE, "rte_eth_tx_queue_setup: err=%d, "
794 "port=%d\n", ret, portid);
796 qconf = &lcore_queue_conf[lcore_id];
797 qconf->tx_queue_id[portid] = queueid;
800 ret = rte_eth_allmulticast_enable(portid);
802 rte_exit(EXIT_FAILURE,
803 "rte_eth_allmulticast_enable: err=%d, port=%d\n",
806 ret = rte_eth_dev_start(portid);
808 rte_exit(EXIT_FAILURE, "rte_eth_dev_start: err=%d, port=%d\n",
814 check_all_ports_link_status(enabled_port_mask);
816 /* initialize the multicast hash */
817 int retval = init_mcast_hash();
819 rte_exit(EXIT_FAILURE, "Cannot build the multicast hash\n");
821 /* launch per-lcore init on every lcore */
822 rte_eal_mp_remote_launch(main_loop, NULL, CALL_MAIN);
823 RTE_LCORE_FOREACH_WORKER(lcore_id) {
824 if (rte_eal_wait_lcore(lcore_id) < 0)
828 /* clean up the EAL */