On Mon, Oct 09, 2017 at 12:44:25PM +0000, Ananyev, Konstantin wrote: > Hi Zhang, > > > -----Original Message----- > > From: dev [mailto:dev-boun...@dpdk.org] On Behalf Of Qi Zhang > > Sent: Monday, October 9, 2017 9:54 AM > > To: Wu, Jingjing <jingjing...@intel.com>; Xing, Beilei > > <beilei.x...@intel.com> > > Cc: dev@dpdk.org; Zhang, Qi Z <qi.z.zh...@intel.com>; sta...@dpdk.org > > Subject: [dpdk-dev] [PATCH] net/i40e: fix unexpected mbuf free in vPMD > > > > The patch reset tx queue sw_ring's mbuf to NULL after it is free in > > i40_tx_free_bufs, this prevent same mbuf be free again in > > i40e_dev_tx_queue_release. This fix follow the same implemenation of > > non-vPMD. > > Wonder why we can't change i40e_dev_tx_queue_release() instead, > so it will only go through the TXDs that were really armed? > Let say from txq->tx_next_dd - tx_rs_thresh - 1 till txq->tx_tail? > Let say _ixgbe_tx_queue_release_mbufs_vec() works that way. > Then we probably can keep our runtime code intact. > Konstantin > +1 to this. We should avoid adding writes to the TX path. Instead we should ensure that other routines properly track the buffers to be freed using the appropriate indexes.
/Bruce