DPDK patches and discussions
 help / color / mirror / Atom feed
From: Nithin Dabilpuram <ndabilpuram@marvell.com>
To: <jerinj@marvell.com>, Nithin Dabilpuram <ndabilpuram@marvell.com>,
	"Kiran Kumar K" <kirankumark@marvell.com>,
	Sunil Kumar Kori <skori@marvell.com>,
	Satha Rao <skoteshwar@marvell.com>
Cc: <dev@dpdk.org>
Subject: [PATCH 05/12] common/cnxk: enhance CPT parse header dump
Date: Thu, 16 Jun 2022 12:37:36 +0530	[thread overview]
Message-ID: <20220616070743.30658-5-ndabilpuram@marvell.com> (raw)
In-Reply-To: <20220616070743.30658-1-ndabilpuram@marvell.com>

Enhance CPT parse header dump to dump fragment info
and swap pointers before printing.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
---
 drivers/common/cnxk/roc_cpt_debug.c | 33 +++++++++++++++++++++++++++++++--
 1 file changed, 31 insertions(+), 2 deletions(-)

diff --git a/drivers/common/cnxk/roc_cpt_debug.c b/drivers/common/cnxk/roc_cpt_debug.c
index be6ddb5..5602e53 100644
--- a/drivers/common/cnxk/roc_cpt_debug.c
+++ b/drivers/common/cnxk/roc_cpt_debug.c
@@ -8,6 +8,10 @@
 void
 roc_cpt_parse_hdr_dump(const struct cpt_parse_hdr_s *cpth)
 {
+	struct cpt_frag_info_s *frag_info;
+	uint32_t offset;
+	uint64_t *slot;
+
 	plt_print("CPT_PARSE \t0x%p:", cpth);
 
 	/* W0 */
@@ -19,7 +23,7 @@ roc_cpt_parse_hdr_dump(const struct cpt_parse_hdr_s *cpth)
 		  cpth->w0.pad_len, cpth->w0.num_frags, cpth->w0.pkt_out);
 
 	/* W1 */
-	plt_print("W1: wqe_ptr \t0x%016lx\t", cpth->wqe_ptr);
+	plt_print("W1: wqe_ptr \t0x%016lx\t", plt_be_to_cpu_64(cpth->wqe_ptr));
 
 	/* W2 */
 	plt_print("W2: frag_age \t0x%x\t\torig_pf_func \t0x%04x",
@@ -33,7 +37,32 @@ roc_cpt_parse_hdr_dump(const struct cpt_parse_hdr_s *cpth)
 
 	/* W4 */
 	plt_print("W4: esn \t%" PRIx64 " \t OR frag1_wqe_ptr \t0x%" PRIx64,
-		  cpth->esn, cpth->frag1_wqe_ptr);
+		  cpth->esn, plt_be_to_cpu_64(cpth->frag1_wqe_ptr));
+
+	/* offset of 0 implies 256B, otherwise it implies offset*8B */
+	offset = cpth->w2.fi_offset;
+	offset = (((offset - 1) & 0x1f) + 1) * 8;
+	frag_info = PLT_PTR_ADD(cpth, offset);
+
+	plt_print("CPT Fraginfo \t0x%p:", frag_info);
+
+	/* W0 */
+	plt_print("W0: f0.info \t0x%x", frag_info->w0.f0.info);
+	plt_print("W0: f1.info \t0x%x", frag_info->w0.f1.info);
+	plt_print("W0: f2.info \t0x%x", frag_info->w0.f2.info);
+	plt_print("W0: f3.info \t0x%x", frag_info->w0.f3.info);
+
+	/* W1 */
+	plt_print("W1: frag_size0 \t0x%x", frag_info->w1.frag_size0);
+	plt_print("W1: frag_size1 \t0x%x", frag_info->w1.frag_size1);
+	plt_print("W1: frag_size2 \t0x%x", frag_info->w1.frag_size2);
+	plt_print("W1: frag_size3 \t0x%x", frag_info->w1.frag_size3);
+
+	slot = (uint64_t *)(frag_info + 1);
+	plt_print("Frag Slot2:  WQE ptr \t%p",
+		  (void *)plt_be_to_cpu_64(slot[0]));
+	plt_print("Frag Slot3:  WQE ptr \t%p",
+		  (void *)plt_be_to_cpu_64(slot[1]));
 }
 
 static int
