1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2014 Intel Corporation
13 #include <sys/queue.h>
16 #include <rte_common.h>
17 #include <rte_byteorder.h>
19 #include <rte_debug.h>
20 #include <rte_cycles.h>
21 #include <rte_memory.h>
22 #include <rte_memcpy.h>
23 #include <rte_launch.h>
25 #include <rte_per_lcore.h>
26 #include <rte_lcore.h>
27 #include <rte_atomic.h>
28 #include <rte_branch_prediction.h>
29 #include <rte_mempool.h>
31 #include <rte_interrupts.h>
33 #include <rte_ether.h>
34 #include <rte_ethdev.h>
35 #include <rte_string_fns.h>
44 * Received a burst of packets.
47 pkt_burst_receive(struct fwd_stream *fs)
49 struct rte_mbuf *pkts_burst[MAX_PKT_BURST];
52 uint64_t start_tsc = 0;
54 get_start_cycles(&start_tsc);
57 * Receive a burst of packets.
59 nb_rx = rte_eth_rx_burst(fs->rx_port, fs->rx_queue, pkts_burst,
61 #ifdef RTE_TEST_PMD_RECORD_BURST_STATS
62 fs->rx_burst_stats.pkt_burst_spread[nb_rx]++;
64 if (unlikely(nb_rx == 0))
67 fs->rx_packets += nb_rx;
68 for (i = 0; i < nb_rx; i++)
69 rte_pktmbuf_free(pkts_burst[i]);
71 get_end_cycles(fs, start_tsc);
74 struct fwd_engine rx_only_engine = {
75 .fwd_mode_name = "rxonly",
76 .port_fwd_begin = NULL,
78 .packet_fwd = pkt_burst_receive,