From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4DDA741E0A; Tue, 7 Mar 2023 21:26:13 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2FD2240ED6; Tue, 7 Mar 2023 21:26:13 +0100 (CET) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id 116A34067B for ; Tue, 7 Mar 2023 21:26:12 +0100 (CET) X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: [PATCH] net/i40e: avx512 fast-free path bug fix Date: Tue, 7 Mar 2023 21:26:06 +0100 Message-ID: <98CBD80474FA8B44BF855DF32C47DC35D877CA@smartserver.smartshare.dk> In-Reply-To: <20230307193221.5365-1-kamalakshitha.aligeri@arm.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH] net/i40e: avx512 fast-free path bug fix Thread-Index: AdlRK5oSd3kFFrzsSF2Y69nvqIqWKQABataQ References: <20230307193221.5365-1-kamalakshitha.aligeri@arm.com> From: =?iso-8859-1?Q?Morten_Br=F8rup?= To: "Kamalakshitha Aligeri" , , , , , Cc: , X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org > From: Kamalakshitha Aligeri [mailto:kamalakshitha.aligeri@arm.com] > Sent: Tuesday, 7 March 2023 20.32 >=20 > In i40e_tx_free_bufs_avx512 fast-free path, when cache is NULL, > non fast-free path is being executed. Fixed the bug by calling > rte_mempool_generic_put API that handles the cache=3D=3DNULL case. >=20 > Fixes: 5171b4ee6b6b ("net/i40e: optimize Tx by using AVX512") > Cc: leyi.rong@intel.com > Cc: stable@dpdk.org >=20 > Signed-off-by: Kamalakshitha Aligeri > Reviewed-by: Ruifeng Wang > Reviewed-by: Feifei Wang > --- > .mailmap | 1 + > drivers/net/i40e/i40e_rxtx_vec_avx512.c | 12 ++++-------- > 2 files changed, 5 insertions(+), 8 deletions(-) >=20 > diff --git a/.mailmap b/.mailmap > index a9f4f28fba..2581d0efe7 100644 > --- a/.mailmap > +++ b/.mailmap > @@ -677,6 +677,7 @@ Kai Ji > Kaiwen Deng > Kalesh AP > Kamalakannan R > +Kamalakshitha Aligeri > Kamil Bednarczyk > Kamil Chalupnik > Kamil Rytarowski > diff --git a/drivers/net/i40e/i40e_rxtx_vec_avx512.c > b/drivers/net/i40e/i40e_rxtx_vec_avx512.c > index d3c7bfd121..ad0893324d 100644 > --- a/drivers/net/i40e/i40e_rxtx_vec_avx512.c > +++ b/drivers/net/i40e/i40e_rxtx_vec_avx512.c > @@ -783,16 +783,13 @@ i40e_tx_free_bufs_avx512(struct i40e_tx_queue > *txq) > struct rte_mempool_cache *cache =3D > rte_mempool_default_cache(mp, > rte_lcore_id()); >=20 > - if (!cache || cache->len =3D=3D 0) > - goto normal; > - > - cache_objs =3D &cache->objs[cache->len]; > - > - if (n > RTE_MEMPOOL_CACHE_MAX_SIZE) { > - rte_mempool_ops_enqueue_bulk(mp, (void *)txep, n); > + if (!cache || n > RTE_MEMPOOL_CACHE_MAX_SIZE) { > + rte_mempool_generic_put(mp, (void *)txep, n, cache); > goto done; > } >=20 > + cache_objs =3D &cache->objs[cache->len]; > + > /* The cache follows the following algorithm > * 1. Add the objects to the cache > * 2. Anything greater than the cache min value (if it > @@ -824,7 +821,6 @@ i40e_tx_free_bufs_avx512(struct i40e_tx_queue = *txq) > goto done; > } >=20 > -normal: > m =3D rte_pktmbuf_prefree_seg(txep[0].mbuf); > if (likely(m)) { > free[0] =3D m; > -- > 2.25.1 >=20 An improvement of the copy-paste code we are aiming to replace by proper = use of the mempool API. But still an improvement. Acked-by: Morten Br=F8rup