dev.dpdk.org archive mirror
 help / color / mirror / Atom feed
From: Prashant Gupta <prashant.gupta_3@nxp.com>
To: dev@dpdk.org, stephen@networkplumber.org, david.marchand@redhat.com
Cc: stable@dpdk.org, Jun Yang <jun.yang@nxp.com>
Subject: [PATCH 05/15] net/dpaa2: fix error frame dump issue
Date: Tue, 14 Oct 2025 12:10:25 +0530	[thread overview]
Message-ID: <20251014064035.1312896-6-prashant.gupta_3@nxp.com> (raw)
In-Reply-To: <20251014064035.1312896-1-prashant.gupta_3@nxp.com>

From: Jun Yang <jun.yang@nxp.com>

Dump error frame payload according to mbuf format.
Meanwhile, support dumping parser result of error frame.

Fixes: 4690a6114ff6 ("net/dpaa2: enable error queues optionally")
Cc: stable@dpdk.org

Signed-off-by: Jun Yang <jun.yang@nxp.com>
---
 drivers/net/dpaa2/dpaa2_rxtx.c | 38 ++++++++++++++++++++++++++++------
 1 file changed, 32 insertions(+), 6 deletions(-)

diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c
index 6cb91e67d4..7caccfa469 100644
--- a/drivers/net/dpaa2/dpaa2_rxtx.c
+++ b/drivers/net/dpaa2/dpaa2_rxtx.c
@@ -629,9 +629,11 @@ dump_err_pkts(struct dpaa2_queue *dpaa2_q)
 	const struct qbman_fd *fd;
 	struct qbman_pull_desc pulldesc;
 	struct rte_eth_dev_data *eth_data = dpaa2_q->eth_data;
-	uint32_t lcore_id = rte_lcore_id();
+	uint32_t lcore_id = rte_lcore_id(), i = 0;
 	void *v_addr, *hw_annot_addr;
 	struct dpaa2_fas *fas;
+	struct rte_mbuf *mbuf;
+	char title[32];
 
 	if (unlikely(!DPAA2_PER_LCORE_DPIO)) {
 		ret = dpaa2_affine_qbman_swp();
@@ -687,13 +689,37 @@ dump_err_pkts(struct dpaa2_queue *dpaa2_q)
 		hw_annot_addr = (void *)((size_t)v_addr + DPAA2_FD_PTA_SIZE);
 		fas = hw_annot_addr;
 
-		DPAA2_PMD_ERR("[%d] error packet on port[%d]:"
-			" fd_off: %d, fd_err: %x, fas_status: %x",
-			rte_lcore_id(), eth_data->port_id,
+		if (DPAA2_FD_GET_FORMAT(fd) == qbman_fd_sg)
+			mbuf = eth_sg_fd_to_mbuf(fd, eth_data->port_id);
+		else
+			mbuf = eth_fd_to_mbuf(fd, eth_data->port_id);
+
+		if (!dpaa2_print_parser_result) {
+			/** Don't print parse result twice.*/
+			dpaa2_print_parse_result(hw_annot_addr);
+		}
+
+		DPAA2_PMD_ERR("Err pkt on port[%d]:", eth_data->port_id);
+		DPAA2_PMD_ERR("FD offset: %d, FD err: %x, FAS status: %x",
 			DPAA2_GET_FD_OFFSET(fd), DPAA2_GET_FD_ERR(fd),
 			fas->status);
-		rte_hexdump(stderr, "Error packet", v_addr,
-			DPAA2_GET_FD_OFFSET(fd) + DPAA2_GET_FD_LEN(fd));
+
+		if (mbuf)
+			__rte_mbuf_sanity_check(mbuf, 1);
+		if (mbuf->nb_segs > 1) {
+			while (mbuf) {
+				sprintf(title, "Payload seg[%d]", i);
+				rte_hexdump(stderr, title,
+					(char *)mbuf->buf_addr + mbuf->data_off,
+					mbuf->data_len);
+				mbuf = mbuf->next;
+				i++;
+			}
+		} else {
+			rte_hexdump(stderr, "Payload",
+				(char *)mbuf->buf_addr + mbuf->data_off,
+				mbuf->data_len);
+		}
 
 		rte_pktmbuf_free(mbuf);
 		dq_storage++;
-- 
2.43.0


  parent reply	other threads:[~2025-10-14  7:22 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-14  6:40 [PATCH 00/15] dpaa2: Fixes and enhancements for DPMAC, stats, and parser Prashant Gupta
2025-10-14  6:40 ` [PATCH 01/15] net/dpaa2: fix uninitialized variable issue Prashant Gupta
2025-10-14  6:40 ` [PATCH 02/15] net/dpaa2: fix to free buffers from error queue Prashant Gupta
2025-10-14  6:40 ` [PATCH 03/15] net/dpaa2: fix L3/L4 csum results in packet parse Prashant Gupta
2025-10-14  6:40 ` [PATCH 04/15] net/dpaa2: fix to recv packets with additional parse errors Prashant Gupta
2025-10-14  6:40 ` Prashant Gupta [this message]
2025-10-14  6:40 ` [PATCH 06/15] net/dpaa2: fix flow rule's resizing issue Prashant Gupta
2025-10-14  6:40 ` [PATCH 07/15] net/dpaa2: add dpmac MC header file Prashant Gupta
2025-10-14  6:40 ` [PATCH 08/15] net/dpaa2: support dpmac counters in stats Prashant Gupta
2025-10-14  6:40 ` [PATCH 09/15] net/dpaa2: setup the speed cap based on the actual MAC Prashant Gupta
2025-10-14  6:40 ` [PATCH 10/15] drivers: dpaa2 upgrade fslmc base FW to 10.39.0 Prashant Gupta
2025-10-14  6:40 ` [PATCH 11/15] net/dpaa2: replace global variable to driver flag Prashant Gupta
2025-10-14  6:40 ` [PATCH 12/15] net/dpaa2: add devargs to drop parse packets in HW Prashant Gupta
2025-10-14  6:40 ` [PATCH 13/15] net/dpaa2: optimize to prefetch next parser result Prashant Gupta
2025-10-14  6:40 ` [PATCH 14/15] net/dpaa2: add eCPRI header and message dump Prashant Gupta
2025-10-14  6:40 ` [PATCH 15/15] net/dpaa2: add Policer stats for each TC Prashant Gupta
  -- strict thread matches above, loose matches on Subject: below --
2025-10-14  6:00 [PATCH 00/15] dpaa2: Fixes and enhancements for DPMAC, stats, and parser Prashant Gupta
2025-10-14  6:00 ` [PATCH 05/15] net/dpaa2: fix error frame dump issue Prashant Gupta

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=20251014064035.1312896-6-prashant.gupta_3@nxp.com \
    --to=prashant.gupta_3@nxp.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=jun.yang@nxp.com \
    --cc=stable@dpdk.org \
    --cc=stephen@networkplumber.org \
    /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).