DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH 1/5] net/mlx5/hws: fix alias_rtc_0 print location in debug dump
@ 2023-01-26 16:03 Hamdan Igbaria
  2023-01-26 16:03 ` [PATCH 2/5] net/mlx5/hws: change STC array size to 32K Hamdan Igbaria
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Hamdan Igbaria @ 2023-01-26 16:03 UTC (permalink / raw)
  To: hamdani, viacheslavo, thomas, suanmingm, Matan Azrad; +Cc: dev, orika, valex

Fix alias_rtc_0 print location in debug dump, move it to
the end of matcher dumped info instead of the middle, to
keep the dump compatibility.

Fixes: dd2845361a58 ("net/mlx5/hws: add debug details for cross gvmi")
Signed-off-by: Hamdan Igbaria <hamdani@nvidia.com>
---
 drivers/net/mlx5/hws/mlx5dr_debug.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/mlx5/hws/mlx5dr_debug.c b/drivers/net/mlx5/hws/mlx5dr_debug.c
index 0815327b18..4bbdb767ee 100644
--- a/drivers/net/mlx5/hws/mlx5dr_debug.c
+++ b/drivers/net/mlx5/hws/mlx5dr_debug.c
@@ -208,13 +208,11 @@ static int mlx5dr_debug_dump_matcher(FILE *f, struct mlx5dr_matcher *matcher)
 		ste_1 = NULL;
 	}
 
-	ret = fprintf(f, ",%d,%d,%d,%d,%d",
+	ret = fprintf(f, ",%d,%d,%d,%d",
 		      matcher->match_ste.rtc_0 ? matcher->match_ste.rtc_0->id : 0,
 		      ste_0 ? (int)ste_0->id : -1,
 		      matcher->match_ste.rtc_1 ? matcher->match_ste.rtc_1->id : 0,
-		      ste_1 ? (int)ste_1->id : -1,
-		      is_shared && !is_root ?
-		      matcher->match_ste.aliased_rtc_0->id : 0);
+		      ste_1 ? (int)ste_1->id : -1);
 	if (ret < 0)
 		goto out_err;
 
@@ -229,11 +227,13 @@ static int mlx5dr_debug_dump_matcher(FILE *f, struct mlx5dr_matcher *matcher)
 		ste_1 = NULL;
 	}
 
-	ret = fprintf(f, ",%d,%d,%d,%d\n",
+	ret = fprintf(f, ",%d,%d,%d,%d,%d\n",
 		      matcher->action_ste.rtc_0 ? matcher->action_ste.rtc_0->id : 0,
 		      ste_0 ? (int)ste_0->id : -1,
 		      matcher->action_ste.rtc_1 ? matcher->action_ste.rtc_1->id : 0,
-		      ste_1 ? (int)ste_1->id : -1);
+		      ste_1 ? (int)ste_1->id : -1,
+		      is_shared && !is_root ?
+		      matcher->match_ste.aliased_rtc_0->id : 0);
 	if (ret < 0)
 		goto out_err;
 
-- 
2.31.1


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

* [PATCH 2/5] net/mlx5/hws: change STC array size to 32K
  2023-01-26 16:03 [PATCH 1/5] net/mlx5/hws: fix alias_rtc_0 print location in debug dump Hamdan Igbaria
@ 2023-01-26 16:03 ` Hamdan Igbaria
  2023-01-26 16:03 ` [PATCH 3/5] net/mlx5/hws: support STC info dump Hamdan Igbaria
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 12+ messages in thread
From: Hamdan Igbaria @ 2023-01-26 16:03 UTC (permalink / raw)
  To: hamdani, viacheslavo, thomas, suanmingm, Matan Azrad; +Cc: dev, orika, valex

Change STC array size from 16K to 32K.
This change allows supporting more actions
using HWS.

Signed-off-by: Hamdan Igbaria <hamdani@nvidia.com>
---
 drivers/net/mlx5/hws/mlx5dr_pool.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/hws/mlx5dr_pool.h b/drivers/net/mlx5/hws/mlx5dr_pool.h
index cd12c3ab9a..4edc4b8c79 100644
--- a/drivers/net/mlx5/hws/mlx5dr_pool.h
+++ b/drivers/net/mlx5/hws/mlx5dr_pool.h
@@ -10,7 +10,7 @@ enum mlx5dr_pool_type {
 	MLX5DR_POOL_TYPE_STC,
 };
 
-#define MLX5DR_POOL_STC_LOG_SZ 14
+#define MLX5DR_POOL_STC_LOG_SZ 15
 
 #define MLX5DR_POOL_RESOURCE_ARR_SZ 100
 
-- 
2.31.1


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

* [PATCH 3/5] net/mlx5/hws: support STC info dump
  2023-01-26 16:03 [PATCH 1/5] net/mlx5/hws: fix alias_rtc_0 print location in debug dump Hamdan Igbaria
  2023-01-26 16:03 ` [PATCH 2/5] net/mlx5/hws: change STC array size to 32K Hamdan Igbaria
