[8/9] net/mlx5/hws: add missing actions STE limitation

Message ID 20240213095038.451299-8-igozlan@nvidia.com (mailing list archive)
State Superseded, archived
Delegated to: Raslan Darawsheh
Headers
Series [1/9] net/mlx5/hws: skip RTE item when inserting rules by index |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Itamar Gozlan Feb. 13, 2024, 9:50 a.m. UTC
  From: Hamdan Igbaria <hamdani@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 <hamdani@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/hws/mlx5dr_action.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Patch

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;