From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id B62521B1B2; Mon, 9 Oct 2017 14:44:29 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Oct 2017 05:44:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,500,1500966000"; d="scan'208";a="144390090" Received: from irsmsx101.ger.corp.intel.com ([163.33.3.153]) by orsmga002.jf.intel.com with ESMTP; 09 Oct 2017 05:44:27 -0700 Received: from irsmsx103.ger.corp.intel.com ([169.254.3.49]) by IRSMSX101.ger.corp.intel.com ([169.254.1.22]) with mapi id 14.03.0319.002; Mon, 9 Oct 2017 13:44:26 +0100 From: "Ananyev, Konstantin" To: "Zhang, Qi Z" , "Wu, Jingjing" , "Xing, Beilei" CC: "dev@dpdk.org" , "Zhang, Qi Z" , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] net/i40e: fix unexpected mbuf free in vPMD Thread-Index: AQHTQJoGO1bJE4hCAUeoqWsP1NJttqLbdKdQ Date: Mon, 9 Oct 2017 12:44:25 +0000 Message-ID: <2601191342CEEE43887BDE71AB9772585FAA647D@IRSMSX103.ger.corp.intel.com> References: <20171009085345.46357-1-qi.z.zhang@intel.com> In-Reply-To: <20171009085345.46357-1-qi.z.zhang@intel.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZWNiNmU1YzUtY2EwZC00NzI0LThlNzUtYTNlYjJkMTBjNDdmIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6ImthZHowRjFUOGhEUDhuTEdUS3JTZ3piZFMyMUQrMEJEMEFyR29PcVBtbE09In0= x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [163.33.239.182] 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: Mon, 09 Oct 2017 12:44:30 -0000 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 >=20 > 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,=20 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 >=20 > Fixes: b4669bb95038 ("i40e: add vector Tx") > Cc: stable@dpdk.org >=20 > Signed-off-by: Qi Zhang > --- > drivers/net/i40e/i40e_rxtx_vec_common.h | 3 +++ > 1 file changed, 3 insertions(+) >=20 > diff --git a/drivers/net/i40e/i40e_rxtx_vec_common.h b/drivers/net/i40e/i= 40e_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