ethdev: add flow action to swap MAC addresses
authorRahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Sat, 6 Oct 2018 15:45:34 +0000 (21:15 +0530)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 11 Oct 2018 16:53:49 +0000 (18:53 +0200)
commit8287597059ad374925a21349302ed1b1e71dd194
treeaef6861ca08e8ed9c0d27d1ec1cf8d237c342489
parent48f523f62563cbc9c4916fdfe1b6ec3a283fbf68
ethdev: add flow action to swap MAC addresses

This action is useful for offloading loopback mode, where the hardware
will swap source and destination MAC addresses in the outermost Ethernet
header before looping back the packet. This action can be used in
conjunction with other rewrite actions to achieve MAC layer transparent
NAT where the MAC addresses are swapped before either the source or
destination MAC address is rewritten and NAT is performed.

Must be used with a valid RTE_FLOW_ITEM_TYPE_ETH flow pattern item.
Otherwise, RTE_FLOW_ERROR_TYPE_ACTION error should be returned by the
PMDs.

Original work by Shagun Agrawal

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
app/test-pmd/cmdline_flow.c
doc/guides/prog_guide/rte_flow.rst
doc/guides/rel_notes/release_18_11.rst
doc/guides/testpmd_app_ug/testpmd_funcs.rst
lib/librte_ethdev/rte_flow.c
lib/librte_ethdev/rte_flow.h