@ 2023-01-26 16:03 ` Hamdan Igbaria
  2023-01-26 16:03 ` [PATCH 4/5] net/mlx5/hws: support IP version matching for non relaxed Hamdan Igbaria
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 12+ messages in thread
From: Hamdan Igbaria @ 2023-01-26 16:03 UTC (permalink / raw)
  To: hamdani, viacheslavo, thomas, suanmingm, Matan Azrad; +Cc: dev, orika, valex

Dump the STC info in debug dump.

Signed-off-by: Hamdan Igbaria <hamdani@nvidia.com>
---
 drivers/net/mlx5/hws/mlx5dr_debug.c | 55 +++++++++++++++++++++++++++++
 drivers/net/mlx5/hws/mlx5dr_debug.h |  1 +
 2 files changed, 56 insertions(+)

diff --git a/drivers/net/mlx5/hws/mlx5dr_debug.c b/drivers/net/mlx5/hws/mlx5dr_debug.c
index 4bbdb767ee..6a2644693b 100644
--- a/drivers/net/mlx5/hws/mlx5dr_debug.c
+++ b/drivers/net/mlx5/hws/mlx5dr_debug.c
@@ -435,6 +435,57 @@ static int mlx5dr_debug_dump_context_info(FILE *f, struct mlx5dr_context *ctx)
 	return 0;
 }
 
