DPDK patches and discussions
 help / color / mirror / Atom feed
From: Rongwei Liu <rongweil@nvidia.com>
To: <dev@dpdk.org>, <matan@nvidia.com>, <viacheslavo@nvidia.com>,
	<orika@nvidia.com>, <thomas@monjalon.net>
Subject: [PATCH v1 3/8] net/mlx5/hws: add no reparse support
Date: Mon, 17 Apr 2023 12:25:35 +0300	[thread overview]
Message-ID: <20230417092540.2617450-4-rongweil@nvidia.com> (raw)
In-Reply-To: <20230417092540.2617450-1-rongweil@nvidia.com>

Allocate two groups of RTC to control hardware reparsing
when flow is updated.
1. Group 1 always reparse the traffic after packet is modified
   by any hardware module. This is the default behavior which is
   the same as before.
2. Group 2 doesn't perform any packets reparsing. This will help
   the complex flow rules.

Signed-off-by: Rongwei Liu <rongweil@nvidia.com>
---
 drivers/net/mlx5/hws/mlx5dr_cmd.c     |  5 +-
 drivers/net/mlx5/hws/mlx5dr_cmd.h     |  1 +
 drivers/net/mlx5/hws/mlx5dr_debug.c   |  8 +--
 drivers/net/mlx5/hws/mlx5dr_matcher.c | 80 +++++++++++++++++----------
 drivers/net/mlx5/hws/mlx5dr_matcher.h | 12 ++--
 drivers/net/mlx5/hws/mlx5dr_rule.c    | 65 ++++++++++++++++------
 6 files changed, 117 insertions(+), 54 deletions(-)

