app/testpmd: support port and encap for sample action
Use sample action with ratio is 1 for mirroring flow, add
supports to set the different port or encap action for mirrored
packets.
The example of test-pmd command:
1. set sample_actions 1 port_id id 1 / end
flow create 0 ... pattern eth / end actions
sample ratio 1 index 1 / port_id id 2...
The flow will result in all the matched ingress packets will be sent to
port 2, and also mirrored the packets and sent to port 1.
2. set raw_encap 0 eth src.../ ipv4.../...
set raw_encap 1 eth src.../ ipv4.../...
set sample_actions 2 raw_encap index 0 / port_id id 0 / end
flow create 0 ... pattern eth / end actions
sample ratio 1 index 2 / raw_encap index 1 / port_id id 0...
The flow will result in all the matched egress packets will be
encapsulated and sent to wire, and also mirrored the packets and with
the different encapsulated data and sent to wire.
Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>