> -----Original Message----- > From: Stephen Hemminger [mailto:step...@networkplumber.org] > Sent: Thursday, April 9, 2020 10:51 PM > To: wangyunjian <wangyunj...@huawei.com> > Cc: Ferruh Yigit <ferruh.yi...@intel.com>; dev@dpdk.org; > keith.wi...@intel.com; Lilijun (Jerry) <jerry.lili...@huawei.com>; xudingke > <xudin...@huawei.com>; sta...@dpdk.org > Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH v3 1/5] net/tap: fix mbuf double > free when writev fails > > On Thu, 9 Apr 2020 08:03:23 +0000 > wangyunjian <wangyunj...@huawei.com> wrote: > > > error = tap_write_mbufs(txq, num_mbufs, mbuf, > > &num_packets, &num_tx_bytes); if (error == -1) { > > txq->stats.errs++; > > /* free tso mbufs */ > > for (j = 0; j < ret; j++) > > rte_pktmbuf_free(mbuf[j]); > > break; > > } > > There is a free bulk, and normally each buf counts against errors. > > if (error == -1) { > txq->stats.errs += num_packets;
I think to consider only the original packet number, not sent packets. > rte_pktmbuf_free_bulk(mbuf, num_packets); Thanks for your suggestion, will include it in next version. Yunjian > break; > }