diff --git a/drivers/net/mlx5/hws/mlx5dr_cmd.c b/drivers/net/mlx5/hws/mlx5dr_cmd.c
index 0adcedd9c9..42bf1980db 100644
--- a/drivers/net/mlx5/hws/mlx5dr_cmd.c
+++ b/drivers/net/mlx5/hws/mlx5dr_cmd.c
@@ -283,7 +283,10 @@ mlx5dr_cmd_rtc_create(struct ibv_context *ctx,
 	MLX5_SET(rtc, attr, ste_table_base_id, rtc_attr->ste_base);
 	MLX5_SET(rtc, attr, ste_table_offset, rtc_attr->ste_offset);
 	MLX5_SET(rtc, attr, miss_flow_table_id, rtc_attr->miss_ft_id);
-	MLX5_SET(rtc, attr, reparse_mode, MLX5_IFC_RTC_REPARSE_ALWAYS);
+	if (rtc_attr->is_reparse)
+		MLX5_SET(rtc, attr, reparse_mode, MLX5_IFC_RTC_REPARSE_ALWAYS);
+	else
+		MLX5_SET(rtc, attr, reparse_mode, MLX5_IFC_RTC_REPARSE_NEVER);
 
 	devx_obj->obj = mlx5_glue->devx_obj_create(ctx, in, sizeof(in), out, sizeof(out));
 	if (!devx_obj->obj) {
diff --git a/drivers/net/mlx5/hws/mlx5dr_cmd.h b/drivers/net/mlx5/hws/mlx5dr_cmd.h
index 3f40c085be..b225171d4c 100644
--- a/drivers/net/mlx5/hws/mlx5dr_cmd.h
+++ b/drivers/net/mlx5/hws/mlx5dr_cmd.h
@@ -51,6 +51,7 @@ struct mlx5dr_cmd_rtc_create_attr {
 	uint8_t match_definer_1;
 	bool is_frst_jumbo;
 	bool is_scnd_range;
+	uint8_t is_reparse;
 };
 
 struct mlx5dr_cmd_alias_obj_create_attr {
diff --git a/drivers/net/mlx5/hws/mlx5dr_debug.c b/drivers/net/mlx5/hws/mlx5dr_debug.c
index 6b32ac4ee6..b8049a173d 100644
--- a/drivers/net/mlx5/hws/mlx5dr_debug.c
+++ b/drivers/net/mlx5/hws/mlx5dr_debug.c
@@ -224,9 +224,9 @@ static int mlx5dr_debug_dump_matcher(FILE *f, struct mlx5dr_matcher *matcher)
 	}
 
 	ret = fprintf(f, ",%d,%d,%d,%d",
-		      matcher->match_ste.rtc_0 ? matcher->match_ste.rtc_0->id : 0,
+		      matcher->match_ste.rtc_0_reparse ? matcher->match_ste.rtc_0_reparse->id : 0,
 		      ste_0 ? (int)ste_0->id : -1,
-		      matcher->match_ste.rtc_1 ? matcher->match_ste.rtc_1->id : 0,
+		      matcher->match_ste.rtc_1_reparse ? matcher->match_ste.rtc_1_reparse->id : 0,
 		      ste_1 ? (int)ste_1->id : -1);
 	if (ret < 0)
 		goto out_err;
@@ -243,9 +243,9 @@ static int mlx5dr_debug_dump_matcher(FILE *f, struct mlx5dr_matcher *matcher)
 	}
 
 	ret = fprintf(f, ",%d,%d,%d,%d,%d\n",
-		      matcher->action_ste.rtc_0 ? matcher->action_ste.rtc_0->id : 0,
+		      matcher->action_ste.rtc_0_reparse ? matcher->action_ste.rtc_0_reparse->id : 0,
 		      ste_0 ? (int)ste_0->id : -1,
-		      matcher->action_ste.rtc_1 ? matcher->action_ste.rtc_1->id : 0,
+		      matcher->action_ste.rtc_1_reparse ? matcher->action_ste.rtc_1_reparse->id : 0,
 		      ste_1 ? (int)ste_1->id : -1,
 		      is_shared && !is_root ?
 		      matcher->match_ste.aliased_rtc_0->id : 0);
diff --git a/drivers/net/mlx5/hws/mlx5dr_matcher.c b/drivers/net/mlx5/hws/mlx5dr_matcher.c
index 1fe7ec1bc3..652d50f73a 100644
--- a/drivers/net/mlx5/hws/mlx5dr_matcher.c
+++ b/drivers/net/mlx5/hws/mlx5dr_matcher.c
@@ -101,7 +101,7 @@ static int mlx5dr_matcher_shared_create_alias_rtc(struct mlx5dr_matcher *matcher
 						ctx->ibv_ctx,
 						ctx->local_ibv_ctx,
 						ctx->caps->shared_vhca_id,
-						matcher->match_ste.rtc_0->id,
+						matcher->match_ste.rtc_0_reparse->id,
 						MLX5_GENERAL_OBJ_TYPE_RTC,
 						&matcher->match_ste.aliased_rtc_0);
 	if (ret) {
@@ -156,7 +156,7 @@ static uint32_t
 mlx5dr_matcher_connect_get_rtc0(struct mlx5dr_matcher *matcher)
 {
 	if (!matcher->match_ste.aliased_rtc_0)
-		return matcher->match_ste.rtc_0->id;
+		return matcher->match_ste.rtc_0_reparse->id;
 	else
 		return matcher->match_ste.aliased_rtc_0->id;
 }
@@ -233,10 +233,10 @@ static int mlx5dr_matcher_connect(struct mlx5dr_matcher *matcher)
 
 	/* Connect to next */
 	if (next) {
-		if (next->match_ste.rtc_0)
-			ft_attr.rtc_id_0 = next->match_ste.rtc_0->id;
-		if (next->match_ste.rtc_1)
-			ft_attr.rtc_id_1 = next->match_ste.rtc_1->id;
+		if (next->match_ste.rtc_0_reparse)
+			ft_attr.rtc_id_0 = next->match_ste.rtc_0_reparse->id;
+		if (next->match_ste.rtc_1_reparse)
+			ft_attr.rtc_id_1 = next->match_ste.rtc_1_reparse->id;
 
 		ret = mlx5dr_cmd_flow_table_modify(matcher->end_ft, &ft_attr);
 		if (ret) {
@@ -248,10 +248,10 @@ static int mlx5dr_matcher_connect(struct mlx5dr_matcher *matcher)
 	/* Connect to previous */
 	ft = prev ? prev->end_ft : tbl->ft;
 
-	if (matcher->match_ste.rtc_0)
-		ft_attr.rtc_id_0 = matcher->match_ste.rtc_0->id;
-	if (matcher->match_ste.rtc_1)
-		ft_attr.rtc_id_1 = matcher->match_ste.rtc_1->id;
+	if (matcher->match_ste.rtc_0_reparse)
+		ft_attr.rtc_id_0 = matcher->match_ste.rtc_0_reparse->id;
+	if (matcher->match_ste.rtc_1_reparse)
+		ft_attr.rtc_id_1 = matcher->match_ste.rtc_1_reparse->id;
 
 	ret = mlx5dr_cmd_flow_table_modify(ft, &ft_attr);
 	if (ret) {
@@ -296,10 +296,10 @@ static int mlx5dr_matcher_disconnect(struct mlx5dr_matcher *matcher)
 
 	if (next) {
 		/* Connect previous end FT to next RTC if exists */
-		if (next->match_ste.rtc_0)
-			ft_attr.rtc_id_0 = next->match_ste.rtc_0->id;
-		if (next->match_ste.rtc_1)
-			ft_attr.rtc_id_1 = next->match_ste.rtc_1->id;
+		if (next->match_ste.rtc_0_reparse)
+			ft_attr.rtc_id_0 = next->match_ste.rtc_0_reparse->id;
+		if (next->match_ste.rtc_1_reparse)
+			ft_attr.rtc_id_1 = next->match_ste.rtc_1_reparse->id;
 	} else {
 		/* Matcher is last, point prev end FT to default miss */
 		mlx5dr_cmd_set_attr_connect_miss_tbl(tbl->ctx,
@@ -470,10 +470,11 @@ static int mlx5dr_matcher_create_rtc(struct mlx5dr_matcher *matcher,
 	struct mlx5dr_pool_chunk *ste;
 	int ret;
 
+	rtc_attr.is_reparse = true;
 	switch (rtc_type) {
 	case DR_MATCHER_RTC_TYPE_MATCH:
-		rtc_0 = &matcher->match_ste.rtc_0;
-		rtc_1 = &matcher->match_ste.rtc_1;
+		rtc_0 = &matcher->match_ste.rtc_0_reparse;
+		rtc_1 = &matcher->match_ste.rtc_1_reparse;
 		ste_pool = matcher->match_ste.pool;
 		ste = &matcher->match_ste.ste;
 		ste->order = attr->table.sz_col_log + attr->table.sz_row_log;
@@ -537,8 +538,8 @@ static int mlx5dr_matcher_create_rtc(struct mlx5dr_matcher *matcher,
 		break;
 
 	case DR_MATCHER_RTC_TYPE_STE_ARRAY:
-		rtc_0 = &matcher->action_ste.rtc_0;
-		rtc_1 = &matcher->action_ste.rtc_1;
+		rtc_0 = &matcher->action_ste.rtc_0_reparse;
+		rtc_1 = &matcher->action_ste.rtc_1_reparse;
 		ste_pool = matcher->action_ste.pool;
 		ste = &matcher->action_ste.ste;
 		ste->order = rte_log2_u32(matcher->action_ste.max_stes) +
@@ -558,6 +559,7 @@ static int mlx5dr_matcher_create_rtc(struct mlx5dr_matcher *matcher,
 		return rte_errno;
 	}
 
+rertc:
 	devx_obj = mlx5dr_pool_chunk_get_base_devx_obj(ste_pool, ste);
 
 	rtc_attr.pd = ctx->pd_num;
@@ -574,8 +576,8 @@ static int mlx5dr_matcher_create_rtc(struct mlx5dr_matcher *matcher,
 
 	*rtc_0 = mlx5dr_cmd_rtc_create(ctx->ibv_ctx, &rtc_attr);
 	if (!*rtc_0) {
-		DR_LOG(ERR, "Failed to create matcher RTC of type %s",
-		       mlx5dr_matcher_rtc_type_to_str(rtc_type));
+		DR_LOG(ERR, "Failed to create matcher RTC of type %s, reparse %u",
+		       mlx5dr_matcher_rtc_type_to_str(rtc_type), rtc_attr.is_reparse);
 		goto free_ste;
 	}
 
@@ -590,12 +592,25 @@ static int mlx5dr_matcher_create_rtc(struct mlx5dr_matcher *matcher,
 
 		*rtc_1 = mlx5dr_cmd_rtc_create(ctx->ibv_ctx, &rtc_attr);
 		if (!*rtc_1) {
-			DR_LOG(ERR, "Failed to create peer matcher RTC of type %s",
-			       mlx5dr_matcher_rtc_type_to_str(rtc_type));
+			DR_LOG(ERR, "Failed to create peer matcher RTC of type %s, reparse %u",
+			       mlx5dr_matcher_rtc_type_to_str(rtc_type), rtc_attr.is_reparse);
 			goto destroy_rtc_0;
 		}
 	}
 
+	/* RTC is created in reparse then no_reparse order and fw wqe. */
+	if (rtc_attr.is_reparse && !mlx5dr_matcher_req_fw_wqe(matcher)) {
+		rtc_attr.is_reparse = false;
+		if (rtc_type == DR_MATCHER_RTC_TYPE_MATCH) {
+			rtc_0 = &matcher->match_ste.rtc_0_no_reparse;
+			rtc_1 = &matcher->match_ste.rtc_1_no_reparse;
+		} else {
+			rtc_0 = &matcher->action_ste.rtc_0_no_reparse;
+			rtc_1 = &matcher->action_ste.rtc_1_no_reparse;
+		}
+		goto rertc;
+	}
+
 	return 0;
 
 destroy_rtc_0:
@@ -609,21 +624,25 @@ static int mlx5dr_matcher_create_rtc(struct mlx5dr_matcher *matcher,
 static void mlx5dr_matcher_destroy_rtc(struct mlx5dr_matcher *matcher,
 				       enum mlx5dr_matcher_rtc_type rtc_type)
 {
+	struct mlx5dr_devx_obj *rtc_0, *rtc_1, *rtc_2, *rtc_3;
 	struct mlx5dr_table *tbl = matcher->tbl;
-	struct mlx5dr_devx_obj *rtc_0, *rtc_1;
 	struct mlx5dr_pool_chunk *ste;
 	struct mlx5dr_pool *ste_pool;
 
 	switch (rtc_type) {
 	case DR_MATCHER_RTC_TYPE_MATCH:
-		rtc_0 = matcher->match_ste.rtc_0;
-		rtc_1 = matcher->match_ste.rtc_1;
+		rtc_0 = matcher->match_ste.rtc_0_reparse;
+		rtc_1 = matcher->match_ste.rtc_1_reparse;
+		rtc_2 = matcher->match_ste.rtc_0_no_reparse;
+		rtc_3 = matcher->match_ste.rtc_1_no_reparse;
 		ste_pool = matcher->match_ste.pool;
 		ste = &matcher->match_ste.ste;
 		break;
 	case DR_MATCHER_RTC_TYPE_STE_ARRAY:
-		rtc_0 = matcher->action_ste.rtc_0;
-		rtc_1 = matcher->action_ste.rtc_1;
+		rtc_0 = matcher->action_ste.rtc_0_reparse;
+		rtc_1 = matcher->action_ste.rtc_1_reparse;
+		rtc_2 = matcher->action_ste.rtc_0_no_reparse;
+		rtc_3 = matcher->action_ste.rtc_1_no_reparse;
 		ste_pool = matcher->action_ste.pool;
 		ste = &matcher->action_ste.ste;
 		break;
@@ -631,10 +650,15 @@ static void mlx5dr_matcher_destroy_rtc(struct mlx5dr_matcher *matcher,
 		return;
 	}
 
-	if (tbl->type == MLX5DR_TABLE_TYPE_FDB)
+	if (tbl->type == MLX5DR_TABLE_TYPE_FDB) {
 		mlx5dr_cmd_destroy_obj(rtc_1);
+		if (rtc_3)
+			mlx5dr_cmd_destroy_obj(rtc_3);
+	}
 
 	mlx5dr_cmd_destroy_obj(rtc_0);
+	if (rtc_2)
+		mlx5dr_cmd_destroy_obj(rtc_2);
 	if (rtc_type == DR_MATCHER_RTC_TYPE_MATCH)
 		mlx5dr_pool_chunk_free(ste_pool, ste);
 }
diff --git a/drivers/net/mlx5/hws/mlx5dr_matcher.h b/drivers/net/mlx5/hws/mlx5dr_matcher.h
index 4759068ab4..02fd283cd1 100644
--- a/drivers/net/mlx5/hws/mlx5dr_matcher.h
+++ b/drivers/net/mlx5/hws/mlx5dr_matcher.h
@@ -43,8 +43,10 @@ struct mlx5dr_match_template {
 
 struct mlx5dr_matcher_match_ste {
 	struct mlx5dr_pool_chunk ste;
-	struct mlx5dr_devx_obj *rtc_0;
-	struct mlx5dr_devx_obj *rtc_1;
+	struct mlx5dr_devx_obj *rtc_0_reparse;
+	struct mlx5dr_devx_obj *rtc_1_reparse;
+	struct mlx5dr_devx_obj *rtc_0_no_reparse;
+	struct mlx5dr_devx_obj *rtc_1_no_reparse;
 	struct mlx5dr_pool *pool;
 	/* Currently not support FDB aliased */
 	struct mlx5dr_devx_obj *aliased_rtc_0;
@@ -53,8 +55,10 @@ struct mlx5dr_matcher_match_ste {
 struct mlx5dr_matcher_action_ste {
 	struct mlx5dr_pool_chunk ste;
 	struct mlx5dr_pool_chunk stc;
-	struct mlx5dr_devx_obj *rtc_0;
-	struct mlx5dr_devx_obj *rtc_1;
+	struct mlx5dr_devx_obj *rtc_0_reparse;
+	struct mlx5dr_devx_obj *rtc_1_reparse;
+	struct mlx5dr_devx_obj *rtc_0_no_reparse;
+	struct mlx5dr_devx_obj *rtc_1_no_reparse;
 	struct mlx5dr_pool *pool;
 	uint8_t max_stes;
 };
diff --git a/drivers/net/mlx5/hws/mlx5dr_rule.c b/drivers/net/mlx5/hws/mlx5dr_rule.c
index 2418ca0b26..70c6c08741 100644
--- a/drivers/net/mlx5/hws/mlx5dr_rule.c
+++ b/drivers/net/mlx5/hws/mlx5dr_rule.c
@@ -40,11 +40,35 @@ static void mlx5dr_rule_skip(struct mlx5dr_matcher *matcher,
 	}
 }
 
+static void mlxdr_rule_set_wqe_rtc_id(struct mlx5dr_send_ring_dep_wqe *wqe,
+				      struct mlx5dr_matcher *matcher,
+				      bool reparse, bool mirror)
+{
+	if (!mirror && !reparse) {
+		wqe->rtc_0 = matcher->match_ste.rtc_0_no_reparse->id;
+		wqe->retry_rtc_0 = matcher->col_matcher ?
+			matcher->col_matcher->match_ste.rtc_0_no_reparse->id : 0;
+	} else if (!mirror && reparse) {
+		wqe->rtc_0 = matcher->match_ste.rtc_0_reparse->id;
+		wqe->retry_rtc_0 = matcher->col_matcher ?
+			matcher->col_matcher->match_ste.rtc_0_reparse->id : 0;
+	} else if (mirror && reparse) {
+		wqe->rtc_1 = matcher->match_ste.rtc_1_reparse->id;
+		wqe->retry_rtc_1 = matcher->col_matcher ?
+			matcher->col_matcher->match_ste.rtc_1_reparse->id : 0;
+	} else if (mirror && !reparse) {
+		wqe->rtc_1 = matcher->match_ste.rtc_1_no_reparse->id;
+		wqe->retry_rtc_1 = matcher->col_matcher ?
+			matcher->col_matcher->match_ste.rtc_1_no_reparse->id : 0;
+	}
+}
+
 static void mlx5dr_rule_init_dep_wqe(struct mlx5dr_send_ring_dep_wqe *dep_wqe,
 				     struct mlx5dr_rule *rule,
 				     const struct rte_flow_item *items,
 				     struct mlx5dr_match_template *mt,
-				     void *user_data)
+				     void *user_data,
+				     bool reparse)
 {
 	struct mlx5dr_matcher *matcher = rule->matcher;
 	struct mlx5dr_table *tbl = matcher->tbl;
@@ -56,9 +80,7 @@ static void mlx5dr_rule_init_dep_wqe(struct mlx5dr_send_ring_dep_wqe *dep_wqe,
 	switch (tbl->type) {
 	case MLX5DR_TABLE_TYPE_NIC_RX:
 	case MLX5DR_TABLE_TYPE_NIC_TX:
-		dep_wqe->rtc_0 = matcher->match_ste.rtc_0->id;
-		dep_wqe->retry_rtc_0 = matcher->col_matcher ?
-				       matcher->col_matcher->match_ste.rtc_0->id : 0;
+		mlxdr_rule_set_wqe_rtc_id(dep_wqe, matcher, reparse, false);
 		dep_wqe->rtc_1 = 0;
 		dep_wqe->retry_rtc_1 = 0;
 		break;
@@ -67,18 +89,14 @@ static void mlx5dr_rule_init_dep_wqe(struct mlx5dr_send_ring_dep_wqe *dep_wqe,
 		mlx5dr_rule_skip(matcher, mt, items, &skip_rx, &skip_tx);
 
 		if (!skip_rx) {
-			dep_wqe->rtc_0 = matcher->match_ste.rtc_0->id;
-			dep_wqe->retry_rtc_0 = matcher->col_matcher ?
-					       matcher->col_matcher->match_ste.rtc_0->id : 0;
+			mlxdr_rule_set_wqe_rtc_id(dep_wqe, matcher, reparse, false);
 		} else {
 			dep_wqe->rtc_0 = 0;
 			dep_wqe->retry_rtc_0 = 0;
 		}
 
 		if (!skip_tx) {
-			dep_wqe->rtc_1 = matcher->match_ste.rtc_1->id;
-			dep_wqe->retry_rtc_1 = matcher->col_matcher ?
-					       matcher->col_matcher->match_ste.rtc_1->id : 0;
+			mlxdr_rule_set_wqe_rtc_id(dep_wqe, matcher, reparse, true);
 		} else {
 			dep_wqe->rtc_1 = 0;
 			dep_wqe->retry_rtc_1 = 0;
@@ -265,8 +283,9 @@ static int mlx5dr_rule_create_hws_fw_wqe(struct mlx5dr_rule *rule,
 	}
 
 	mlx5dr_rule_create_init(rule, &ste_attr, &apply);
-	mlx5dr_rule_init_dep_wqe(&match_wqe, rule, items, mt, attr->user_data);
-	mlx5dr_rule_init_dep_wqe(&range_wqe, rule, items, mt, attr->user_data);
+	/* FW WQE doesn't look on rtc reparse, use default REPARSE_ALWAYS. */
+	mlx5dr_rule_init_dep_wqe(&match_wqe, rule, items, mt, attr->user_data, true);
+	mlx5dr_rule_init_dep_wqe(&range_wqe, rule, items, mt, attr->user_data, true);
 
 	ste_attr.direct_index = 0;
 	ste_attr.rtc_0 = match_wqe.rtc_0;
@@ -348,6 +367,7 @@ static int mlx5dr_rule_create_hws(struct mlx5dr_rule *rule,
 	struct mlx5dr_actions_apply_data apply;
 	struct mlx5dr_send_engine *queue;
 	uint8_t total_stes, action_stes;
+	bool matcher_reparse;
 	int i, ret;
 
 	/* Insert rule using FW WQE if cannot use GTA WQE */
@@ -368,7 +388,9 @@ static int mlx5dr_rule_create_hws(struct mlx5dr_rule *rule,
 	 * dep_wqe buffers (ctrl, data) are also reused for all STE writes.
 	 */
 	dep_wqe = mlx5dr_send_add_new_dep_wqe(queue);
-	mlx5dr_rule_init_dep_wqe(dep_wqe, rule, items, mt, attr->user_data);
+	/* Jumbo matcher reparse is off. */
+	matcher_reparse = !is_jumbo && (at->setters[1].flags & ASF_REPARSE);
+	mlx5dr_rule_init_dep_wqe(dep_wqe, rule, items, mt, attr->user_data, matcher_reparse);
 
 	ste_attr.wqe_ctrl = &dep_wqe->wqe_ctrl;
 	ste_attr.wqe_data = &dep_wqe->wqe_data;
@@ -389,9 +411,6 @@ static int mlx5dr_rule_create_hws(struct mlx5dr_rule *rule,
 			mlx5dr_send_abort_new_dep_wqe(queue);
 			return ret;
 		}
-		/* Skip RX/TX based on the dep_wqe init */
-		ste_attr.rtc_0 = dep_wqe->rtc_0 ? matcher->action_ste.rtc_0->id : 0;
-		ste_attr.rtc_1 = dep_wqe->rtc_1 ? matcher->action_ste.rtc_1->id : 0;
 		/* Action STEs are written to a specific index last to first */
 		ste_attr.direct_index = rule->action_ste_idx + action_stes;
 		apply.next_direct_idx = ste_attr.direct_index;
@@ -400,7 +419,7 @@ static int mlx5dr_rule_create_hws(struct mlx5dr_rule *rule,
 	}
 
 	for (i = total_stes; i-- > 0;) {
-		mlx5dr_action_apply_setter(&apply, setter--, !i && is_jumbo);
+		mlx5dr_action_apply_setter(&apply, setter, !i && is_jumbo);
 
 		if (i == 0) {
 			/* Handle last match STE.
@@ -431,9 +450,21 @@ static int mlx5dr_rule_create_hws(struct mlx5dr_rule *rule,
 			ste_attr.direct_index = mlx5dr_matcher_is_insert_by_idx(matcher) ?
 						attr->rule_idx : 0;
 		} else {
+			if (setter->flags & ASF_REPARSE) {
+				ste_attr.rtc_0 = dep_wqe->rtc_0 ?
+					matcher->action_ste.rtc_0_reparse->id : 0;
+				ste_attr.rtc_1 = dep_wqe->rtc_1 ?
+					matcher->action_ste.rtc_1_reparse->id : 0;
+			} else {
+				ste_attr.rtc_0 = dep_wqe->rtc_0 ?
+					matcher->action_ste.rtc_0_no_reparse->id : 0;
+				ste_attr.rtc_1 = dep_wqe->rtc_1 ?
+					matcher->action_ste.rtc_1_no_reparse->id : 0;
+			}
 			apply.next_direct_idx = --ste_attr.direct_index;
 		}
 
+		setter--;
 		mlx5dr_send_ste(queue, &ste_attr);
 	}
 
-- 
2.27.0


  parent reply	other threads:[~2023-04-17  9:26 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-17  9:25 [PATCH v1 0/8] add IPv6 extension push remove Rongwei Liu
2023-04-17  9:25 ` [PATCH v1 1/8] ethdev: add IPv6 extension push remove action Rongwei Liu
2023-05-24  6:55   ` Ori Kam
2023-05-24  7:39     ` [PATCH v1 0/2] add IPv6 extension push remove Rongwei Liu
2023-05-24  7:39       ` [PATCH v1 1/2] ethdev: add IPv6 extension push remove action Rongwei Liu
2023-05-24 10:30         ` Ori Kam
2023-05-24  7:39       ` [PATCH v1 2/2] app/testpmd: add IPv6 extension push remove cli Rongwei Liu
2023-06-02 14:39       ` [PATCH v1 0/2] add IPv6 extension push remove Ferruh Yigit
2023-07-10  2:32         ` Rongwei Liu
2023-07-10  8:55           ` Ferruh Yigit
2023-07-10 14:41             ` Stephen Hemminger
2023-07-11  6:16               ` Thomas Monjalon
2023-09-19  8:12                 ` [PATCH v3] net/mlx5: add test for live migration Rongwei Liu
2023-10-16  8:19                   ` Thomas Monjalon
2023-10-16  8:25                     ` Rongwei Liu
2023-10-16  9:26                       ` Rongwei Liu
2023-10-16  9:26                       ` Thomas Monjalon
2023-10-16  9:29                         ` Rongwei Liu
2023-10-25  9:07                           ` Rongwei Liu
2023-10-16  9:22                     ` [PATCH v4] " Rongwei Liu
2023-10-25  9:36                       ` [PATCH v5] " Rongwei Liu
2023-10-25  9:41                         ` Thomas Monjalon
2023-10-25  9:45                           ` [PATCH v6] " Rongwei Liu
2023-10-25  9:48                           ` [PATCH v5] " Rongwei Liu
2023-10-25  9:50                           ` [PATCH v7] " Rongwei Liu
2023-10-25 13:10                             ` Thomas Monjalon
2023-10-26  8:15                             ` Raslan Darawsheh
2023-04-17  9:25 ` [PATCH v1 2/8] app/testpmd: add IPv6 extension push remove cli Rongwei Liu
2023-05-24  7:06   ` Ori Kam
2023-04-17  9:25 ` Rongwei Liu [this message]
2023-04-17  9:25 ` [PATCH v1 4/8] net/mlx5: sample the srv6 last segment Rongwei Liu
2023-10-31  9:42   ` [PATCH v2 0/6] support IPv6 extension push remove Rongwei Liu
2023-10-31  9:42     ` [PATCH v2 1/6] net/mlx5: sample the srv6 last segment Rongwei Liu
2023-10-31  9:42     ` [PATCH v2 2/6] net/mlx5/hws: fix potential wrong errno value Rongwei Liu
2023-10-31  9:42     ` [PATCH v2 3/6] net/mlx5/hws: add IPv6 routing extension push remove actions Rongwei Liu
2023-10-31  9:42     ` [PATCH v2 4/6] net/mlx5/hws: add setter for IPv6 routing push remove Rongwei Liu
2023-10-31  9:42     ` [PATCH v2 5/6] net/mlx5: implement " Rongwei Liu
2023-10-31  9:42     ` [PATCH v2 6/6] net/mlx5/hws: add stc reparse support for srv6 push pop Rongwei Liu
2023-10-31 10:51     ` [PATCH v3 0/6] support IPv6 extension push remove Rongwei Liu
2023-10-31 10:51       ` [PATCH v3 1/6] net/mlx5: sample the srv6 last segment Rongwei Liu
2023-10-31 10:51       ` [PATCH v3 2/6] net/mlx5/hws: fix potential wrong errno value Rongwei Liu
2023-10-31 10:51       ` [PATCH v3 3/6] net/mlx5/hws: add IPv6 routing extension push remove actions Rongwei Liu
2023-10-31 10:51       ` [PATCH v3 4/6] net/mlx5/hws: add setter for IPv6 routing push remove Rongwei Liu
2023-10-31 10:51       ` [PATCH v3 5/6] net/mlx5: implement " Rongwei Liu
2023-10-31 10:51       ` [PATCH v3 6/6] net/mlx5/hws: add stc reparse support for srv6 push pop Rongwei Liu
2023-11-01  4:44       ` [PATCH v4 00/13] support IPv6 push remove action Rongwei Liu
2023-11-01  4:44         ` [PATCH v4 01/13] net/mlx5/hws: support insert header action Rongwei Liu
2023-11-01  4:44         ` [PATCH v4 02/13] net/mlx5/hws: support remove " Rongwei Liu
2023-11-01  4:44         ` [PATCH v4 03/13] net/mlx5/hws: allow jump to TIR over FDB Rongwei Liu
2023-11-01  4:44         ` [PATCH v4 04/13] net/mlx5/hws: support dynamic re-parse Rongwei Liu
2023-11-01  4:44         ` [PATCH v4 05/13] net/mlx5/hws: dynamic re-parse for modify header Rongwei Liu
2023-11-01  4:44         ` [PATCH v4 06/13] net/mlx5/hws: fix incorrect re-parse on complex rules Rongwei Liu
2023-11-01  4:44         ` [PATCH v4 07/13] net/mlx5: sample the srv6 last segment Rongwei Liu
2023-11-01  4:44         ` [PATCH v4 08/13] net/mlx5/hws: fix potential wrong rte_errno value Rongwei Liu
2023-11-01  4:44         ` [PATCH v4 09/13] net/mlx5/hws: add IPv6 routing extension push remove actions Rongwei Liu
2023-11-01  4:44         ` [PATCH v4 10/13] net/mlx5/hws: add setter for IPv6 routing push remove Rongwei Liu
2023-11-01  4:44         ` [PATCH v4 11/13] net/mlx5: implement " Rongwei Liu
2023-11-01  4:44         ` [PATCH v4 12/13] net/mlx5/hws: fix srv6 push compilation failure Rongwei Liu
2023-11-01  4:44         ` [PATCH v4 13/13] net/mlx5/hws: add stc reparse support for srv6 push pop Rongwei Liu
2023-11-02 13:44         ` [PATCH v4 00/13] support IPv6 push remove action Raslan Darawsheh
2023-04-17  9:25 ` [PATCH v1 5/8] net/mlx5: generate srv6 modify header resource Rongwei Liu
2023-04-17  9:25 ` [PATCH v1 6/8] net/mlx5/hws: add IPv6 routing extension push pop actions Rongwei Liu
2023-04-17  9:25 ` [PATCH v1 7/8] net/mlx5/hws: add setter for IPv6 routing push pop Rongwei Liu
2023-04-17  9:25 ` [PATCH v1 8/8] net/mlx5: implement " Rongwei Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230417092540.2617450-4-rongweil@nvidia.com \
    --to=rongweil@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=matan@nvidia.com \
    --cc=orika@nvidia.com \
    --cc=thomas@monjalon.net \
    --cc=viacheslavo@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).