From ac111b80fe45d3c13c82068e12bba2645b04e6ed Mon Sep 17 00:00:00 2001 From: Kamalakshitha Aligeri Date: Tue, 7 Mar 2023 19:32:21 +0000 Subject: [PATCH] net/i40e: fix AVX512 fast-free path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [ upstream commit 1ad4bea0d73a7671095c2c675f9bb8b19503ac06 ] 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==NULL case. Fixes: 5171b4ee6b6b ("net/i40e: optimize Tx by using AVX512") Signed-off-by: Kamalakshitha Aligeri Reviewed-by: Ruifeng Wang Reviewed-by: Feifei Wang Acked-by: Morten Brørup --- .mailmap | 1 + drivers/net/i40e/i40e_rxtx_vec_avx512.c | 12 ++++-------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.mailmap b/.mailmap index 6a56239c3a..f4568f4984 100644 --- a/.mailmap +++ b/.mailmap @@ -679,6 +679,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 2e8a3f0df6..2ad9a920a1 100644 --- a/drivers/net/i40e/i40e_rxtx_vec_avx512.c +++ b/drivers/net/i40e/i40e_rxtx_vec_avx512.c @@ -906,16 +906,13 @@ i40e_tx_free_bufs_avx512(struct i40e_tx_queue *txq) struct rte_mempool_cache *cache = rte_mempool_default_cache(mp, rte_lcore_id()); - if (!cache || cache->len == 0) - goto normal; - - cache_objs = &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; } + cache_objs = &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 @@ -947,7 +944,6 @@ i40e_tx_free_bufs_avx512(struct i40e_tx_queue *txq) goto done; } -normal: m = rte_pktmbuf_prefree_seg(txep[0].mbuf); if (likely(m)) { free[0] = m;