DPDK patches and discussions
 help / color / mirror / Atom feed
From: Erez Shitrit <erezsh@nvidia.com>
To: <erezsh@nvidia.com>, <valex@nvidia.com>, <viacheslavo@nvidia.com>,
	<thomas@monjalon.net>, <suanmingm@nvidia.com>,
	Matan Azrad <matan@nvidia.com>
Cc: <dev@dpdk.org>, <orika@nvidia.com>, Hamdan Igbaria <hamdani@nvidia.com>
Subject: [PATCH V1 11/11] net/mlx5/hws: add debug details for cross gvmi
Date: Sun, 18 Dec 2022 17:08:52 +0200	[thread overview]
Message-ID: <20221218150853.2167280-12-erezsh@nvidia.com> (raw)
In-Reply-To: <20221218150853.2167280-1-erezsh@nvidia.com>


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(-)

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;
-- 
2.18.2


  parent reply	other threads:[~2022-12-21 10:19 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-18 15:08 [PATCH V1 00/11] Support resource sharing among ibv_devices Erez Shitrit
2022-12-18 15:08 ` [PATCH V1 01/11] mailmap: add new contributors to the list Erez Shitrit
2022-12-18 15:08 ` [PATCH V1 02/11] net/mlx5/hws: add capabilities fields for vhca access Erez Shitrit
2022-12-18 15:08 ` [PATCH V1 03/11] net/mlx5/hws: remove wrong PRM capability macros Erez Shitrit
2022-12-18 15:08 ` [PATCH V1 04/11] net/mlx5/hws: add PRM definitions for cross-vhca capabilities Erez Shitrit
2022-12-18 15:08 ` [PATCH V1 05/11] net/mlx5/hws: read " Erez Shitrit
2022-12-18 15:08 ` [PATCH V1 06/11] net/mlx5/hws: added allow-other-vhca-access command Erez Shitrit
2022-12-18 15:08 ` [PATCH V1 07/11] net/mlx5/hws: added command to create alias objects Erez Shitrit
2022-12-18 15:08 ` [PATCH V1 08/11] net/mlx5/hws: add vhca identifier ID to the caps Erez Shitrit
2022-12-18 15:08 ` [PATCH V1 09/11] net/mlx5/hws: support shared ibv-context with local one Erez Shitrit
2022-12-18 15:08 ` [PATCH V1 10/11] net/mlx5/hws: support actions while shared resources is used Erez Shitrit
2022-12-18 15:08 ` Erez Shitrit [this message]
2022-12-27 15:49   ` [PATCH V1 11/11] net/mlx5/hws: add debug details for cross gvmi Slava Ovsiienko
2022-12-19  8:24 [PATCH V1 00/11] Support resource sharing among ibv_devices Erez Shitrit
2022-12-19  8:24 ` [PATCH V1 11/11] net/mlx5/hws: add debug details for cross gvmi Erez Shitrit
2022-12-27 15:48   ` Slava Ovsiienko

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=20221218150853.2167280-12-erezsh@nvidia.com \
    --to=erezsh@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=hamdani@nvidia.com \
    --cc=matan@nvidia.com \
    --cc=orika@nvidia.com \
    --cc=suanmingm@nvidia.com \
    --cc=thomas@monjalon.net \
    --cc=valex@nvidia.com \
    --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).