* MAC swap forwarding mode: Swap the source and the destination Ethernet * addresses of packets before forwarding them. */
| 48 | * addresses of packets before forwarding them. |
| 49 | */ |
| 50 | static bool |
| 51 | pkt_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 | |
| 69 | struct fwd_engine mac_swap_engine = { |
| 70 | .fwd_mode_name = "macswap", |
nothing calls this directly
no test coverage detected