> From: Bruce Richardson [mailto:bruce.richard...@intel.com]
> Sent: Wednesday, 25 June 2025 12.48
> 
> On Tue, Jun 24, 2025 at 06:12:38AM +0000, Morten Brørup wrote:
> > When fast releasing mbufs, the mbufs are not accessed, so do not
> prefetch
> > them.
> > This saves a mbuf load operation for each fast released TX mbuf.
> >
> > When fast release of mbufs is enabled for a TX queue, cache the mbuf
> > mempool pointer in the TX queue structure.
> > This saves one mbuf load operation for each burst of fast released TX
> > mbufs.
> >
> > The txep->mbuf pointer is not used after the mbuf has been freed, so
> do
> > not reset the pointer.
> > This saves a txep store operation for each TX mbuf freed.
> >
> > Signed-off-by: Morten Brørup <m...@smartsharesystems.com>
> > ---
> >  drivers/net/intel/common/tx.h                 |  5 +++
> >  .../i40e/i40e_recycle_mbufs_vec_common.c      |  4 +-
> >  drivers/net/intel/i40e/i40e_rxtx.c            | 39 ++++++++++--------
> -
> >  3 files changed, 28 insertions(+), 20 deletions(-)
> >
> Thanks, Morten. This optimization probably applies other places in our
> drivers too. I'll look at this patch - and where else it can apply - for
> 25.11, since we are nearing the end of the 25.07 release cycle.

Agreed. Also about waiting until 25.11.

Note when reviewing...

I also considered replacing:
        if (txq->offloads & RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE)
with:
        if (txq->fast_free_mp != NULL)

However, I assume txq->offloads is hot in the cache, while txq->fast_free_mp is 
only relevant if using fast free, and thus not as hot.
So I chose not to.

Reply via email to