DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH 1/4] net/mlx5/hws: allow relaxed mode in MPLS matching
@ 2023-09-10 14:03 Erez Shitrit
  2023-09-10 14:03 ` [PATCH 2/4] net/mlx5/hws: allow attaching action template to matcher Erez Shitrit
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Erez Shitrit @ 2023-09-10 14:03 UTC (permalink / raw)
  To: valex, thomas, suanmingm, Matan Azrad, Viacheslav Ovsiienko, Ori Kam; +Cc: dev


Remove the previous constrain on relaxed mode, that way it will be like
all other matching items, can be used in relaxed or non-relaxed mode.

The previous constrain was due to HW limitation that supports MPLS over
specific UDP port, now we give the ability to the user to make sure it
is with the right needs for MPLS matching.

Signed-off-by: Erez Shitrit <erezsh@nvidia.com>
Reviewed-by: Alex Vesker <valex@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/hws/mlx5dr_definer.c | 45 ++++++++++-----------------
 1 file changed, 17 insertions(+), 28 deletions(-)

diff --git a/drivers/net/mlx5/hws/mlx5dr_definer.c b/drivers/net/mlx5/hws/mlx5dr_definer.c
index 33d0f2d18e..88f22e7f70 100644
--- a/drivers/net/mlx5/hws/mlx5dr_definer.c
+++ b/drivers/net/mlx5/hws/mlx5dr_definer.c
@@ -1320,35 +1320,24 @@ mlx5dr_definer_conv_item_mpls(struct mlx5dr_definer_conv_data *cd,
 		return rte_errno;
 	}
 
-	if (cd->relaxed) {
-		DR_LOG(ERR, "Relaxed mode is not supported");
-		rte_errno = ENOTSUP;
-		return rte_errno;
-	}
-
-	/* Currently support only MPLSoUDP */
-	if (cd->last_item != RTE_FLOW_ITEM_TYPE_UDP &&
-	    cd->last_item != RTE_FLOW_ITEM_TYPE_MPLS) {
-		DR_LOG(ERR, "MPLS supported only after UDP");
-		rte_errno = ENOTSUP;
-		return rte_errno;
-	}
-
-	/* In order to match on MPLS we must match on ip_protocol and l4_dport. */
-	fc = &cd->fc[DR_CALC_FNAME(IP_PROTOCOL, false)];
-	if (!fc->tag_set) {
-		fc->item_idx = item_idx;
-		fc->tag_mask_set = &mlx5dr_definer_ones_set;
-		fc->tag_set = &mlx5dr_definer_udp_protocol_set;
-		DR_CALC_SET(fc, eth_l2, l4_type_bwc, false);
-	}
+	if (!cd->relaxed) {
+		/* In order to match on MPLS we must match on ip_protocol and l4_dport. */
+		fc = &cd->fc[DR_CALC_FNAME(IP_PROTOCOL, false)];
+		if (!fc->tag_set) {
+			fc->item_idx = item_idx;
+			fc->tag_mask_set = &mlx5dr_definer_ones_set;
+			fc->tag_set = &mlx5dr_definer_udp_protocol_set;
+			DR_CALC_SET(fc, eth_l2, l4_type_bwc, false);
+		}
 
-	fc = &cd->fc[DR_CALC_FNAME(L4_DPORT, false)];
-	if (!fc->tag_set) {
-		fc->item_idx = item_idx;
-		fc->tag_mask_set = &mlx5dr_definer_ones_set;
-		fc->tag_set = &mlx5dr_definer_mpls_udp_port_set;
-		DR_CALC_SET(fc, eth_l4, destination_port, false);
+		/* Currently support only MPLSoUDP */
+		fc = &cd->fc[DR_CALC_FNAME(L4_DPORT, false)];
+		if (!fc->tag_set) {
+			fc->item_idx = item_idx;
+			fc->tag_mask_set = &mlx5dr_definer_ones_set;
+			fc->tag_set = &mlx5dr_definer_mpls_udp_port_set;
+			DR_CALC_SET(fc, eth_l4, destination_port, false);
+		}
 	}
 
 	if (m && (!is_mem_zero(m->label_tc_s, 3) || m->ttl)) {
-- 
2.18.2


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

* [PATCH 2/4] net/mlx5/hws: allow attaching action template to matcher
  2023-09-10 14:03 [PATCH 1/4] net/mlx5/hws: allow relaxed mode in MPLS matching Erez Shitrit
@ 2023-09-10 14:03 ` Erez Shitrit
  2023-09-10 14:03 ` [PATCH 3/4] net/mlx5/hws: print syndrome value on error Erez Shitrit
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Erez Shitrit @ 2023-09-10 14:03 UTC (permalink / raw)
  To: valex, thomas, suanmingm, Matan Azrad, Viacheslav Ovsiienko, Ori Kam; +Cc: dev


Allow user to add new action-template after the creation of the matcher.
It is  allowed only if the user indicates in the mlx5dr_matcher_attr
that he might add new AT in the future by indicating the max_num_of_at
and if needed the max_num_of_actions_in_at value.
With these two values the matcher is configured to get new AT in the
future.

Signed-off-by: Erez Shitrit <erezsh@nvidia.com>
Signed-off-by: Alex Vesker <valex@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/hws/mlx5dr.h         | 13 +++++
 drivers/net/mlx5/hws/mlx5dr_matcher.c | 82 +++++++++++++++++++++++----
 2 files changed, 83 insertions(+), 12 deletions(-)

diff --git a/drivers/net/mlx5/hws/mlx5dr.h b/drivers/net/mlx5/hws/mlx5dr.h
index 5592af93c9..184de8feaf 100644
--- a/drivers/net/mlx5/hws/mlx5dr.h
+++ b/drivers/net/mlx5/hws/mlx5dr.h
@@ -139,6 +139,8 @@ struct mlx5dr_matcher_attr {
 			uint8_t num_log;
 		} rule;
 	};
+	/* Optional AT attach configuration - Max number of additional AT */
+	uint8_t max_num_of_at_attach;
 };
 
 struct mlx5dr_rule_attr {
@@ -328,6 +330,17 @@ mlx5dr_matcher_create(struct mlx5dr_table *table,
  */
 int mlx5dr_matcher_destroy(struct mlx5dr_matcher *matcher);
 
+/* Attach new action template to direct rule matcher.
+ *
+ * @param[in] matcher
+ *	Matcher to attach at to.
+ * @param[in] at
+ *	Action template to be attached to the matcher.
+ * @return zero on success non zero otherwise.
+ */
+int mlx5dr_matcher_attach_at(struct mlx5dr_matcher *matcher,
+			     struct mlx5dr_action_template *at);
+
 /* Get the size of the rule handle (mlx5dr_rule) to be used on rule creation.
  *
  * @return size in bytes of rule handle struct.
diff --git a/drivers/net/mlx5/hws/mlx5dr_matcher.c b/drivers/net/mlx5/hws/mlx5dr_matcher.c
index 1fe7ec1bc3..a02f42a7e8 100644
--- a/drivers/net/mlx5/hws/mlx5dr_matcher.c
+++ b/drivers/net/mlx5/hws/mlx5dr_matcher.c
@@ -680,6 +680,30 @@ static void mlx5dr_matcher_set_pool_attr(struct mlx5dr_pool_attr *attr,
 	}
 }
 
+static int mlx5dr_matcher_check_and_process_at(struct mlx5dr_matcher *matcher,
+					       struct mlx5dr_action_template *at)
+{
+	bool valid;
+	int ret;
+
+	/* Check if action combinabtion is valid */
+	valid = mlx5dr_action_check_combo(at->action_type_arr, matcher->tbl->type);
+	if (!valid) {
+		DR_LOG(ERR, "Invalid combination in action template");
+		rte_errno = EINVAL;
+		return rte_errno;
+	}
+
+	/* Process action template to setters */
+	ret = mlx5dr_action_template_process(at);
+	if (ret) {
+		DR_LOG(ERR, "Failed to process action template");
+		return ret;
+	}
+
+	return 0;
+}
+
 static int mlx5dr_matcher_bind_at(struct mlx5dr_matcher *matcher)
 {
 	bool is_jumbo = mlx5dr_matcher_mt_is_jumbo(matcher->mt);
@@ -689,22 +713,13 @@ static int mlx5dr_matcher_bind_at(struct mlx5dr_matcher *matcher)
 	struct mlx5dr_context *ctx = tbl->ctx;
 	uint32_t required_stes;
 	int i, ret;
-	bool valid;
 
 	for (i = 0; i < matcher->num_of_at; i++) {
 		struct mlx5dr_action_template *at = &matcher->at[i];
 
-		/* Check if action combinabtion is valid */
-		valid = mlx5dr_action_check_combo(at->action_type_arr, matcher->tbl->type);
-		if (!valid) {
-			DR_LOG(ERR, "Invalid combination in action template %d", i);
-			return rte_errno;
-		}
-
-		/* Process action template to setters */
-		ret = mlx5dr_action_template_process(at);
+		ret = mlx5dr_matcher_check_and_process_at(matcher, at);
 		if (ret) {
-			DR_LOG(ERR, "Failed to process action template %d", i);
+			DR_LOG(ERR, "Invalid at %d", i);
 			return rte_errno;
 		}
 
@@ -924,6 +939,10 @@ mlx5dr_matcher_process_attr(struct mlx5dr_cmd_query_caps *caps,
 			DR_LOG(ERR, "Root matcher can't specify FDB direction");
 			goto not_supported;
 		}
+		if (attr->max_num_of_at_attach) {
+			DR_LOG(ERR, "Root matcher does not support at attaching");
+			goto not_supported;
+		}
 		return 0;
 	}
 
@@ -1039,6 +1058,8 @@ mlx5dr_matcher_create_col_matcher(struct mlx5dr_matcher *matcher)
 	if (col_matcher->attr.table.sz_row_log > MLX5DR_MATCHER_ASSURED_ROW_RATIO)
 		col_matcher->attr.table.sz_row_log -= MLX5DR_MATCHER_ASSURED_ROW_RATIO;
 
+	col_matcher->attr.max_num_of_at_attach = matcher->attr.max_num_of_at_attach;
+
 	ret = mlx5dr_matcher_process_attr(ctx->caps, col_matcher, false);
 	if (ret)
 		goto free_col_matcher;
@@ -1212,6 +1233,42 @@ static int mlx5dr_matcher_uninit_root(struct mlx5dr_matcher *matcher)
 	return ret;
 }
 
+int mlx5dr_matcher_attach_at(struct mlx5dr_matcher *matcher,
+			     struct mlx5dr_action_template *at)
+{
+	bool is_jumbo = mlx5dr_matcher_mt_is_jumbo(matcher->mt);
+	uint32_t required_stes;
+	int ret;
+
+	if (!matcher->attr.max_num_of_at_attach) {
+		DR_LOG(ERR, "Num of current at (%d) exceed allowed value",
+		       matcher->num_of_at);
+		rte_errno = ENOTSUP;
+		return -rte_errno;
+	}
+
+	ret = mlx5dr_matcher_check_and_process_at(matcher, at);
+	if (ret)
+		return -rte_errno;
+
+	required_stes = at->num_of_action_stes - (!is_jumbo || at->only_term);
+	if (matcher->action_ste.max_stes < required_stes) {
+		DR_LOG(ERR, "Required STEs [%d] exceeds initial action template STE [%d]",
+		       required_stes, matcher->action_ste.max_stes);
+		rte_errno = ENOMEM;
+		return -rte_errno;
+	}
+
+	matcher->at[matcher->num_of_at] = *at;
+	matcher->num_of_at += 1;
+	matcher->attr.max_num_of_at_attach -= 1;
+
+	if (matcher->col_matcher)
+		matcher->col_matcher->num_of_at = matcher->num_of_at;
+
+	return 0;
+}
+
 static int
 mlx5dr_matcher_set_templates(struct mlx5dr_matcher *matcher,
 			     struct mlx5dr_match_template *mt[],
@@ -1241,7 +1298,8 @@ mlx5dr_matcher_set_templates(struct mlx5dr_matcher *matcher,
 		return rte_errno;
 	}
 
-	matcher->at = simple_calloc(num_of_at, sizeof(*matcher->at));
+	matcher->at = simple_calloc(num_of_at + matcher->attr.max_num_of_at_attach,
+				    sizeof(*matcher->at));
 	if (!matcher->at) {
 		DR_LOG(ERR, "Failed to allocate action template array");
 		rte_errno = ENOMEM;
-- 
2.18.2


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

* [PATCH 3/4] net/mlx5/hws: print syndrome value on error
  2023-09-10 14:03 [PATCH 1/4] net/mlx5/hws: allow relaxed mode in MPLS matching Erez Shitrit
  2023-09-10 14:03 ` [PATCH 2/4] net/mlx5/hws: allow attaching action template to matcher Erez Shitrit
