[PATCH v3 2/3] net/mlx5/hws: add support for action type LAST

Maayan Kashani mkashani at nvidia.com
Mon Jun 3 12:43:55 CEST 2024


From: Yevgeny Kliteynik <kliteyn at nvidia.com>

Add support for MLX5DR_ACTION_TYP_LAST action type.

Signed-off-by: Yevgeny Kliteynik <kliteyn at nvidia.com>
---
 drivers/net/mlx5/hws/mlx5dr.h        | 12 ++++++++++++
 drivers/net/mlx5/hws/mlx5dr_action.c |  9 +++++++++
 2 files changed, 21 insertions(+)

diff --git a/drivers/net/mlx5/hws/mlx5dr.h b/drivers/net/mlx5/hws/mlx5dr.h
index 86cd4f1db5..5ceb1a7b4b 100644
--- a/drivers/net/mlx5/hws/mlx5dr.h
+++ b/drivers/net/mlx5/hws/mlx5dr.h
@@ -677,6 +677,18 @@ struct mlx5dr_action *
 mlx5dr_action_create_tag(struct mlx5dr_context *ctx,
 			 uint32_t flags);
 
+/* Create direct rule LAST action.
+ *
+ * @param[in] ctx
+ *	The context in which the new action will be created.
+ * @param[in] flags
+ *	Action creation flags. (enum mlx5dr_action_flags)
+ * @return pointer to mlx5dr_action on success NULL otherwise.
+ */
+struct mlx5dr_action *
+mlx5dr_action_create_last(struct mlx5dr_context *ctx,
+			  uint32_t flags);
+
 /* Create direct rule counter action.
  *
  * @param[in] ctx
diff --git a/drivers/net/mlx5/hws/mlx5dr_action.c b/drivers/net/mlx5/hws/mlx5dr_action.c
index 562fb5cbb4..90f2f17bd0 100644
--- a/drivers/net/mlx5/hws/mlx5dr_action.c
+++ b/drivers/net/mlx5/hws/mlx5dr_action.c
@@ -1319,6 +1319,13 @@ mlx5dr_action_create_tag(struct mlx5dr_context *ctx,
 	return NULL;
 }
 
+struct mlx5dr_action *
+mlx5dr_action_create_last(struct mlx5dr_context *ctx,
+			  uint32_t flags)
+{
+	return mlx5dr_action_create_generic(ctx, flags, MLX5DR_ACTION_TYP_LAST);
+}
+
 static struct mlx5dr_action *
 mlx5dr_action_create_aso(struct mlx5dr_context *ctx,
 			 enum mlx5dr_action_type action_type,
@@ -3005,6 +3012,8 @@ static void mlx5dr_action_destroy_hws(struct mlx5dr_action *action)
 		for (i = 0; i < MLX5DR_ACTION_NAT64_STAGES; i++)
 			mlx5dr_action_destroy(action->nat64.stages[i]);
 		break;
+	case MLX5DR_ACTION_TYP_LAST:
+		break;
 	}
 }
 
-- 
2.25.1



More information about the dev mailing list