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 8B27EA04C1; Thu, 21 Nov 2019 19:31:07 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 784522BA2; Thu, 21 Nov 2019 19:31:06 +0100 (CET) Received: from mail-pl1-f193.google.com (mail-pl1-f193.google.com [209.85.214.193]) by dpdk.org (Postfix) with ESMTP id 08648237 for ; Thu, 21 Nov 2019 19:31:04 +0100 (CET) Received: by mail-pl1-f193.google.com with SMTP id ay6so1975824plb.0 for ; Thu, 21 Nov 2019 10:31:04 -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=E/T/evwwKGU4tr1T7Pq5/cYrD2w9nzhCDWTixhZChQc=; b=Wv3bOALdtM3aWMqbxi9t1I5DdkpNUIq8qowLts3f/jwkIFacJYdivEe4xE+1+LhMgO 7CNha8Ar3UB5zjMhPaFC5s/+hAp0SJX2Hhizl+OdAvhLwX1kwrtdzYPVpYoh/54eJu54 Wt9H79jOx8fYn+oipdHZklCVOLChxOKSmGf9+bzAvcG+OuGM5b0/wNxkqmtXCgJhakAr XbA5l26OQLZPEuiAHIKq1Zshrqg8Gsx3JiZ4ZNQYVvHxD7wJZSxuvZDkjAhc0cp68aHM hcYLJlTLCbWIvsvtfM/fDfVTXxw75HElrAAFCjAN9OjsO3U4OM12nc6+bgRdvPaX2/QP LWtg== 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=E/T/evwwKGU4tr1T7Pq5/cYrD2w9nzhCDWTixhZChQc=; b=bvXMBRDZTLLPdJURxFI+bkxR3REjtgistLyXsSpPQH6GDxdBd4QjKGzkUObAt0KqTY AyusH938HYhPLq0opBStmbT5DucvqyXW13Cno7FHgtzRMXBFJd65mgzE0QagXk1EEpRI jGw1+FX1/xryWUFwVCr6rLZkc2Fkn8kqqwxMxt17T9Q+5qbT1/mnwP8ZjrR/UCF9+OnF oyG/4pgKlp0m0qDQw48pVVcUzJDRrQgXk1ucEIM7m5SkJQwb1p8Zvm8SpxfCyUX5mc6u uN+RbtNjY5ATRawc6aAkOGoE0zQzoFp0yYMbD19NdHUtaz8r8ywPFASvc2UtClojppv2 tzLA== X-Gm-Message-State: APjAAAWjcqjGwiGgoYiQVozkiF/dZcXSgiKHV3L4A7l9BpFw6PFcWT9C 3+l9gQxt8fNcXuCmS56WE6db1UdOeDnYxA== X-Google-Smtp-Source: APXvYqywDlN7bk0F/D7/psWVdpPxlsY3eQ4jltuMv1Ed8Jxdsvduvhxf9wWJvOKywTFYdMu7Bv9GtA== X-Received: by 2002:a17:902:ab93:: with SMTP id f19mr9671558plr.187.1574361063477; Thu, 21 Nov 2019 10:31:03 -0800 (PST) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id 6sm4502972pfy.43.2019.11.21.10.31.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Nov 2019 10:31:02 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Thu, 21 Nov 2019 10:30:55 -0800 Message-Id: <20191121183055.8096-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 v2] 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 --- v2 - remove casts, change in_port to port the refcount and offset are property of per-segment lib/librte_mbuf/rte_mbuf.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c index 35df1c4c38a5..4894d46628e3 100644 --- a/lib/librte_mbuf/rte_mbuf.c +++ b/lib/librte_mbuf/rte_mbuf.c @@ -473,18 +473,21 @@ 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, vlan_tci=%#x\n", + m->pkt_len, m->ol_flags, m->nb_segs, m->port, m->vlan_tci); + 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