From: Bruce Richardson Subject: Re: [PATCH] net/i40e: fix unexpected mbuf free in vPMD Date: Mon, 9 Oct 2017 14:20:58 +0100 Message-ID: <20171009132057.GA31632@bricha3-MOBL3.ger.corp.intel.com> References: <20171009085345.46357-1-qi.z.zhang@intel.com> <2601191342CEEE43887BDE71AB9772585FAA647D@IRSMSX103.ger.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "Zhang, Qi Z" , "Wu, Jingjing" , "Xing, Beilei" , "dev@dpdk.org" , "stable@dpdk.org" To: "Ananyev, Konstantin" Return-path: Content-Disposition: inline In-Reply-To: <2601191342CEEE43887BDE71AB9772585FAA647D@IRSMSX103.ger.corp.intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Mon, Oct 09, 2017 at 12:44:25PM +0000, Ananyev, Konstantin wrote: > Hi Zhang, > > > -----Original Message----- > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Qi Zhang > > Sent: Monday, October 9, 2017 9:54 AM > > To: Wu, Jingjing ; Xing, Beilei > > Cc: dev@dpdk.org; Zhang, Qi Z ; stable@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