[V1,11/11] net/mlx5/hws: add debug details for cross gvmi

Message ID 20221218150853.2167280-12-erezsh@nvidia.com (mailing list archive)
State Superseded, archived
Delegated to: Raslan Darawsheh
Headers
Series Support resource sharing among ibv_devices |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS

Commit Message

Erez Shitrit Dec. 18, 2022, 3:08 p.m. UTC
  For context, table and matcher.

Signed-off-by: Erez Shitrit <erezsh@nvidia.com>
Signed-off-by: Hamdan Igbaria <hamdani@nvidia.com>
Reviewed-by: Alex Vesker <valex@nvidia.com>
---
 drivers/net/mlx5/hws/mlx5dr_debug.c | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)
  

Comments

Slava Ovsiienko Dec. 27, 2022, 3:49 p.m. UTC | #1
> -----Original Message-----
> From: Erez Shitrit <erezsh@nvidia.com>
> Sent: Sunday, December 18, 2022 5:09 PM
> To: Erez Shitrit <erezsh@nvidia.com>; Alex Vesker <valex@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>; Hamdan Igbaria
> <hamdani@nvidia.com>
> Subject: [PATCH V1 11/11] net/mlx5/hws: add debug details for cross gvmi
> 
> 
> For context, table and matcher.
> 
> Signed-off-by: Erez Shitrit <erezsh@nvidia.com>
> Signed-off-by: Hamdan Igbaria <hamdani@nvidia.com>
> Reviewed-by: Alex Vesker <valex@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
  

Patch

diff --git a/drivers/net/mlx5/hws/mlx5dr_debug.c b/drivers/net/mlx5/hws/mlx5dr_debug.c
index 55011c208d..239dfcae46 100644
--- a/drivers/net/mlx5/hws/mlx5dr_debug.c
+++ b/drivers/net/mlx5/hws/mlx5dr_debug.c
@@ -177,6 +177,7 @@  mlx5dr_debug_dump_matcher_attr(FILE *f, struct mlx5dr_matcher *matcher)
 
 static int mlx5dr_debug_dump_matcher(FILE *f, struct mlx5dr_matcher *matcher)
 {
+	bool is_shared = mlx5dr_context_shared_gvmi_used(matcher->tbl->ctx);
 	bool is_root = matcher->tbl->level == MLX5DR_ROOT_LEVEL;
 	enum mlx5dr_table_type tbl_type = matcher->tbl->type;
 	struct mlx5dr_devx_obj *ste_0, *ste_1 = NULL;
@@ -205,11 +206,13 @@  static int mlx5dr_debug_dump_matcher(FILE *f, struct mlx5dr_matcher *matcher)
 		ste_1 = NULL;
 	}
 
-	ret = fprintf(f, ",%d,%d,%d,%d",
+	ret = fprintf(f, ",%d,%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);
+		      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;
 
@@ -253,18 +256,20 @@  static int mlx5dr_debug_dump_matcher(FILE *f, struct mlx5dr_matcher *matcher)
 
 static int mlx5dr_debug_dump_table(FILE *f, struct mlx5dr_table *tbl)
 {
+	bool is_shared = mlx5dr_context_shared_gvmi_used(tbl->ctx);
 	bool is_root = tbl->level == MLX5DR_ROOT_LEVEL;
 	struct mlx5dr_matcher *matcher;
 	int ret;
 
-	ret = fprintf(f, "%d,0x%" PRIx64 ",0x%" PRIx64 ",%d,%d,%d,%d\n",
+	ret = fprintf(f, "%d,0x%" PRIx64 ",0x%" PRIx64 ",%d,%d,%d,%d,%d\n",
 		      MLX5DR_DEBUG_RES_TYPE_TABLE,
 		      (uint64_t)(uintptr_t)tbl,
 		      (uint64_t)(uintptr_t)tbl->ctx,
 		      is_root ? 0 : tbl->ft->id,
 		      tbl->type,
 		      is_root ? 0 : tbl->fw_ft_type,
-		      tbl->level);
+		      tbl->level,
+		      is_shared && !is_root ? tbl->local_ft->id : 0);
 	if (ret < 0) {
 		rte_errno = EINVAL;
 		return rte_errno;
@@ -383,12 +388,17 @@  static int mlx5dr_debug_dump_context_attr(FILE *f, struct mlx5dr_context *ctx)
 {
 	int ret;
 
-	ret = fprintf(f, "%u,0x%" PRIx64 ",%d,%zu,%d\n",
+	ret = fprintf(f, "%u,0x%" PRIx64 ",%d,%zu,%d,%s,%d,%d\n",
 		      MLX5DR_DEBUG_RES_TYPE_CONTEXT_ATTR,
 		      (uint64_t)(uintptr_t)ctx,
 		      ctx->pd_num,
 		      ctx->queues,
-		      ctx->send_queue->num_entries);
+		      ctx->send_queue->num_entries,
+		      mlx5dr_context_shared_gvmi_used(ctx) ?
+		      mlx5_glue->get_device_name(ctx->ibv_ctx->device) : "None",
+		      ctx->caps->vhca_id,
+		      mlx5dr_context_shared_gvmi_used(ctx) ?
+		      ctx->caps->shared_vhca_id : 0xffff);
 	if (ret < 0) {
 		rte_errno = EINVAL;
 		return rte_errno;