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 AEBEFA04FE; Thu, 26 Dec 2019 17:58:58 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A51531BFBD; Thu, 26 Dec 2019 17:58:57 +0100 (CET) Received: from mail-pj1-f67.google.com (mail-pj1-f67.google.com [209.85.216.67]) by dpdk.org (Postfix) with ESMTP id E92371BF95 for ; Thu, 26 Dec 2019 17:58:55 +0100 (CET) Received: by mail-pj1-f67.google.com with SMTP id d5so3525047pjz.5 for ; Thu, 26 Dec 2019 08:58:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=onT5s+om8BYBKVMofzyz3sJZWwH2a8qmpo0yszR6t+c=; b=s5rYqfW33TKb10UrgJB5/CO1212CDUTxFcAd/5fS3v+3pU6IONjBTiMS1MonUKYZWN eHeKI+siBQ85kbSz8/KJteQVV4YT0p0tVGk2i6Bb0U0Uebb8EiDn2F8q8L/gScz5ebsv 0SyaN85Jkb7FJz71rkJw74jg7BDtKUJN8BU/NFXgg8DZjsukWAYRVdImxE3HlT2QtUAe nrsShQEYgXZhr6fTNwqjS4O4ELel1cgTjPVbZnr5e01Kp2cbv8N0Ml0fTVUVa4rFBL5J +83JPo0YRbCqumGWK2Cf6f/ln6LcmKs4FS6VM0fNXOR+QElhYcOMEhQuCBioAVbmnKn7 LONw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=onT5s+om8BYBKVMofzyz3sJZWwH2a8qmpo0yszR6t+c=; b=oocf9Nj9i139Yjx8ON8F0ITsK3Bzb4d1smPDlrM+7iGUDvNX3PRJCFgT3VyJ8Tug1+ 9weUhLype34GCNB9oDmwemnLN6krfVIel3fSWQ6epPvN84lNGmJ4rGpjWpw97XcPutbW 8XExiUViFfSzO5quWaxeu3vzjZ0G+kBo8irdNd1QJv1kQf9t3+sNAe3WyTb7lRUAODNF VgAxrSHPmKa3bNagZDO54HcSSfxJjCk86DJrNv5yfmMf/k/OXwmZbi6gCJzxncISjBJF pvGbIB9ZCdKlGNYnMt7SfwIVJ9bBClxqFce1S9ZSlMS5s/wE3pE2B3JUYjpPEZDWSXKF UTIA== X-Gm-Message-State: APjAAAVBGrLMEv9sYgcqLn7MnN9gTQY5Ld/3dSDIXavVjMcf640Z3YfG oneMEaLAZCddhV/mjTKicRVbIA== X-Google-Smtp-Source: APXvYqyt2zglQQClz9iNRRzUk2AzrfAzY+Y+y8JrzY+Spxl5SJdT/kqp0Nt6Q632uJNOln9wjWdeYQ== X-Received: by 2002:a17:90a:22e7:: with SMTP id s94mr21092865pjc.12.1577379534863; Thu, 26 Dec 2019 08:58:54 -0800 (PST) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id r30sm35529834pfl.162.2019.12.26.08.58.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Dec 2019 08:58:54 -0800 (PST) Date: Thu, 26 Dec 2019 08:58:51 -0800 From: Stephen Hemminger To: Olivier Matz Cc: dev@dpdk.org Message-ID: <20191226085851.7f47ed81@hermes.lan> In-Reply-To: <20191226161539.GI22738@platinum> References: <20191120174125.23704-1-stephen@networkplumber.org> <20191121183055.8096-1-stephen@networkplumber.org> <20191226161539.GI22738@platinum> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [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" On Thu, 26 Dec 2019 17:15:39 +0100 Olivier Matz wrote: > Hi, > > On Thu, Nov 21, 2019 at 10:30:55AM -0800, Stephen Hemminger wrote: > > 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 > > > > Thanks for this enhancement. > > One comment however: I don't see why vlan_tci would be important than > packet type or rss tag. It is also a bit confusing to display a field > which can have a random value (if the vlan flag is not set in ol_flags). > > I'd prefer to dump vlan_tci only if the flag is present. Later we could > add more fields with the same logic. What do you think? Because this is a debugging hook and easier to always display the value. Thats all.