DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
	Andrew Rybchenko <arybchenko@solarflare.com>
Subject: [dpdk-dev] [PATCH v3] mbuf: display more fields in dump
Date: Wed, 22 Jan 2020 09:39:56 -0800	[thread overview]
Message-ID: <20200122173956.25527-1-stephen@networkplumber.org> (raw)
In-Reply-To: <20191120174125.23704-1-stephen@networkplumber.org>

The rte_pktmbuf_dump should display offset, refcount, and vlan
info since these are often useful during debugging.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
v3 - only display vlan tci if offload flags say it is there
     display packet type
v2 - remove casts, change in_port to port
     the refcount and offset are property of per-segment

 lib/librte_mbuf/rte_mbuf.c | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c
index 25eea1db259d..56a1a98a6c0c 100644
--- a/lib/librte_mbuf/rte_mbuf.c
+++ b/lib/librte_mbuf/rte_mbuf.c
@@ -675,18 +675,25 @@ rte_pktmbuf_dump(FILE *f, const struct rte_mbuf *m, unsigned dump_len)
 
 	__rte_mbuf_sanity_check(m, 1);
 
-	fprintf(f, "dump mbuf at %p, iova=%"PRIx64", buf_len=%u\n",
-	       m, (uint64_t)m->buf_iova, (unsigned)m->buf_len);
-	fprintf(f, "  pkt_len=%"PRIu32", ol_flags=%"PRIx64", nb_segs=%u, "
-	       "in_port=%u\n", m->pkt_len, m->ol_flags,
-	       (unsigned)m->nb_segs, (unsigned)m->port);
+	fprintf(f, "dump mbuf at %p, iova=%#"PRIx64", buf_len=%u\n",
+		m, m->buf_iova, m->buf_len);
+	fprintf(f, "  pkt_len=%u, ol_flags=%#"PRIx64", nb_segs=%u, port=%u",
+		m->pkt_len, m->ol_flags, m->nb_segs, m->port);
+
+	if (m->ol_flags & (PKT_RX_VLAN | PKT_TX_VLAN))
+		fprintf(f, ", vlan_tci=%u", m->vlan_tci);
+
+	fprintf(f, ", ptype=%#"PRIx32"\n", m->packet_type);
+
 	nb_segs = m->nb_segs;
 
 	while (m && nb_segs != 0) {
 		__rte_mbuf_sanity_check(m, 0);
 
-		fprintf(f, "  segment at %p, data=%p, data_len=%u\n",
-			m, rte_pktmbuf_mtod(m, void *), (unsigned)m->data_len);
+		fprintf(f, "  segment at %p, data=%p, len=%u, off=%u, refcnt=%u\n",
+			m, rte_pktmbuf_mtod(m, void *),
+			m->data_len, m->data_off, rte_mbuf_refcnt_read(m));
+
 		len = dump_len;
 		if (len > m->data_len)
 			len = m->data_len;
-- 
2.20.1


  parent reply	other threads:[~2020-01-22 17:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-20 17:41 [dpdk-dev] [PATCH] " Stephen Hemminger
2019-11-21 16:16 ` Morten Brørup
2019-11-21 16:43   ` Stephen Hemminger
2019-11-21 18:30 ` [dpdk-dev] [PATCH v2] " Stephen Hemminger
2019-11-22 12:31   ` Andrew Rybchenko
2019-12-26 16:15   ` Olivier Matz
2019-12-26 16:58     ` Stephen Hemminger
2019-12-27  9:10       ` Olivier Matz
2019-12-27 17:05         ` Stephen Hemminger
2019-12-30  8:11           ` Olivier Matz
2020-01-22 17:39 ` Stephen Hemminger [this message]
2020-02-06  9:48   ` [dpdk-dev] [PATCH v3] " Olivier Matz
2020-02-06 14:32     ` Thomas Monjalon

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=20200122173956.25527-1-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=arybchenko@solarflare.com \
    --cc=dev@dpdk.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).