-- 
2.8.4


  parent reply	other threads:[~2022-06-16  7:10 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-16  7:07 [PATCH 01/12] common/cnxk: use computed value for wqe skip Nithin Dabilpuram
2022-06-16  7:07 ` [PATCH 02/12] common/cnxk: avoid CPT backpressure due to errata Nithin Dabilpuram
2022-06-16  7:07 ` [PATCH 03/12] common/cnxk: add PFC support for VFs Nithin Dabilpuram
2022-06-23 16:01   ` Ray Kinsella
2022-06-16  7:07 ` [PATCH 04/12] common/cnxk: support same TC value across multiple queues Nithin Dabilpuram
2022-06-16  7:07 ` Nithin Dabilpuram [this message]
2022-06-16  7:07 ` [PATCH 06/12] common/cnxk: fix mbox structs to avoid unaligned access Nithin Dabilpuram
2022-06-16  7:07 ` [PATCH 07/12] net/cnxk: add SDP link status Nithin Dabilpuram
2022-06-16  7:07 ` [PATCH 08/12] net/cnxk: remove restriction on VFs for PFC config Nithin Dabilpuram
2022-06-16  7:07 ` [PATCH 09/12] net/cnxk: pfc class disable resulting in invalid behaviour Nithin Dabilpuram
2022-06-16  7:07 ` [PATCH 10/12] net/cnxk: resize CQ for Rx security for errata Nithin Dabilpuram
2022-06-16  8:50   ` Jerin Jacob
2022-06-16  7:07 ` [PATCH 11/12] net/cnxk: add SDP VF device ID for probe matching Nithin Dabilpuram
2022-06-16  7:07 ` [PATCH 12/12] event/cnxk: offset timestamp data only if enabled on port Nithin Dabilpuram
2022-06-16  8:45 ` [PATCH 01/12] common/cnxk: use computed value for wqe skip Jerin Jacob
2022-06-16  9:24 ` [PATCH v2 01/12] common/cnxk: use computed value for WQE skip Nithin Dabilpuram
2022-06-16  9:24   ` [PATCH v2 02/12] common/cnxk: avoid CPT backpressure due to errata Nithin Dabilpuram
2022-06-16  9:24   ` [PATCH v2 03/12] common/cnxk: add PFC support for VFs Nithin Dabilpuram
2022-06-16  9:24   ` [PATCH v2 04/12] common/cnxk: support same TC value across multiple queues Nithin Dabilpuram
2022-06-16  9:24   ` [PATCH v2 05/12] common/cnxk: enhance CPT parse header dump Nithin Dabilpuram
2022-06-16  9:24   ` [PATCH v2 06/12] common/cnxk: fix mbox structs to avoid unaligned access Nithin Dabilpuram
2022-06-16  9:24   ` [PATCH v2 07/12] net/cnxk: add SDP link status Nithin Dabilpuram
2022-06-16  9:24   ` [PATCH v2 08/12] net/cnxk: remove restriction on VFs for PFC config Nithin Dabilpuram
2022-06-16  9:24   ` [PATCH v2 09/12] net/cnxk: pfc class disable resulting in invalid behaviour Nithin Dabilpuram
2022-06-16  9:24   ` [PATCH v2 10/12] net/cnxk: resize CQ for Rx security for errata Nithin Dabilpuram
2022-06-16  9:24   ` [PATCH v2 11/12] net/cnxk: add SDP VF device ID for probe matching Nithin Dabilpuram
2022-06-16  9:24   ` [PATCH v2 12/12] event/cnxk: offset timestamp data only if enabled on port Nithin Dabilpuram
2022-06-16 10:30     ` Nithin Kumar Dabilpuram
2022-06-20 17:26   ` [PATCH v2 01/12] common/cnxk: use computed value for WQE skip Jerin Jacob

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=20220616070743.30658-5-ndabilpuram@marvell.com \
    --to=ndabilpuram@marvell.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=kirankumark@marvell.com \
    --cc=skori@marvell.com \
    --cc=skoteshwar@marvell.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).