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 A343EA04FE; Thu, 26 Dec 2019 17:15:42 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C637A1BFAE; Thu, 26 Dec 2019 17:15:41 +0100 (CET) Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by dpdk.org (Postfix) with ESMTP id F2D111BFA7 for ; Thu, 26 Dec 2019 17:15:40 +0100 (CET) Received: by mail-wr1-f68.google.com with SMTP id c9so23987776wrw.8 for ; Thu, 26 Dec 2019 08:15:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=rQq3G1y5yEwca9Xa0vq0Ll8oeW5HUNTMMEOYZ1Lo6FM=; b=eEVnR8qJpM3XoeNSBRBnqFbb9ePoKFikaJKIMkbOXYU+11RqOmhSqCbnVAZUPTaFBk ZWmPOJ+o6yDgIg2JBU/BDsjdlpA8iJbBlv9YMurRMzHtQt5AcCf8j8TJfUEZe7DoCLOh zI2NCGlspVTPJZ4WQH4SAWqzWUSwcI2n9p7Q98yhDNTcGCaZQiQTOly4Ct79p4BKeaRW 03D9PbBL4BilWoXltHW3pN7ZrX1DQBclqL4AcSOea0QUdsZtbd9qzygTWXWX+IlJRjnh n2TqinlEHJQvEw3frEfUBKIq/vDM1WAfPCdYVEF53+26wAFEKvnYZ73ou0w3XPPB2gl+ aPYQ== 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:references :mime-version:content-disposition:in-reply-to:user-agent; bh=rQq3G1y5yEwca9Xa0vq0Ll8oeW5HUNTMMEOYZ1Lo6FM=; b=XgUp1yqQrgz/yqmrZb7BYO5J/7aJi0E0YLWK8YV7CoS/helL7ou3I4d44YoG8YWkBZ /pjm4cF2dXORY0zmNG5KxL2NUXNnPLOd+jw9vIz4HTkLA+Wpg1C1vxZ3M1JlT66YreXT YIwneZwWaKazCpYieShHDhiWBTRPVzGc0w0lk2Z7h8jBGi3MN7tgXV7Da2WlISR93E7H n8tgtbS6RR1/7JxVrT5TQ4Y742tigCWfFIiYCKyoD4OmC3+oXfbP0NBPCz6Vf/oGMqAt Sc3nYimLHjO/tLOLh2+4ZUAgp2VO18iMi7GXXxHjKXVWIol2unqc2tg0OVhhGEECcgsO b78g== X-Gm-Message-State: APjAAAWQNMGhPDHwT0EZUo6sRlB+RJbl5MX7iz/DD1aMjf6/y6ltJv27 QSzzDTqp/eERv0Dfkb+GVJBoe+OLLqo= X-Google-Smtp-Source: APXvYqyjsV88JWXHFWxjZ+O/wB4HaR4atrEB0l/0WWyaUkXMSMiMwxqt9niSmjecuettjUJ0TRWtqA== X-Received: by 2002:a5d:494b:: with SMTP id r11mr46313233wrs.184.1577376940699; Thu, 26 Dec 2019 08:15:40 -0800 (PST) Received: from 6wind.com (2a01cb0c0005a600345636f7e65ed1a0.ipv6.abo.wanadoo.fr. [2a01:cb0c:5:a600:3456:36f7:e65e:d1a0]) by smtp.gmail.com with ESMTPSA id f1sm32167378wrp.93.2019.12.26.08.15.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Dec 2019 08:15:40 -0800 (PST) Date: Thu, 26 Dec 2019 17:15:39 +0100 From: Olivier Matz To: Stephen Hemminger Cc: dev@dpdk.org Message-ID: <20191226161539.GI22738@platinum> References: <20191120174125.23704-1-stephen@networkplumber.org> <20191121183055.8096-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191121183055.8096-1-stephen@networkplumber.org> User-Agent: Mutt/1.10.1 (2018-07-13) 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" 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? Olivier