From: Stephen Hemminger <stephen@networkplumber.org>
To: Ferruh Yigit <ferruh.yigit@intel.com>
Cc: wangyunjian <wangyunjian@huawei.com>,
dev@dpdk.org, keith.wiles@intel.com, jerry.lilijun@huawei.com,
xudingke@huawei.com, stable@dpdk.org
Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH v3 3/5] net/tap: fix check for mbuf's nb_segs failure
Date: Tue, 7 Apr 2020 08:38:46 -0700 [thread overview]
Message-ID: <20200407083846.674ca9e4@hermes.lan> (raw)
In-Reply-To: <7da1388e-c4c6-27d5-f038-0526a39d9a8c@intel.com>
On Tue, 7 Apr 2020 16:15:16 +0100
Ferruh Yigit <ferruh.yigit@intel.com> wrote:
> > +static void
> > +tap_rxq_pool_free(struct rte_mbuf *pool)
> > +{
> > + struct rte_mbuf *mbuf = pool;
> > + uint16_t nb_segs = 1;
> > +
> > + if (mbuf == NULL)
> > + return;
> > +
> > + while (mbuf->next) {
> > + mbuf = mbuf->next;
> > + nb_segs++;
> > + }
> > + pool->nb_segs = nb_segs;
> > + rte_pktmbuf_free(pool);
> > +}
Since mbuf is going to be free, why bother with nb_segs.
Since rte_pktmbuf_free takes NULL as an argument, and frees the m->next chain
I don't see why not just
rte_pktmbuf_free(pool)
next prev parent reply other threads:[~2020-04-07 15:39 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-07 4:23 [dpdk-dev] " wangyunjian
2020-04-07 15:15 ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
2020-04-07 15:38 ` Stephen Hemminger [this message]
2020-04-07 15:45 ` Ferruh Yigit
2020-04-07 15:49 ` Ferruh Yigit
2020-04-07 16:08 ` Stephen Hemminger
2020-04-08 1:10 ` wangyunjian
2020-04-07 15:58 ` Ferruh Yigit
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=20200407083846.674ca9e4@hermes.lan \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=jerry.lilijun@huawei.com \
--cc=keith.wiles@intel.com \
--cc=stable@dpdk.org \
--cc=wangyunjian@huawei.com \
--cc=xudingke@huawei.com \
/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).