Skip to content

Commit

Permalink
net/i40e: fix AVX512 fast-free path
Browse files Browse the repository at this point in the history
[ 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: 5171b4e ("net/i40e: optimize Tx by using AVX512")

Signed-off-by: Kamalakshitha Aligeri <kamalakshitha.aligeri@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Feifei Wang <feifei.wang2@arm.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
  • Loading branch information
Kamalakshitha Aligeri authored and kevintraynor committed Mar 21, 2023
1 parent 998d704 commit ac111b8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
1 change: 1 addition & 0 deletions .mailmap
Expand Up @@ -679,6 +679,7 @@ Kai Ji <kai.ji@intel.com>
Kaiwen Deng <kaiwenx.deng@intel.com>
Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Kamalakannan R <kamalakannan.r@intel.com>
Kamalakshitha Aligeri <kamalakshitha.aligeri@arm.com>
Kamil Bednarczyk <kamil.bednarczyk@intel.com>
Kamil Chalupnik <kamilx.chalupnik@intel.com>
Kamil Rytarowski <kamil.rytarowski@caviumnetworks.com>
Expand Down
12 changes: 4 additions & 8 deletions drivers/net/i40e/i40e_rxtx_vec_avx512.c
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit ac111b8

Please sign in to comment.