net/mlx5: fix tag ID conflict with sample action
authorJiawei Wang <jiaweiw@nvidia.com>
Wed, 3 Nov 2021 13:07:59 +0000 (15:07 +0200)
committerRaslan Darawsheh <rasland@nvidia.com>
Wed, 10 Nov 2021 14:44:43 +0000 (15:44 +0100)
commita9b6ea45bed6acb2d95c93bc177f9d5cb53275ef
tree246d42203aa941d97c0c2b13a7c7ecce9c7a0e58
parentaaa6a7ec0f3e19388f1262b7af298e6668d401cf
net/mlx5: fix tag ID conflict with sample action

For the flows containing sample action, the tag action was added
implicitly to store the unique flow index into metadata register in the
split prefix subflow, and then match on this index in the split suffix
subflow. The metadata register for flow index of sample split subflows
was also used to store application metadata TAG 0 item, this might cause
TAG 0 corruption in the flows with sample actions.

This patch uses the same metadata register C index as used for
ASO action since it's reserved and not used directly by the application,
and adds the checking in validation to make sure not to conflict
with ASO CT in the same flow.

Fixes: b4c0ddbfcc58 ("net/mlx5: split sample flow into two sub-flows")
Cc: stable@dpdk.org
Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
drivers/net/mlx5/mlx5_flow.c
drivers/net/mlx5/mlx5_flow.h
drivers/net/mlx5/mlx5_flow_dv.c