From: Hamdan Igbaria <hamd...@nvidia.com> Today if we pass a remove header action and after it an insert header action then our action template builder will set two different STE setters, because it won't allow insert header in same STE as remove header. But if we have the opposite order of insert header and then remove header actions, then the setter will set both of them on the same STE since the opposite check was missing. This patch added the missing opposite limitation.
Signed-off-by: Hamdan Igbaria <hamd...@nvidia.com> Acked-by: Matan Azrad <ma...@nvidia.com> --- drivers/net/mlx5/hws/mlx5dr_action.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/mlx5/hws/mlx5dr_action.c b/drivers/net/mlx5/hws/mlx5dr_action.c index 370886907f..8589de5557 100644 --- a/drivers/net/mlx5/hws/mlx5dr_action.c +++ b/drivers/net/mlx5/hws/mlx5dr_action.c @@ -3308,7 +3308,8 @@ int mlx5dr_action_template_process(struct mlx5dr_action_template *at) case MLX5DR_ACTION_TYP_REMOVE_HEADER: case MLX5DR_ACTION_TYP_REFORMAT_TNL_L2_TO_L2: /* Single remove header to header */ - setter = mlx5dr_action_setter_find_first(last_setter, ASF_SINGLE1 | ASF_MODIFY); + setter = mlx5dr_action_setter_find_first(last_setter, + ASF_SINGLE1 | ASF_MODIFY | ASF_INSERT); setter->flags |= ASF_SINGLE1 | ASF_REMOVE; setter->set_single = &mlx5dr_action_setter_single; setter->idx_single = i; -- 2.39.3