ethdev: introduce flow sample action
authorJiawei Wang <jiaweiw@nvidia.com>
Fri, 9 Oct 2020 13:46:04 +0000 (16:46 +0300)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 16 Oct 2020 17:47:58 +0000 (19:47 +0200)
commit805b8faa6bb7515a48da5648969f3128a95d3d70
tree1306dc1e79946fb97b884be25b07331ea4b428dc
parentfbedd8ca9e6807df022af8fde9b1d6d2c87fda6d
ethdev: introduce flow sample action

When using full offload, all traffic will be handled by the HW, and
forwarded to the requested VF or wire and the control application does
not see this traffic anymore. So there's a need for an action that
enables the control application some forwarded traffic visibility.

The solution introduces a new action that will sample the incoming
traffic and send a duplicated traffic with the specified ratio to the
application, while the original packet will continue to the target
destination.

The packets sampled equals is '1/ratio', the ratio value set to 1
means that the packets will be completely mirrored. The sample packet
can be assigned with different set of actions from the original packet.

In order to support the sample packet in rte_flow, new rte_flow action
definition RTE_FLOW_ACTION_TYPE_SAMPLE and structure rte_flow_action_sample
will be introduced.

Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
doc/guides/prog_guide/rte_flow.rst
doc/guides/rel_notes/release_20_11.rst
lib/librte_ethdev/rte_flow.c
lib/librte_ethdev/rte_flow.h