On Tue, 7 Apr 2020 16:15:16 +0100
Ferruh Yigit <ferruh.yi...@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)



Reply via email to