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

Function pkt_burst_5tuple_swap

dpdk/app/test-pmd/5tswap.c:28–46  ·  view source on GitHub ↗

* 5 tuple swap forwarding mode: Swap the source and the destination of layers * 2,3,4. Swaps source and destination for MAC, IPv4/IPv6, UDP/TCP. * Parses each layer and swaps it. When the next layer doesn't match it stops. */

Source from the content-addressed store, hash-verified

26 * Parses each layer and swaps it. When the next layer doesn't match it stops.
27 */
28static bool
29pkt_burst_5tuple_swap(struct fwd_stream *fs)
30{
31 struct rte_mbuf *pkts_burst[MAX_PKT_BURST];
32 uint16_t nb_rx;
33
34 /*
35 * Receive a burst of packets and forward them.
36 */
37 nb_rx = common_fwd_stream_receive(fs, pkts_burst, nb_pkt_per_burst);
38 if (unlikely(nb_rx == 0))
39 return false;
40
41 do_5tswap(pkts_burst, nb_rx, fs);
42
43 common_fwd_stream_transmit(fs, pkts_burst, nb_rx);
44
45 return true;
46}
47
48struct fwd_engine five_tuple_swap_fwd_engine = {
49 .fwd_mode_name = "5tswap",

Callers

nothing calls this directly

Calls 3

do_5tswapFunction · 0.85

Tested by

no test coverage detected