@ 2023-09-10 14:03 ` Erez Shitrit
  2023-09-10 14:03 ` [PATCH 4/4] net/mlx5/hws: skip process action-template on coll matcher Erez Shitrit
  2023-09-19 12:02 ` [PATCH 1/4] net/mlx5/hws: allow relaxed mode in MPLS matching Raslan Darawsheh
  3 siblings, 0 replies; 5+ messages in thread
From: Erez Shitrit @ 2023-09-10 14:03 UTC (permalink / raw)
  To: valex, thomas, suanmingm, Matan Azrad, Viacheslav Ovsiienko, Ori Kam; +Cc: dev


Print the syndrome of failure of FW command.

Signed-off-by: Erez Shitrit <erezsh@nvidia.com>
Reviewed-by: Alex Vesker <valex@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/hws/mlx5dr_cmd.c | 48 ++++++++++++++++++++++---------
 1 file changed, 34 insertions(+), 14 deletions(-)

diff --git a/drivers/net/mlx5/hws/mlx5dr_cmd.c b/drivers/net/mlx5/hws/mlx5dr_cmd.c
index f9f220cc6a..7771aeb8cf 100644
--- a/drivers/net/mlx5/hws/mlx5dr_cmd.c
+++ b/drivers/net/mlx5/hws/mlx5dr_cmd.c
@@ -4,6 +4,12 @@
 
 #include "mlx5dr_internal.h"
 
+static uint32_t mlx5dr_cmd_get_syndrome(uint32_t *out)
+{
+	/* Assumption: syndrome is always the second u32 */
+	return be32toh(out[1]);
+}
+
 int mlx5dr_cmd_destroy_obj(struct mlx5dr_devx_obj *devx_obj)
 {
 	int ret;
@@ -39,7 +45,8 @@ mlx5dr_cmd_flow_table_create(struct ibv_context *ctx,
 
 	devx_obj->obj = mlx5_glue->devx_obj_create(ctx, in, sizeof(in), out, sizeof(out));
 	if (!devx_obj->obj) {
-		DR_LOG(ERR, "Failed to create FT");
+		DR_LOG(ERR, "Failed to create FT (syndrome: %#x)",
+		       mlx5dr_cmd_get_syndrome(out));
 		simple_free(devx_obj);
 		rte_errno = errno;
 		return NULL;
@@ -73,7 +80,8 @@ mlx5dr_cmd_flow_table_modify(struct mlx5dr_devx_obj *devx_obj,
 
 	ret = mlx5_glue->devx_obj_modify(devx_obj->obj, in, sizeof(in), out, sizeof(out));
 	if (ret) {
-		DR_LOG(ERR, "Failed to modify FT");
+		DR_LOG(ERR, "Failed to modify FT (syndrome: %#x)",
+		       mlx5dr_cmd_get_syndrome(out));
 		rte_errno = errno;
 	}
 
@@ -96,7 +104,8 @@ mlx5dr_cmd_flow_table_query(struct mlx5dr_devx_obj *devx_obj,
 
 	ret = mlx5_glue->devx_obj_query(devx_obj->obj, in, sizeof(in), out, sizeof(out));
 	if (ret) {
-		DR_LOG(ERR, "Failed to query FT");
+		DR_LOG(ERR, "Failed to query FT (syndrome: %#x)",
+		       mlx5dr_cmd_get_syndrome(out));
 		rte_errno = errno;
 		return ret;
 	}
@@ -129,7 +138,8 @@ mlx5dr_cmd_flow_group_create(struct ibv_context *ctx,
 
 	devx_obj->obj = mlx5_glue->devx_obj_create(ctx, in, sizeof(in), out, sizeof(out));
 	if (!devx_obj->obj) {
-		DR_LOG(ERR, "Failed to create Flow group");
+		DR_LOG(ERR, "Failed to create Flow group(syndrome: %#x)",
+		       mlx5dr_cmd_get_syndrome(out));
 		simple_free(devx_obj);
 		rte_errno = errno;
 		return NULL;
@@ -182,7 +192,8 @@ mlx5dr_cmd_set_fte(struct ibv_context *ctx,
 
 	devx_obj->obj = mlx5_glue->devx_obj_create(ctx, in, sizeof(in), out, sizeof(out));
 	if (!devx_obj->obj) {
-		DR_LOG(ERR, "Failed to create FTE");
+		DR_LOG(ERR, "Failed to create FTE (syndrome: %#x)",
+		       mlx5dr_cmd_get_syndrome(out));
 		rte_errno = errno;
 		goto free_devx;
 	}
@@ -325,7 +336,8 @@ mlx5dr_cmd_rtc_create(struct ibv_context *ctx,
 
 	devx_obj->obj = mlx5_glue->devx_obj_create(ctx, in, sizeof(in), out, sizeof(out));
 	if (!devx_obj->obj) {
-		DR_LOG(ERR, "Failed to create RTC");
+		DR_LOG(ERR, "Failed to create RTC (syndrome: %#x)",
+		       mlx5dr_cmd_get_syndrome(out));
 		simple_free(devx_obj);
 		rte_errno = errno;
 		return NULL;
@@ -365,7 +377,8 @@ mlx5dr_cmd_stc_create(struct ibv_context *ctx,
 
 	devx_obj->obj = mlx5_glue->devx_obj_create(ctx, in, sizeof(in), out, sizeof(out));
 	if (!devx_obj->obj) {
-		DR_LOG(ERR, "Failed to create STC");
+		DR_LOG(ERR, "Failed to create STC (syndrome: %#x)",
+		       mlx5dr_cmd_get_syndrome(out));
 		simple_free(devx_obj);
 		rte_errno = errno;
 		return NULL;
@@ -505,7 +518,8 @@ mlx5dr_cmd_stc_modify(struct mlx5dr_devx_obj *devx_obj,
 
 	ret = mlx5_glue->devx_obj_modify(devx_obj->obj, in, sizeof(in), out, sizeof(out));
 	if (ret) {
-		DR_LOG(ERR, "Failed to modify STC FW action_type %d", stc_attr->action_type);
+		DR_LOG(ERR, "Failed to modify STC FW action_type %d (syndrome: %#x)",
+		       stc_attr->action_type, mlx5dr_cmd_get_syndrome(out));
 		rte_errno = errno;
 	}
 
@@ -542,7 +556,8 @@ mlx5dr_cmd_arg_create(struct ibv_context *ctx,
 
 	devx_obj->obj = mlx5_glue->devx_obj_create(ctx, in, sizeof(in), out, sizeof(out));
 	if (!devx_obj->obj) {
-		DR_LOG(ERR, "Failed to create ARG");
+		DR_LOG(ERR, "Failed to create ARG (syndrome: %#x)",
+		       mlx5dr_cmd_get_syndrome(out));
 		simple_free(devx_obj);
 		rte_errno = errno;
 		return NULL;
@@ -606,7 +621,8 @@ mlx5dr_cmd_header_modify_pattern_create(struct ibv_context *ctx,
 
 	devx_obj->obj = mlx5_glue->devx_obj_create(ctx, in, sizeof(in), out, sizeof(out));
 	if (!devx_obj->obj) {
-		DR_LOG(ERR, "Failed to create header_modify_pattern");
+		DR_LOG(ERR, "Failed to create header_modify_pattern (syndrome: %#x)",
+		       mlx5dr_cmd_get_syndrome(out));
 		rte_errno = errno;
 		goto free_obj;
 	}
@@ -649,7 +665,8 @@ mlx5dr_cmd_ste_create(struct ibv_context *ctx,
 
 	devx_obj->obj = mlx5_glue->devx_obj_create(ctx, in, sizeof(in), out, sizeof(out));
 	if (!devx_obj->obj) {
-		DR_LOG(ERR, "Failed to create STE");
+		DR_LOG(ERR, "Failed to create STE (syndrome: %#x)",
+		       mlx5dr_cmd_get_syndrome(out));
 		simple_free(devx_obj);
 		rte_errno = errno;
 		return NULL;
@@ -708,7 +725,8 @@ mlx5dr_cmd_definer_create(struct ibv_context *ctx,
 
 	devx_obj->obj = mlx5_glue->devx_obj_create(ctx, in, sizeof(in), out, sizeof(out));
 	if (!devx_obj->obj) {
-		DR_LOG(ERR, "Failed to create Definer");
+		DR_LOG(ERR, "Failed to create Definer (syndrome: %#x)",
+		       mlx5dr_cmd_get_syndrome(out));
 		simple_free(devx_obj);
 		rte_errno = errno;
 		return NULL;
@@ -775,7 +793,8 @@ int mlx5dr_cmd_sq_modify_rdy(struct mlx5dr_devx_obj *devx_obj)
 
 	ret = mlx5_glue->devx_obj_modify(devx_obj->obj, in, sizeof(in), out, sizeof(out));
 	if (ret) {
-		DR_LOG(ERR, "Failed to modify SQ");
+		DR_LOG(ERR, "Failed to modify SQ (syndrome: %#x)",
+		       mlx5dr_cmd_get_syndrome(out));
 		rte_errno = errno;
 	}
 
@@ -843,7 +862,8 @@ mlx5dr_cmd_alias_obj_create(struct ibv_context *ctx,
 
 	devx_obj->obj = mlx5_glue->devx_obj_create(ctx, in, sizeof(in), out, sizeof(out));
 	if (!devx_obj->obj) {
-		DR_LOG(ERR, "Failed to create ALIAS OBJ");
+		DR_LOG(ERR, "Failed to create ALIAS OBJ (syndrome: %#x)",
+		       mlx5dr_cmd_get_syndrome(out));
 		simple_free(devx_obj);
 		rte_errno = errno;
 		return NULL;
-- 
2.18.2


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

* [PATCH 4/4] net/mlx5/hws: skip process action-template on coll matcher
  2023-09-10 14:03 [PATCH 1/4] net/mlx5/hws: allow relaxed mode in MPLS matching Erez Shitrit
  2023-09-10 14:03 ` [PATCH 2/4] net/mlx5/hws: allow attaching action template to matcher Erez Shitrit
  2023-09-10 14:03 ` [PATCH 3/4] net/mlx5/hws: print syndrome value on error Erez Shitrit
@ 2023-09-10 14:03 ` Erez Shitrit
  2023-09-19 12:02 ` [PATCH 1/4] net/mlx5/hws: allow relaxed mode in MPLS matching Raslan Darawsheh
  3 siblings, 0 replies; 5+ messages in thread
From: Erez Shitrit @ 2023-09-10 14:03 UTC (permalink / raw)
  To: valex, thomas, suanmingm, Matan Azrad, Viacheslav Ovsiienko, Ori Kam; +Cc: dev


Collision matcher uses the same action-template and action STE's as its
parent matcher, so ne need to redo it.

Signed-off-by: Erez Shitrit <erezsh@nvidia.com>
Reviewed-by: Alex Vesker <valex@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/hws/mlx5dr_matcher.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/hws/mlx5dr_matcher.c b/drivers/net/mlx5/hws/mlx5dr_matcher.c
index a02f42a7e8..102e4f19c8 100644
--- a/drivers/net/mlx5/hws/mlx5dr_matcher.c
+++ b/drivers/net/mlx5/hws/mlx5dr_matcher.c
@@ -714,6 +714,9 @@ static int mlx5dr_matcher_bind_at(struct mlx5dr_matcher *matcher)
 	uint32_t required_stes;
 	int i, ret;
 
+	if (matcher->flags & MLX5DR_MATCHER_FLAGS_COLLISION)
+		return 0;
+
 	for (i = 0; i < matcher->num_of_at; i++) {
 		struct mlx5dr_action_template *at = &matcher->at[i];
 
@@ -786,7 +789,7 @@ static void mlx5dr_matcher_unbind_at(struct mlx5dr_matcher *matcher)
 {
 	struct mlx5dr_table *tbl = matcher->tbl;
 
-	if (!matcher->action_ste.max_stes)
+	if (!matcher->action_ste.max_stes || matcher->flags & MLX5DR_MATCHER_FLAGS_COLLISION)
 		return;
 
 	mlx5dr_action_free_single_stc(tbl->ctx, tbl->type, &matcher->action_ste.stc);
-- 
2.18.2


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

* RE: [PATCH 1/4] net/mlx5/hws: allow relaxed mode in MPLS matching
  2023-09-10 14:03 [PATCH 1/4] net/mlx5/hws: allow relaxed mode in MPLS matching Erez Shitrit
                   ` (2 preceding siblings ...)
  2023-09-10 14:03 ` [PATCH 4/4] net/mlx5/hws: skip process action-template on coll matcher Erez Shitrit
@ 2023-09-19 12:02 ` Raslan Darawsheh
  3 siblings, 0 replies; 5+ messages in thread
