From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id C71FEC3F8 for ; Mon, 3 Aug 2015 04:47:01 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP; 02 Aug 2015 19:47:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,598,1432623600"; d="scan'208";a="617986662" Received: from pgsmsx102.gar.corp.intel.com ([10.221.44.80]) by orsmga003.jf.intel.com with ESMTP; 02 Aug 2015 19:47:00 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by PGSMSX102.gar.corp.intel.com (10.221.44.80) with Microsoft SMTP Server (TLS) id 14.3.224.2; Mon, 3 Aug 2015 10:46:58 +0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.126]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.18]) with mapi id 14.03.0224.002; Mon, 3 Aug 2015 10:46:57 +0800 From: "Lu, Wenzhuo" To: hepeng , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] [new]ixgbe:set txep.mbuf to NULL when calling ixgbe_tx_free_bufs Thread-Index: AQHQy/k5DQIgsnPyMEyFFZHMcNMuoZ35kB1Q Date: Mon, 3 Aug 2015 02:46:56 +0000 Message-ID: <6A0DE07E22DDAD4C9103DF62FEBC0909D1A508@shsmsx102.ccr.corp.intel.com> References: <1438392394-19653-1-git-send-email-xnhp0320@icloud.com> In-Reply-To: <1438392394-19653-1-git-send-email-xnhp0320@icloud.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: 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] [new]ixgbe:set txep.mbuf to NULL when calling ixgbe_tx_free_bufs X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Aug 2015 02:47:02 -0000 Hi Peng, > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of hepeng > Sent: Saturday, August 1, 2015 9:27 AM > To: dev@dpdk.org > Subject: [dpdk-dev] [PATCH] [new]ixgbe:set txep.mbuf to NULL when calling > ixgbe_tx_free_bufs >=20 > In *ixgbe_tx_free_bufs*, after recycling some tx entries, one should set = their > mbuf pointers to NULL. >=20 > The first path is not correct, the txep->mbuf should be set to NULL no ma= tter if > it is recycled into mempool > Signed-off-by: hepeng > --- > drivers/net/ixgbe/ixgbe_rxtx_vec.c | 13 ++++++++++++- > 1 file changed, 12 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec.c > b/drivers/net/ixgbe/ixgbe_rxtx_vec.c > index 1c16dec..e7ce740 100644 > --- a/drivers/net/ixgbe/ixgbe_rxtx_vec.c > +++ b/drivers/net/ixgbe/ixgbe_rxtx_vec.c > @@ -612,6 +612,7 @@ ixgbe_tx_free_bufs(struct ixgbe_tx_queue *txq) > */ > txep =3D &txq->sw_ring_v[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; > @@ -632,11 +633,21 @@ ixgbe_tx_free_bufs(struct ixgbe_tx_queue *txq) > } else { > for (i =3D 1; i < n; i++) { > m =3D __rte_pktmbuf_prefree_seg(txep[i].mbuf); > - if (m !=3D NULL) > + if (m !=3D NULL) { > rte_mempool_put(m->pool, m); > + } > } > } >=20 > + /* > + * No matter the mbufs have been put back to mempool or not, > + * we should set the txep[i].mbuf to NULL > + */ > + > + for( i =3D 1; i < n; i++) { > + txep[i].mbuf =3D NULL; > + } > + > /* buffers were freed, update counters */ > txq->nb_tx_free =3D (uint16_t)(txq->nb_tx_free + txq->tx_rs_thresh); > txq->tx_next_dd =3D (uint16_t)(txq->tx_next_dd + txq->tx_rs_thresh); > -- > 1.9.1 NACK. Thanks for looking into this code. But it's designed behavior, not an issue= . BTW, if you want to send a new version, the tittle should be like this [PAT= CH v2] ixgbe: ..., and add "--in-reply-to your original mail" when sending = the mail, and add a v2 comments. You can reference the other's v2 patches f= or detail.