+static int
+mlx5dr_debug_dump_context_stc_resource(FILE *f,
+				       struct mlx5dr_context *ctx,
+				       uint32_t tbl_type,
+				       struct mlx5dr_pool_resource *resource)
+{
+	int ret;
+
+	ret = fprintf(f, "%d,0x%" PRIx64 ",%u,%u\n",
+		      MLX5DR_DEBUG_RES_TYPE_CONTEXT_STC,
+		      (uint64_t)(uintptr_t)ctx,
+		      tbl_type,
+		      resource->base_id);
+	if (ret < 0) {
+		rte_errno = EINVAL;
+		return rte_errno;
+	}
+
+	return 0;
+}
+
+static int mlx5dr_debug_dump_context_stc(FILE *f, struct mlx5dr_context *ctx)
+{
+	struct mlx5dr_pool *stc_pool;
+	int ret;
+	int i;
+
+	for (i = 0; i < MLX5DR_TABLE_TYPE_MAX; i++) {
+		stc_pool = ctx->stc_pool[i];
+
+		if (!stc_pool)
+			continue;
+
+		if (stc_pool->resource[0] != NULL) {
+			ret = mlx5dr_debug_dump_context_stc_resource(f, ctx, i,
+								     stc_pool->resource[0]);
+			if (ret)
+				return ret;
+		}
+
+		if (i == MLX5DR_TABLE_TYPE_FDB && stc_pool->mirror_resource[0] != NULL) {
+			ret = mlx5dr_debug_dump_context_stc_resource(f, ctx, i,
+								     stc_pool->mirror_resource[0]);
+			if (ret)
+				return ret;
+		}
+	}
+
+	return 0;
+}
+
 static int mlx5dr_debug_dump_context(FILE *f, struct mlx5dr_context *ctx)
 {
 	struct mlx5dr_table *tbl;
@@ -448,6 +499,10 @@ static int mlx5dr_debug_dump_context(FILE *f, struct mlx5dr_context *ctx)
 	if (ret)
 		return ret;
 
+	ret = mlx5dr_debug_dump_context_stc(f, ctx);
+	if (ret)
+		return ret;
+
 	LIST_FOREACH(tbl, &ctx->head, next) {
 		ret = mlx5dr_debug_dump_table(f, tbl);
 		if (ret)
diff --git a/drivers/net/mlx5/hws/mlx5dr_debug.h b/drivers/net/mlx5/hws/mlx5dr_debug.h
index cf00170f7d..4702ed0ea5 100644
--- a/drivers/net/mlx5/hws/mlx5dr_debug.h
+++ b/drivers/net/mlx5/hws/mlx5dr_debug.h
@@ -13,6 +13,7 @@ enum mlx5dr_debug_res_type {
 	MLX5DR_DEBUG_RES_TYPE_CONTEXT_CAPS = 4002,
 	MLX5DR_DEBUG_RES_TYPE_CONTEXT_SEND_ENGINE = 4003,
 	MLX5DR_DEBUG_RES_TYPE_CONTEXT_SEND_RING = 4004,
+	MLX5DR_DEBUG_RES_TYPE_CONTEXT_STC = 4005,
 
 	MLX5DR_DEBUG_RES_TYPE_TABLE = 4100,
 
-- 
2.31.1


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

* [PATCH 4/5] net/mlx5/hws: support IP version matching for non relaxed
  2023-01-26 16:03 [PATCH 1/5] net/mlx5/hws: fix alias_rtc_0 print location in debug dump Hamdan Igbaria
  2023-01-26 16:03 ` [PATCH 2/5] net/mlx5/hws: change STC array size to 32K Hamdan Igbaria
  2023-01-26 16:03 ` [PATCH 3/5] net/mlx5/hws: support STC info dump Hamdan Igbaria
@ 2023-01-26 16:03 ` Hamdan Igbaria
  2023-01-26 16:03 ` [PATCH 5/5] net/mlx5: support HW steering debug dump Hamdan Igbaria
  2023-02-02 16:02 ` [v2 1/5] net/mlx5/hws: fix alias_rtc_0 print location in " Hamdan Igbaria
  4 siblings, 0 replies; 12+ messages in thread
From: Hamdan Igbaria @ 2023-01-26 16:03 UTC (permalink / raw)
  To: hamdani, viacheslavo, thomas, suanmingm, Matan Azrad; +Cc: dev, orika, valex

Enable matching on IP version explicitly for non relaxed mode.
This will add support for the user cases where he needs to
match on ip version explicitly, for such case to have outer
ipv6 and inner ipv4 packets, etc.

Signed-off-by: Hamdan Igbaria <hamdani@nvidia.com>
---
 drivers/net/mlx5/hws/mlx5dr_definer.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/net/mlx5/hws/mlx5dr_definer.c b/drivers/net/mlx5/hws/mlx5dr_definer.c
index 6b98eb8c96..79f4f2667f 100644
--- a/drivers/net/mlx5/hws/mlx5dr_definer.c
+++ b/drivers/net/mlx5/hws/mlx5dr_definer.c
@@ -539,6 +539,14 @@ mlx5dr_definer_conv_item_ipv4(struct mlx5dr_definer_conv_data *cd,
 		return rte_errno;
 	}
 
+	if (m->version) {
+		fc = &cd->fc[DR_CALC_FNAME(IP_VERSION, inner)];
+		fc->item_idx = item_idx;
+		fc->tag_set = &mlx5dr_definer_ipv4_version_set;
+		fc->tag_mask_set = &mlx5dr_definer_ones_set;
+		DR_CALC_SET(fc, eth_l2, l3_type, inner);
+	}
+
 	if (m->fragment_offset) {
 		fc = &cd->fc[DR_CALC_FNAME(IP_FRAG, inner)];
 		fc->item_idx = item_idx;
@@ -628,6 +636,14 @@ mlx5dr_definer_conv_item_ipv6(struct mlx5dr_definer_conv_data *cd,
 		DR_CALC_SET(fc, eth_l4, ip_fragmented, inner);
 	}
 
+	if (DR_GET(header_ipv6_vtc, &m->hdr.vtc_flow, version)) {
+		fc = &cd->fc[DR_CALC_FNAME(IP_VERSION, inner)];
+		fc->item_idx = item_idx;
+		fc->tag_set = &mlx5dr_definer_ipv6_version_set;
+		fc->tag_mask_set = &mlx5dr_definer_ones_set;
+		DR_CALC_SET(fc, eth_l2, l3_type, inner);
+	}
+
 	if (DR_GET(header_ipv6_vtc, &m->hdr.vtc_flow, tos)) {
 		fc = &cd->fc[DR_CALC_FNAME(IP_TOS, inner)];
 		fc->item_idx = item_idx;
-- 
2.31.1


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

* [PATCH 5/5] net/mlx5: support HW steering debug dump
  2023-01-26 16:03 [PATCH 1/5] net/mlx5/hws: fix alias_rtc_0 print location in debug dump Hamdan Igbaria
                   ` (2 preceding siblings ...)
  2023-01-26 16:03 ` [PATCH 4/5] net/mlx5/hws: support IP version matching for non relaxed Hamdan Igbaria
@ 2023-01-26 16:03 ` Hamdan Igbaria
  2023-02-02 16:02 ` [v2 1/5] net/mlx5/hws: fix alias_rtc_0 print location in " Hamdan Igbaria
  4 siblings, 0 replies; 12+ messages in thread
From: Hamdan Igbaria @ 2023-01-26 16:03 UTC (permalink / raw)
  To: hamdani, viacheslavo, thomas, suanmingm, Matan Azrad; +Cc: dev, orika, valex

Add the ability for the DPDK apps to call
HW steering relevant debug data dump function.

Signed-off-by: Hamdan Igbaria <hamdani@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow.c | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index f5e2831480..8e3da63299 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -9857,10 +9857,13 @@ mlx5_flow_dev_dump(struct rte_eth_dev *dev, struct rte_flow *flow_idx,
 #ifdef HAVE_IBV_FLOW_DV_SUPPORT
 		if (mlx5_flow_dev_dump_sh_all(dev, file, error))
 			return -EINVAL;
+
+		if (sh->config.dv_flow_en == 2)
+			return mlx5dr_debug_dump(priv->dr_ctx, file);
 #endif
 		return mlx5_devx_cmd_flow_dump(sh->fdb_domain,
-					sh->rx_domain,
-					sh->tx_domain, file);
+					       sh->rx_domain,
+					       sh->tx_domain, file);
 	}
 	/* dump one */
 	flow = mlx5_ipool_get(priv->flows[MLX5_FLOW_TYPE_GEN],
@@ -9878,10 +9881,14 @@ mlx5_flow_dev_dump(struct rte_eth_dev *dev, struct rte_flow *flow_idx,
 		if (!dh)
 			return -ENOENT;
 		if (dh->drv_flow) {
-			ret = mlx5_devx_cmd_flow_single_dump(dh->drv_flow,
-					file);
-			if (ret)
-				return -ENOENT;
+			if (sh->config.dv_flow_en == 2) {
+				return -ENOTSUP;
+			} else {
+				ret = mlx5_devx_cmd_flow_single_dump(dh->drv_flow,
+								     file);
+				if (ret)
+					return -ENOENT;
+			}
 		}
 		handle_idx = dh->next.next;
 	}
-- 
2.31.1


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

* [v2 1/5] net/mlx5/hws: fix alias_rtc_0 print location in debug dump
  2023-01-26 16:03 [PATCH 1/5] net/mlx5/hws: fix alias_rtc_0 print location in debug dump Hamdan Igbaria
                   ` (3 preceding siblings ...)
  2023-01-26 16:03 ` [PATCH 5/5] net/mlx5: support HW steering debug dump Hamdan Igbaria
@ 2023-02-02 16:02 ` Hamdan Igbaria
  2023-02-02 16:02   ` [v2 2/5] net/mlx5/hws: change STC array size to 32K Hamdan Igbaria
                     ` (5 more replies)
  4 siblings, 6 replies; 12+ messages in thread
From: Hamdan Igbaria @ 2023-02-02 16:02 UTC (permalink / raw)
  To: hamdani, viacheslavo, thomas, suanmingm, Matan Azrad; +Cc: dev, orika, valex

Fix alias_rtc_0 print location in debug dump, move it to
the end of matcher dumped info instead of the middle, to
keep the dump compatibility.

Fixes: dd2845361a58 ("net/mlx5/hws: add debug details for cross gvmi")
Signed-off-by: Hamdan Igbaria <hamdani@nvidia.com>
---
 drivers/net/mlx5/hws/mlx5dr_debug.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/mlx5/hws/mlx5dr_debug.c b/drivers/net/mlx5/hws/mlx5dr_debug.c
index 0815327b18..4bbdb767ee 100644
--- a/drivers/net/mlx5/hws/mlx5dr_debug.c
+++ b/drivers/net/mlx5/hws/mlx5dr_debug.c
@@ -208,13 +208,11 @@ static int mlx5dr_debug_dump_matcher(FILE *f, struct mlx5dr_matcher *matcher)
 		ste_1 = NULL;
 	}
 
-	ret = fprintf(f, ",%d,%d,%d,%d,%d",
+	ret = fprintf(f, ",%d,%d,%d,%d",
 		      matcher->match_ste.rtc_0 ? matcher->match_ste.rtc_0->id : 0,
 		      ste_0 ? (int)ste_0->id : -1,
 		      matcher->match_ste.rtc_1 ? matcher->match_ste.rtc_1->id : 0,
-		      ste_1 ? (int)ste_1->id : -1,
-		      is_shared && !is_root ?
-		      matcher->match_ste.aliased_rtc_0->id : 0);
+		      ste_1 ? (int)ste_1->id : -1);
 	if (ret < 0)
 		goto out_err;
 
@@ -229,11 +227,13 @@ static int mlx5dr_debug_dump_matcher(FILE *f, struct mlx5dr_matcher *matcher)
 		ste_1 = NULL;
 	}
 
-	ret = fprintf(f, ",%d,%d,%d,%d\n",
+	ret = fprintf(f, ",%d,%d,%d,%d,%d\n",
 		      matcher->action_ste.rtc_0 ? matcher->action_ste.rtc_0->id : 0,
 		      ste_0 ? (int)ste_0->id : -1,
 		      matcher->action_ste.rtc_1 ? matcher->action_ste.rtc_1->id : 0,
-		      ste_1 ? (int)ste_1->id : -1);
+		      ste_1 ? (int)ste_1->id : -1,
+		      is_shared && !is_root ?
+		      matcher->match_ste.aliased_rtc_0->id : 0);
 	if (ret < 0)
 		goto out_err;
 
-- 
2.31.1


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

* [v2 2/5] net/mlx5/hws: change STC array size to 32K
  2023-02-02 16:02 ` [v2 1/5] net/mlx5/hws: fix alias_rtc_0 print location in " Hamdan Igbaria
@ 2023-02-02 16:02   ` Hamdan Igbaria
  2023-02-02 16:02   ` [v2 3/5] net/mlx5/hws: support STC info dump Hamdan Igbaria
                     ` (4 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Hamdan Igbaria @ 2023-02-02 16:02 UTC (permalink / raw)
  To: hamdani, viacheslavo, thomas, suanmingm, Matan Azrad; +Cc: dev, orika, valex

Change STC array size from 16K to 32K.
This change allows supporting more actions
using HWS.

Signed-off-by: Hamdan Igbaria <hamdani@nvidia.com>
---
 drivers/net/mlx5/hws/mlx5dr_pool.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/hws/mlx5dr_pool.h b/drivers/net/mlx5/hws/mlx5dr_pool.h
index cd12c3ab9a..4edc4b8c79 100644
--- a/drivers/net/mlx5/hws/mlx5dr_pool.h
+++ b/drivers/net/mlx5/hws/mlx5dr_pool.h
@@ -10,7 +10,7 @@ enum mlx5dr_pool_type {
 	MLX5DR_POOL_TYPE_STC,
 };
 
-#define MLX5DR_POOL_STC_LOG_SZ 14
+#define MLX5DR_POOL_STC_LOG_SZ 15
 
 #define MLX5DR_POOL_RESOURCE_ARR_SZ 100
 
-- 
2.31.1


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

* [v2 3/5] net/mlx5/hws: support STC info dump
  2023-02-02 16:02 ` [v2 1/5] net/mlx5/hws: fix alias_rtc_0 print location in " Hamdan Igbaria
  2023-02-02 16:02   ` [v2 2/5] net/mlx5/hws: change STC array size to 32K Hamdan Igbaria
@ 2023-02-02 16:02   ` Hamdan Igbaria
  2023-02-02 16:02   ` [v2 4/5] net/mlx5/hws: support IP version matching for non relaxed Hamdan Igbaria
                     ` (3 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Hamdan Igbaria @ 2023-02-02 16:02 UTC (permalink / raw)
  To: hamdani, viacheslavo, thomas, suanmingm, Matan Azrad; +Cc: dev, orika, valex

Dump the STC info in debug dump.

Signed-off-by: Hamdan Igbaria <hamdani@nvidia.com>
---
 drivers/net/mlx5/hws/mlx5dr_debug.c | 55 +++++++++++++++++++++++++++++
 drivers/net/mlx5/hws/mlx5dr_debug.h |  1 +
 2 files changed, 56 insertions(+)

diff --git a/drivers/net/mlx5/hws/mlx5dr_debug.c b/drivers/net/mlx5/hws/mlx5dr_debug.c
index 4bbdb767ee..6a2644693b 100644
--- a/drivers/net/mlx5/hws/mlx5dr_debug.c
+++ b/drivers/net/mlx5/hws/mlx5dr_debug.c
@@ -435,6 +435,57 @@ static int mlx5dr_debug_dump_context_info(FILE *f, struct mlx5dr_context *ctx)
 	return 0;
 }
 
+static int
+mlx5dr_debug_dump_context_stc_resource(FILE *f,
+				       struct mlx5dr_context *ctx,
+				       uint32_t tbl_type,
+				       struct mlx5dr_pool_resource *resource)
+{
+	int ret;
+
+	ret = fprintf(f, "%d,0x%" PRIx64 ",%u,%u\n",
+		      MLX5DR_DEBUG_RES_TYPE_CONTEXT_STC,
+		      (uint64_t)(uintptr_t)ctx,
+		      tbl_type,
+		      resource->base_id);
+	if (ret < 0) {
+		rte_errno = EINVAL;
+		return rte_errno;
+	}
+
+	return 0;
+}
+
+static int mlx5dr_debug_dump_context_stc(FILE *f, struct mlx5dr_context *ctx)
+{
+	struct mlx5dr_pool *stc_pool;
+	int ret;
+	int i;
+
+	for (i = 0; i < MLX5DR_TABLE_TYPE_MAX; i++) {
+		stc_pool = ctx->stc_pool[i];
+
+		if (!stc_pool)
+			continue;
+
+		if (stc_pool->resource[0] != NULL) {
+			ret = mlx5dr_debug_dump_context_stc_resource(f, ctx, i,
+								     stc_pool->resource[0]);
+			if (ret)
+				return ret;
+		}
+
+		if (i == MLX5DR_TABLE_TYPE_FDB && stc_pool->mirror_resource[0] != NULL) {
+			ret = mlx5dr_debug_dump_context_stc_resource(f, ctx, i,
+								     stc_pool->mirror_resource[0]);
+			if (ret)
+				return ret;
+		}
+	}
+
+	return 0;
+}
+
 static int mlx5dr_debug_dump_context(FILE *f, struct mlx5dr_context *ctx)
 {
 	struct mlx5dr_table *tbl;
@@ -448,6 +499,10 @@ static int mlx5dr_debug_dump_context(FILE *f, struct mlx5dr_context *ctx)
 	if (ret)
 		return ret;
 
+	ret = mlx5dr_debug_dump_context_stc(f, ctx);
+	if (ret)
+		return ret;
+
 	LIST_FOREACH(tbl, &ctx->head, next) {
 		ret = mlx5dr_debug_dump_table(f, tbl);
 		if (ret)
diff --git a/drivers/net/mlx5/hws/mlx5dr_debug.h b/drivers/net/mlx5/hws/mlx5dr_debug.h
index cf00170f7d..4702ed0ea5 100644
--- a/drivers/net/mlx5/hws/mlx5dr_debug.h
+++ b/drivers/net/mlx5/hws/mlx5dr_debug.h
@@ -13,6 +13,7 @@ enum mlx5dr_debug_res_type {
 	MLX5DR_DEBUG_RES_TYPE_CONTEXT_CAPS = 4002,
 	MLX5DR_DEBUG_RES_TYPE_CONTEXT_SEND_ENGINE = 4003,
 	MLX5DR_DEBUG_RES_TYPE_CONTEXT_SEND_RING = 4004,
+	MLX5DR_DEBUG_RES_TYPE_CONTEXT_STC = 4005,
 
 	MLX5DR_DEBUG_RES_TYPE_TABLE = 4100,
 
-- 
2.31.1


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

* [v2 4/5] net/mlx5/hws: support IP version matching for non relaxed
  2023-02-02 16:02 ` [v2 1/5] net/mlx5/hws: fix alias_rtc_0 print location in " Hamdan Igbaria
  2023-02-02 16:02   ` [v2 2/5] net/mlx5/hws: change STC array size to 32K Hamdan Igbaria
  2023-02-02 16:02   ` [v2 3/5] net/mlx5/hws: support STC info dump Hamdan Igbaria
@ 2023-02-02 16:02   ` Hamdan Igbaria
  2023-02-02 16:02   ` [v2 5/5] net/mlx5: support HW steering debug dump Hamdan Igbaria
                     ` (2 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Hamdan Igbaria @ 2023-02-02 16:02 UTC (permalink / raw)
  To: hamdani, viacheslavo, thomas, suanmingm, Matan Azrad; +Cc: dev, orika, valex

Enable matching on IP version explicitly for non relaxed mode.
This will add support for the user cases where he needs to
match on ip version explicitly, for such case to have outer
ipv6 and inner ipv4 packets, etc.

Signed-off-by: Hamdan Igbaria <hamdani@nvidia.com>
---
 drivers/net/mlx5/hws/mlx5dr_definer.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/net/mlx5/hws/mlx5dr_definer.c b/drivers/net/mlx5/hws/mlx5dr_definer.c
index 6b98eb8c96..79f4f2667f 100644
--- a/drivers/net/mlx5/hws/mlx5dr_definer.c
+++ b/drivers/net/mlx5/hws/mlx5dr_definer.c
@@ -539,6 +539,14 @@ mlx5dr_definer_conv_item_ipv4(struct mlx5dr_definer_conv_data *cd,
 		return rte_errno;
 	}
 
+	if (m->version) {
+		fc = &cd->fc[DR_CALC_FNAME(IP_VERSION, inner)];
+		fc->item_idx = item_idx;
+		fc->tag_set = &mlx5dr_definer_ipv4_version_set;
+		fc->tag_mask_set = &mlx5dr_definer_ones_set;
+		DR_CALC_SET(fc, eth_l2, l3_type, inner);
+	}
+
 	if (m->fragment_offset) {
 		fc = &cd->fc[DR_CALC_FNAME(IP_FRAG, inner)];
 		fc->item_idx = item_idx;
@@ -628,6 +636,14 @@ mlx5dr_definer_conv_item_ipv6(struct mlx5dr_definer_conv_data *cd,
 		DR_CALC_SET(fc, eth_l4, ip_fragmented, inner);
 	}
 
+	if (DR_GET(header_ipv6_vtc, &m->hdr.vtc_flow, version)) {
+		fc = &cd->fc[DR_CALC_FNAME(IP_VERSION, inner)];
+		fc->item_idx = item_idx;
+		fc->tag_set = &mlx5dr_definer_ipv6_version_set;
+		fc->tag_mask_set = &mlx5dr_definer_ones_set;
+		DR_CALC_SET(fc, eth_l2, l3_type, inner);
+	}
+
 	if (DR_GET(header_ipv6_vtc, &m->hdr.vtc_flow, tos)) {
 		fc = &cd->fc[DR_CALC_FNAME(IP_TOS, inner)];
 		fc->item_idx = item_idx;
-- 
2.31.1


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

* [v2 5/5] net/mlx5: support HW steering debug dump
  2023-02-02 16:02 ` [v2 1/5] net/mlx5/hws: fix alias_rtc_0 print location in " Hamdan Igbaria
                     ` (2 preceding siblings ...)
  2023-02-02 16:02   ` [v2 4/5] net/mlx5/hws: support IP version matching for non relaxed Hamdan Igbaria
@ 2023-02-02 16:02   ` Hamdan Igbaria
  2023-02-12 11:50   ` [v2 1/5] net/mlx5/hws: fix alias_rtc_0 print location in " Matan Azrad
  2023-02-14  8:28   ` Raslan Darawsheh
  5 siblings, 0 replies; 12+ messages in thread
From: Hamdan Igbaria @ 2023-02-02 16:02 UTC (permalink / raw)
  To: hamdani, viacheslavo, thomas, suanmingm, Matan Azrad; +Cc: dev, orika, valex

Add the ability for the DPDK apps to call
HW steering relevant debug data dump function.

Signed-off-by: Hamdan Igbaria <hamdani@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index f5e2831480..a34fcccd2c 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -9857,10 +9857,13 @@ mlx5_flow_dev_dump(struct rte_eth_dev *dev, struct rte_flow *flow_idx,
 #ifdef HAVE_IBV_FLOW_DV_SUPPORT
 		if (mlx5_flow_dev_dump_sh_all(dev, file, error))
 			return -EINVAL;
+
+		if (sh->config.dv_flow_en == 2)
+			return mlx5dr_debug_dump(priv->dr_ctx, file);
 #endif
 		return mlx5_devx_cmd_flow_dump(sh->fdb_domain,
-					sh->rx_domain,
-					sh->tx_domain, file);
+					       sh->rx_domain,
+					       sh->tx_domain, file);
 	}
 	/* dump one */
 	flow = mlx5_ipool_get(priv->flows[MLX5_FLOW_TYPE_GEN],
@@ -9878,8 +9881,11 @@ mlx5_flow_dev_dump(struct rte_eth_dev *dev, struct rte_flow *flow_idx,
 		if (!dh)
 			return -ENOENT;
 		if (dh->drv_flow) {
+			if (sh->config.dv_flow_en == 2)
+				return -ENOTSUP;
+
 			ret = mlx5_devx_cmd_flow_single_dump(dh->drv_flow,
-					file);
+							     file);
 			if (ret)
 				return -ENOENT;
 		}
-- 
2.31.1


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

* RE: [v2 1/5] net/mlx5/hws: fix alias_rtc_0 print location in debug dump
  2023-02-02 16:02 ` [v2 1/5] net/mlx5/hws: fix alias_rtc_0 print location in " Hamdan Igbaria
                     ` (3 preceding siblings ...)
  2023-02-02 16:02   ` [v2 5/5] net/mlx5: support HW steering debug dump Hamdan Igbaria
@ 2023-02-12 11:50   ` Matan Azrad
  2023-02-14  8:28   ` Raslan Darawsheh
  5 siblings, 0 replies; 12+ messages in thread
From: Matan Azrad @ 2023-02-12 11:50 UTC (permalink / raw)
  To: Hamdan Igbaria, Slava Ovsiienko,
	NBU-Contact-Thomas Monjalon (EXTERNAL),
	Suanming Mou
  Cc: dev, Ori Kam, Alex Vesker



From: Hamdan Igbaria
> Fix alias_rtc_0 print location in debug dump, move it to the end of matcher
> dumped info instead of the middle, to keep the dump compatibility.
> 
> Fixes: dd2845361a58 ("net/mlx5/hws: add debug details for cross gvmi")
> Signed-off-by: Hamdan Igbaria <hamdani@nvidia.com>
> ---
>  drivers/net/mlx5/hws/mlx5dr_debug.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)

Looks ok to me.

Series-acked-by: Matan Azrad <matan@nvidia.com>

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

* RE: [v2 1/5] net/mlx5/hws: fix alias_rtc_0 print location in debug dump
  2023-02-02 16:02 ` [v2 1/5] net/mlx5/hws: fix alias_rtc_0 print location in " Hamdan Igbaria
                     ` (4 preceding siblings ...)
  2023-02-12 11:50   ` [v2 1/5] net/mlx5/hws: fix alias_rtc_0 print location in " Matan Azrad
@ 2023-02-14  8:28   ` Raslan Darawsheh
  5 siblings, 0 replies; 12+ messages in thread
From: Raslan Darawsheh @ 2023-02-14  8:28 UTC (permalink / raw)
  To: Hamdan Igbaria, Hamdan Igbaria, Slava Ovsiienko,
	NBU-Contact-Thomas Monjalon (EXTERNAL),
	Suanming Mou, Matan Azrad
  Cc: dev, Ori Kam, Alex Vesker

Hi,

> -----Original Message-----
> From: Hamdan Igbaria <hamdani@nvidia.com>
> Sent: Thursday, February 2, 2023 6:03 PM
> To: Hamdan Igbaria <hamdani@nvidia.com>; Slava Ovsiienko
> <viacheslavo@nvidia.com>; NBU-Contact-Thomas Monjalon (EXTERNAL)
> <thomas@monjalon.net>; Suanming Mou <suanmingm@nvidia.com>;
> Matan Azrad <matan@nvidia.com>
> Cc: dev@dpdk.org; Ori Kam <orika@nvidia.com>; Alex Vesker
> <valex@nvidia.com>
> Subject: [v2 1/5] net/mlx5/hws: fix alias_rtc_0 print location in debug dump
> 
> Fix alias_rtc_0 print location in debug dump, move it to the end of matcher
> dumped info instead of the middle, to keep the dump compatibility.
> 
> Fixes: dd2845361a58 ("net/mlx5/hws: add debug details for cross gvmi")
> Signed-off-by: Hamdan Igbaria <hamdani@nvidia.com>

Series applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh

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

end of thread, other threads:[~2023-02-14  8:28 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-26 16:03 [PATCH 1/5] net/mlx5/hws: fix alias_rtc_0 print location in debug dump Hamdan Igbaria
2023-01-26 16:03 ` [PATCH 2/5] net/mlx5/hws: change STC array size to 32K Hamdan Igbaria
2023-01-26 16:03 ` [PATCH 3/5] net/mlx5/hws: support STC info dump Hamdan Igbaria
2023-01-26 16:03 ` [PATCH 4/5] net/mlx5/hws: support IP version matching for non relaxed Hamdan Igbaria
2023-01-26 16:03 ` [PATCH 5/5] net/mlx5: support HW steering debug dump Hamdan Igbaria
2023-02-02 16:02 ` [v2 1/5] net/mlx5/hws: fix alias_rtc_0 print location in " Hamdan Igbaria
2023-02-02 16:02   ` [v2 2/5] net/mlx5/hws: change STC array size to 32K Hamdan Igbaria
2023-02-02 16:02   ` [v2 3/5] net/mlx5/hws: support STC info dump Hamdan Igbaria
2023-02-02 16:02   ` [v2 4/5] net/mlx5/hws: support IP version matching for non relaxed Hamdan Igbaria
2023-02-02 16:02   ` [v2 5/5] net/mlx5: support HW steering debug dump Hamdan Igbaria
2023-02-12 11:50   ` [v2 1/5] net/mlx5/hws: fix alias_rtc_0 print location in " Matan Azrad
2023-02-14  8:28   ` 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).