From: Raslan Darawsheh @ 2023-09-19 12:02 UTC (permalink / raw)
  To: Erez Shitrit, Alex Vesker, NBU-Contact-Thomas Monjalon (EXTERNAL),
	Suanming Mou, Matan Azrad, Slava Ovsiienko, Ori Kam
  Cc: dev

Hi,

> -----Original Message-----
> From: Erez Shitrit <erezsh@nvidia.com>
> Sent: Sunday, September 10, 2023 5:03 PM
> To: Alex Vesker <valex@nvidia.com>; NBU-Contact-Thomas Monjalon
> (EXTERNAL) <thomas@monjalon.net>; Suanming Mou
> <suanmingm@nvidia.com>; Matan Azrad <matan@nvidia.com>; Slava
> Ovsiienko <viacheslavo@nvidia.com>; Ori Kam <orika@nvidia.com>
> Cc: dev@dpdk.org
> Subject: [PATCH 1/4] net/mlx5/hws: allow relaxed mode in MPLS matching
> 
> 
> Remove the previous constrain on relaxed mode, that way it will be like all
> other matching items, can be used in relaxed or non-relaxed mode.
> 
> The previous constrain was due to HW limitation that supports MPLS over
> specific UDP port, now we give the ability to the user to make sure it is with
> the right needs for MPLS matching.
> 
> Signed-off-by: Erez Shitrit <erezsh@nvidia.com>
> Reviewed-by: Alex Vesker <valex@nvidia.com>
> Acked-by: Matan Azrad <matan@nvidia.com>

Series applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh

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

end of thread, other threads:[~2023-09-19 12:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-10 14:03 [PATCH 1/4] net/mlx5/hws: allow relaxed mode in MPLS matching Erez Shitrit
2023-09-10 14:03 ` [PATCH 2/4] net/mlx5/hws: allow attaching action template to matcher Erez Shitrit
2023-09-10 14:03 ` [PATCH 3/4] net/mlx5/hws: print syndrome value on error Erez Shitrit
2023-09-10 14:03 ` [PATCH 4/4] net/mlx5/hws: skip process action-template on coll matcher Erez Shitrit
2023-09-19 12:02 ` [PATCH 1/4] net/mlx5/hws: allow relaxed mode in MPLS matching 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).