On Thu, 20 Aug 2026 15:50:08 +0000
Kai Ji <[email protected]> wrote:

> The AVX-512 TX completion path directly manipulated the mempool cache
> internals (cache->objs, cache->len, cache->flushthresh) instead of using
> the mempool API.  This pattern is the same private bypass that existed in
> the Intel common TX library before it was removed by commit 062d6fe5d0e4
> ("net/intel: do not bypass mbuf lib for buffer fast-free") for the same
> reason: it omits mbuf instrumentation (history marking) and contains
> dead flush code that accesses cache->objs[cache->size], which is one
> past the end of the array when cache_size == RTE_MEMPOOL_CACHE_MAX_SIZE.
> 
> Replace with a single rte_mbuf_raw_free_bulk() call, matching the Intel
> common library.  The MBUF_FAST_FREE offload guarantee (single pool,
> refcnt == 1) makes this correct and the compiler inlines the bulk-free
> call to eliminate the overhead difference.
> 
> Signed-off-by: Kai Ji <[email protected]>
> ---

Should add correct Fixes: tag. Spotted in AI..

Reviewed against dpdk main (d55ccd4).  Applies cleanly.  No build
testing done.

The code change is correct.  RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE is
documented in rte_ethdev.h as a per-queue guarantee ("per-queue all
mbufs come from the same mempool, have refcnt=1, and are direct"),
and that comment explicitly cross-references
rte_mbuf_raw_free_bulk().  The static_assert, the (void *) cast, and
the retained (rs_thresh & 31) == 0 condition all match
drivers/net/intel/common/tx.h after 062d6fe5d00d, and struct
sxe2_tx_buffer_vec is a single mbuf pointer, so the assert holds.  No
stale 'normal' label and no unused variables are left behind.

Warning:

1. Missing Fixes: tag and stable Cc.  Please add:

     Fixes: 0af0bdcdcf83 ("net/sxe2: add AVX512 Rx and Tx")
     Cc: [email protected]

   That commit is in v26.07, so this is a backport candidate.

2. Wrong commit reference in the body.  The message cites

     commit 062d6fe5d0e4 ("net/intel: do not bypass mbuf lib for
     buffer fast-free")

   That abbreviation does not resolve.  The commit is
   062d6fe5d00d837ecb1a2b77b4a306e3619a7fde, so the 12-character form
   is 062d6fe5d00d, not 062d6fe5d0e4.  check-git-log.sh only validates
   hashes in Fixes: tags, so a bad inline reference is not caught.

Info:

1. Consider carrying over the performance note from 062d6fe5d00d
   explaining why (rs_thresh & 31) == 0 was kept: with the default
   rs_thresh of 32 the condition holds, and the optimizer uses the
   known-zero low bits when the bulk free is inlined into a copy.
   The current message only says the compiler inlines the call.

Reply via email to