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

Itamar Gozlan igozlan at nvidia.com
Tue Feb 13 10:50:36 CET 2024


From: Hamdan Igbaria <hamdani at 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 at nvidia.com>
Acked-by: Matan Azrad <matan at 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



More information about the dev mailing list