DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH 1/2] net/mlx5/hws: removing the table name from dest root table
@ 2023-06-13  5:28 Bar Neuman
  2023-06-13  5:28 ` [PATCH 2/2] net/mlx5: add support for send to kernel over HWS Bar Neuman
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Bar Neuman @ 2023-06-13  5:28 UTC (permalink / raw)
  To: dev; +Cc: orika, rasland, matan, viacheslavo, mkashani, Itamar Gozlan

From: Itamar Gozlan <igozlan@nvidia.com>

Jumping to root (group 0) does not behave the same as jumping
to groups with level > 0.
To better emphasize that it is not the same action,
a rename is made to drop the name table.

Signed-off-by: Itamar Gozlan <igozlan@nvidia.com>
---
 drivers/net/mlx5/hws/mlx5dr.h        | 11 ++++-------
 drivers/net/mlx5/hws/mlx5dr_action.c | 27 ++++++++++-----------------
 drivers/net/mlx5/hws/mlx5dr_debug.c  |  2 +-
 3 files changed, 15 insertions(+), 25 deletions(-)

diff --git a/drivers/net/mlx5/hws/mlx5dr.h b/drivers/net/mlx5/hws/mlx5dr.h
index c14fef7a6b..512d6095b9 100644
--- a/drivers/net/mlx5/hws/mlx5dr.h
+++ b/drivers/net/mlx5/hws/mlx5dr.h
@@ -45,7 +45,7 @@ enum mlx5dr_action_type {
 	MLX5DR_ACTION_TYP_PUSH_VLAN,
 	MLX5DR_ACTION_TYP_ASO_METER,
 	MLX5DR_ACTION_TYP_ASO_CT,
-	MLX5DR_ACTION_TYP_DEST_ROOT_TABLE,
+	MLX5DR_ACTION_TYP_DEST_ROOT,
 	MLX5DR_ACTION_TYP_MAX,
 };
 
@@ -570,8 +570,6 @@ mlx5dr_action_create_push_vlan(struct mlx5dr_context *ctx, uint32_t flags);
  * the given priority.
  * @param[in] ctx
  *	The context in which the new action will be created.
- * @param[in] tbl
- *	The root table to jump to.
  * @param[in] priority
  *	The priority of matcher in the root table to jump to.
  * @param[in] flags
@@ -579,10 +577,9 @@ mlx5dr_action_create_push_vlan(struct mlx5dr_context *ctx, uint32_t flags);
  * @return pointer to mlx5dr_action on success NULL otherwise.
  */
 struct mlx5dr_action *
-mlx5dr_action_create_dest_root_table(struct mlx5dr_context *ctx,
-				     struct mlx5dr_table *tbl,
-				     uint16_t priority,
-				     uint32_t flags);
+mlx5dr_action_create_dest_root(struct mlx5dr_context *ctx,
+				uint16_t priority,
+				uint32_t flags);
 
 /* Destroy direct rule action.
  *
diff --git a/drivers/net/mlx5/hws/mlx5dr_action.c b/drivers/net/mlx5/hws/mlx5dr_action.c
index df39be47da..01d30b8442 100644
--- a/drivers/net/mlx5/hws/mlx5dr_action.c
+++ b/drivers/net/mlx5/hws/mlx5dr_action.c
@@ -34,7 +34,7 @@ static const uint32_t action_order_arr[MLX5DR_TABLE_TYPE_MAX][MLX5DR_ACTION_TYP_
 		BIT(MLX5DR_ACTION_TYP_MISS) |
 		BIT(MLX5DR_ACTION_TYP_TIR) |
 		BIT(MLX5DR_ACTION_TYP_DROP) |
-		BIT(MLX5DR_ACTION_TYP_DEST_ROOT_TABLE),
+		BIT(MLX5DR_ACTION_TYP_DEST_ROOT),
 		BIT(MLX5DR_ACTION_TYP_LAST),
 	},
 	[MLX5DR_TABLE_TYPE_NIC_TX] = {
@@ -51,7 +51,7 @@ static const uint32_t action_order_arr[MLX5DR_TABLE_TYPE_MAX][MLX5DR_ACTION_TYP_
 		BIT(MLX5DR_ACTION_TYP_FT) |
 		BIT(MLX5DR_ACTION_TYP_MISS) |
 		BIT(MLX5DR_ACTION_TYP_DROP) |
-		BIT(MLX5DR_ACTION_TYP_DEST_ROOT_TABLE),
+		BIT(MLX5DR_ACTION_TYP_DEST_ROOT),
 		BIT(MLX5DR_ACTION_TYP_LAST),
 	},
 	[MLX5DR_TABLE_TYPE_FDB] = {
@@ -71,7 +71,7 @@ static const uint32_t action_order_arr[MLX5DR_TABLE_TYPE_MAX][MLX5DR_ACTION_TYP_
 		BIT(MLX5DR_ACTION_TYP_MISS) |
 		BIT(MLX5DR_ACTION_TYP_VPORT) |
 		BIT(MLX5DR_ACTION_TYP_DROP) |
-		BIT(MLX5DR_ACTION_TYP_DEST_ROOT_TABLE),
+		BIT(MLX5DR_ACTION_TYP_DEST_ROOT),
 		BIT(MLX5DR_ACTION_TYP_LAST),
 	},
 };
@@ -524,7 +524,7 @@ static void mlx5dr_action_fill_stc_attr(struct mlx5dr_action *action,
 		attr->action_offset = MLX5DR_ACTION_OFFSET_HIT;
 		attr->dest_table_id = obj->id;
 		break;
-	case MLX5DR_ACTION_TYP_DEST_ROOT_TABLE:
+	case MLX5DR_ACTION_TYP_DEST_ROOT:
 		attr->action_type = MLX5_IFC_STC_ACTION_TYPE_JUMP_TO_FT;
 		attr->action_offset = MLX5DR_ACTION_OFFSET_HIT;
 		attr->dest_table_id = action->root_tbl.sa->id;
@@ -1648,10 +1648,9 @@ mlx5dr_action_create_modify_header(struct mlx5dr_context *ctx,
 }
 
 struct mlx5dr_action *
-mlx5dr_action_create_dest_root_table(struct mlx5dr_context *ctx,
-				     struct mlx5dr_table *tbl,
-				     uint16_t priority,
-				     uint32_t flags)
+mlx5dr_action_create_dest_root(struct mlx5dr_context *ctx,
+			       uint16_t priority,
+			       uint32_t flags)
 {
 	struct mlx5dv_steering_anchor_attr attr = {0};
 	struct mlx5dv_steering_anchor *sa;
@@ -1664,12 +1663,6 @@ mlx5dr_action_create_dest_root_table(struct mlx5dr_context *ctx,
 		return NULL;
 	}
 
-	if (!mlx5dr_table_is_root(tbl)) {
-		DR_LOG(ERR, "Non root table cannot be set as destination");
-		rte_errno = ENOTSUP;
-		return NULL;
-	}
-
 	if (mlx5dr_context_shared_gvmi_used(ctx)) {
 		DR_LOG(ERR, "Cannot use this action in shared GVMI context");
 		rte_errno = ENOTSUP;
@@ -1687,7 +1680,7 @@ mlx5dr_action_create_dest_root_table(struct mlx5dr_context *ctx,
 		return NULL;
 	}
 
-	action = mlx5dr_action_create_generic(ctx, flags, MLX5DR_ACTION_TYP_DEST_ROOT_TABLE);
+	action = mlx5dr_action_create_generic(ctx, flags, MLX5DR_ACTION_TYP_DEST_ROOT);
 	if (!action)
 		goto free_steering_anchor;
 
@@ -1725,7 +1718,7 @@ static void mlx5dr_action_destroy_hws(struct mlx5dr_action *action)
 	case MLX5DR_ACTION_TYP_PUSH_VLAN:
 		mlx5dr_action_destroy_stcs(action);
 		break;
-	case MLX5DR_ACTION_TYP_DEST_ROOT_TABLE:
+	case MLX5DR_ACTION_TYP_DEST_ROOT:
 		mlx5dr_action_destroy_stcs(action);
 		mlx5_glue->destroy_steering_anchor(action->root_tbl.sa);
 		break;
@@ -2216,7 +2209,7 @@ int mlx5dr_action_template_process(struct mlx5dr_action_template *at)
 		case MLX5DR_ACTION_TYP_DROP:
 		case MLX5DR_ACTION_TYP_TIR:
 		case MLX5DR_ACTION_TYP_FT:
-		case MLX5DR_ACTION_TYP_DEST_ROOT_TABLE:
+		case MLX5DR_ACTION_TYP_DEST_ROOT:
 		case MLX5DR_ACTION_TYP_VPORT:
 		case MLX5DR_ACTION_TYP_MISS:
 			/* Hit action */
diff --git a/drivers/net/mlx5/hws/mlx5dr_debug.c b/drivers/net/mlx5/hws/mlx5dr_debug.c
index c49b504317..d249f8d869 100644
--- a/drivers/net/mlx5/hws/mlx5dr_debug.c
+++ b/drivers/net/mlx5/hws/mlx5dr_debug.c
@@ -22,7 +22,7 @@ const char *mlx5dr_debug_action_type_str[] = {
 	[MLX5DR_ACTION_TYP_PUSH_VLAN] = "PUSH_VLAN",
 	[MLX5DR_ACTION_TYP_ASO_METER] = "ASO_METER",
 	[MLX5DR_ACTION_TYP_ASO_CT] = "ASO_CT",
-	[MLX5DR_ACTION_TYP_DEST_ROOT_TABLE] = "DEST_ROOT_TABLE",
+	[MLX5DR_ACTION_TYP_DEST_ROOT] = "DEST_ROOT",
 };
 
 static_assert(ARRAY_SIZE(mlx5dr_debug_action_type_str) == MLX5DR_ACTION_TYP_MAX,
-- 
2.25.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-06-20  6:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-13  5:28 [PATCH 1/2] net/mlx5/hws: removing the table name from dest root table Bar Neuman
2023-06-13  5:28 ` [PATCH 2/2] net/mlx5: add support for send to kernel over HWS Bar Neuman
2023-06-13  7:33   ` Slava Ovsiienko
2023-06-13  7:30 ` [PATCH 1/2] net/mlx5/hws: removing the table name from dest root table Slava Ovsiienko
2023-06-20  6:48 ` Raslan Darawsheh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).