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

Function pkt_burst_mac_swap

dpdk/app/test-pmd/macswap.c:50–67  ·  view source on GitHub ↗

* MAC swap forwarding mode: Swap the source and the destination Ethernet * addresses of packets before forwarding them. */

Source from the content-addressed store, hash-verified

48 * addresses of packets before forwarding them.
49 */
50static bool
51pkt_burst_mac_swap(struct fwd_stream *fs)
52{
53 struct rte_mbuf *pkts_burst[MAX_PKT_BURST];
54 uint16_t nb_rx;
55
56 /*
57 * Receive a burst of packets and forward them.
58 */
59 nb_rx = common_fwd_stream_receive(fs, pkts_burst, nb_pkt_per_burst);
60 if (unlikely(nb_rx == 0))
61 return false;
62
63 do_macswap(pkts_burst, nb_rx, &ports[fs->tx_port]);
64 common_fwd_stream_transmit(fs, pkts_burst, nb_rx);
65
66 return true;
67}
68
69struct fwd_engine mac_swap_engine = {
70 .fwd_mode_name = "macswap",

Callers

nothing calls this directly

Calls 3

do_macswapFunction · 0.70

Tested by

no test coverage detected