From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id C9AB2A0532; Wed, 22 Jan 2020 18:40:07 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F2B792BBD; Wed, 22 Jan 2020 18:40:06 +0100 (CET) Received: from mail-pf1-f193.google.com (mail-pf1-f193.google.com [209.85.210.193]) by dpdk.org (Postfix) with ESMTP id EDF6E2BB9 for ; Wed, 22 Jan 2020 18:40:05 +0100 (CET) Received: by mail-pf1-f193.google.com with SMTP id x185so179279pfc.5 for ; Wed, 22 Jan 2020 09:40:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/FxHU0vLmeGyaIplbcNXmNQUmHMMdMI5DT3MnAjPnbc=; b=FwonrjM+//GIeL2Dhr8EuGWEfdCk2nKWLjkp7VeAYFHrCbWV8zor7A2FBlkzkjr+pl +u9KPq5nxK1DGwwAcIUSd4Vr3qshu/mWd/dz/sa6mVOEyCH/1SLa9S1jRauUSMnJf6UI 82yBZfpdZcBDmDRpa2B+4H+WqQqZn6Di1g6oy5DG5aTU5Uhns5++Fd1/vlmJlEZzfTmA 2AsPnVYZz+jqLfMwU29XpvYizpnpYKj/DqSEwdbFMX9sIO7vHVDesIQImU5E8v4DiyIh 1SMJHlmY8E6Y9SGmSy5GkEQpCRptBZ/4L9ZeOjy22CLcWyObskkCoWQC9wug8QbPCw8I 3wGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/FxHU0vLmeGyaIplbcNXmNQUmHMMdMI5DT3MnAjPnbc=; b=jdSQm9QH4IxV7xD7HTPyYcH9XGUiEEKRCLQyuwR1rFVf1PZg7Vx43EOkhJw0Mbjv6U nW2vJK0dAGZgr+uN9pHx4VFgrS2IDxqE2h1ffrBj3TyqR9mpYIN9yN8SpJuqXBfalaMS i+l3WaxBpww7tPwB8gRsdDN075yn5cA74Yvmd0yXIQvwrK/qik8QJgTnxMpBCwIxyxl0 AQrSnQMVQyRStjD9DlpYm3qPMQayrF1TINRGc3rVfmJHxclO5BqNBGKz+WbZWRL4buO4 3oCbX39Iue5ycUhsgTaXkfndQ8EHcoIz/4YAtDaIEYbYAcUS0fqd9wtZB7qpOCMZNSOt p4qw== X-Gm-Message-State: APjAAAXn7Y2pREOeRytMP7jh8uwI/8tTxjev+9CjZjZF8HPuYNuX3Vxe dPhgcqAReS49mIUYiiGjkXFIJumXFEQ= X-Google-Smtp-Source: APXvYqw/2pBc+Zl/N+0jZQhVCcsKDU5VGl+mvHDlc6J3DhPd1UKHq/yGCvHPJfg/qepIwnWOR85h/A== X-Received: by 2002:aa7:824d:: with SMTP id e13mr3541273pfn.247.1579714804391; Wed, 22 Jan 2020 09:40:04 -0800 (PST) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id q199sm49361167pfq.163.2020.01.22.09.40.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jan 2020 09:40:03 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Andrew Rybchenko Date: Wed, 22 Jan 2020 09:39:56 -0800 Message-Id: <20200122173956.25527-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191120174125.23704-1-stephen@networkplumber.org> References: <20191120174125.23704-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3] mbuf: display more fields in dump X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The rte_pktmbuf_dump should display offset, refcount, and vlan info since these are often useful during debugging. Signed-off-by: Stephen Hemminger Acked-by: Andrew Rybchenko --- 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