From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 1E3581B211; Tue, 10 Oct 2017 03:10:38 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Oct 2017 18:10:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,502,1500966000"; d="scan'208";a="1204054033" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga001.fm.intel.com with ESMTP; 09 Oct 2017 18:10:37 -0700 Received: from FMSMSX109.amr.corp.intel.com (10.18.116.9) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 9 Oct 2017 18:10:37 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx109.amr.corp.intel.com (10.18.116.9) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 9 Oct 2017 18:10:37 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.213]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.98]) with mapi id 14.03.0319.002; Tue, 10 Oct 2017 09:10:35 +0800 From: "Zhang, Qi Z" To: "Ananyev, Konstantin" , "Wu, Jingjing" , "Xing, Beilei" CC: "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] net/i40e: fix unexpected mbuf free in vPMD Thread-Index: AQHTQJoAn46Ymcgfc0mFbr4XOqItWaLa8VyAgAFExxA= Date: Tue, 10 Oct 2017 01:10:36 +0000 Message-ID: <039ED4275CED7440929022BC67E7061153102932@SHSMSX103.ccr.corp.intel.com> References: <20171009085345.46357-1-qi.z.zhang@intel.com> <2601191342CEEE43887BDE71AB9772585FAA647D@IRSMSX103.ger.corp.intel.com> In-Reply-To: <2601191342CEEE43887BDE71AB9772585FAA647D@IRSMSX103.ger.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] net/i40e: fix unexpected mbuf free in vPMD X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 01:10:39 -0000 Hi Konstantin: > -----Original Message----- > From: Ananyev, Konstantin > Sent: Monday, October 9, 2017 8:44 PM > To: Zhang, Qi Z ; Wu, Jingjing ; > Xing, Beilei > Cc: dev@dpdk.org; Zhang, Qi Z ; stable@dpdk.org > Subject: RE: [dpdk-dev] [PATCH] net/i40e: fix unexpected mbuf free in vPM= D >=20 > Hi Zhang, >=20 > > -----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. >=20 > Wonder why we can't change i40e_dev_tx_queue_release() instead, so it wil= l > only go through the TXDs that were really armed? Yes we can, I've thought about this before the patch, but after I measure t= he performance impact, I saw less than 0.6% downgrade for single core perfo= rmance. So I think maybe a simple fix could be good enough and low risk and an impr= ovement can be delivered later after carefully validate. > 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. Yes, That's the same way I figured out, thanks for giving the detail instru= ction that confirm my thought :) Now, I think my v2 can upgrade to this directly. Thanks Qi > Then we probably can keep our runtime code intact. > Konstantin >=20 > > > > Fixes: b4669bb95038 ("i40e: add vector Tx") > > Cc: stable@dpdk.org > > > > Signed-off-by: Qi Zhang > > --- > > drivers/net/i40e/i40e_rxtx_vec_common.h | 3 +++ > > 1 file changed, 3 insertions(+) > > > > diff --git a/drivers/net/i40e/i40e_rxtx_vec_common.h > > b/drivers/net/i40e/i40e_rxtx_vec_common.h > > index 39a6da0..ed51b4d 100644 > > --- a/drivers/net/i40e/i40e_rxtx_vec_common.h > > +++ b/drivers/net/i40e/i40e_rxtx_vec_common.h > > @@ -124,11 +124,13 @@ i40e_tx_free_bufs(struct i40e_tx_queue *txq) > > */ > > txep =3D &txq->sw_ring[txq->tx_next_dd - (n - 1)]; > > m =3D rte_pktmbuf_prefree_seg(txep[0].mbuf); > > + txep[0].mbuf =3D NULL; > > if (likely(m !=3D NULL)) { > > free[0] =3D m; > > nb_free =3D 1; > > for (i =3D 1; i < n; i++) { > > m =3D rte_pktmbuf_prefree_seg(txep[i].mbuf); > > + txep[i].mbuf =3D NULL; > > if (likely(m !=3D NULL)) { > > if (likely(m->pool =3D=3D free[0]->pool)) { > > free[nb_free++] =3D m; > > @@ -145,6 +147,7 @@ i40e_tx_free_bufs(struct i40e_tx_queue *txq) > > } else { > > for (i =3D 1; i < n; i++) { > > m =3D rte_pktmbuf_prefree_seg(txep[i].mbuf); > > + txep[i].mbuf =3D NULL; > > if (m !=3D NULL) > > rte_mempool_put(m->pool, m); > > } > > -- > > 2.9.5