Skip to content

Commit

Permalink
net/mlx5: fix validation of sample encap flow action
Browse files Browse the repository at this point in the history
[ upstream commit a2a709f0e7b88b785acaae87dd9724821438c969 ]

The flow sample/mirror action includes sub-actions for the
duplicated packet.
In SW steering case, dv_flow_en=1, there is a FW limitation
that forces configuring also encap action when port action
for the wire port is configured in the duplicated packet's
sub-actions.

The driver did a wrong validation for the above limitation
and forced other actions instead of encap for the wire port.
Force only encap action in case of wire port.

This patch fixes the wrongly checking for the sample encap action.

Fixes: a8697f50f50f ("net/mlx5: fix E-Switch mirror flow rule validation")

Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
  • Loading branch information
jiaweiwsz authored and kevintraynor committed Nov 16, 2023
1 parent 37d5553 commit 02b97af
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/mlx5/mlx5_flow_dv.c
Original file line number Diff line number Diff line change
Expand Up @@ -8120,7 +8120,7 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,
RTE_FLOW_ERROR_TYPE_ACTION, NULL,
"mirror to rep port with encap is not supported");
} else {
if ((sub_action_flags & ~MLX5_FLOW_ACTION_ENCAP) &&
if (!(sub_action_flags & MLX5_FLOW_ACTION_ENCAP) &&
(action_flags & MLX5_FLOW_ACTION_JUMP))
return rte_flow_error_set(error, ENOTSUP,
RTE_FLOW_ERROR_TYPE_ACTION, NULL,
Expand Down

0 comments on commit 02b97af

Please sign in to comment.