On Mon, Mar 10, 2025 at 04:34:23PM +0100, Morten Brørup wrote:
> > From: Bruce Richardson [mailto:bruce.richard...@intel.com]
> > Sent: Monday, 10 March 2025 16.27
> > 
> > On Mon, Mar 10, 2025 at 04:18:35PM +0100, Morten Brørup wrote:
> > > > From: Bruce Richardson [mailto:bruce.richard...@intel.com]
> > > > Sent: Monday, 10 March 2025 14.26
> > > >
> > > > When freeing transmitted mbufs, there is no reason to send the
> > freed
> > > > mbufs directly to the ring if the cache is empty - only if it is
> > zero
> > > > size (in which case the cache pointer is NULL). Therefore, remove
> > the
> > > > empty check and only check for a null cache pointer.
> > > >
> > > > Signed-off-by: Bruce Richardson <bruce.richard...@intel.com>
> > > > ---
> > > >  drivers/net/intel/common/tx.h | 2 +-
> > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > >
> > > > diff --git a/drivers/net/intel/common/tx.h
> > > > b/drivers/net/intel/common/tx.h
> > > > index d9cf4474fc..d361fe64ab 100644
> > > > --- a/drivers/net/intel/common/tx.h
> > > > +++ b/drivers/net/intel/common/tx.h
> > > > @@ -143,7 +143,7 @@ ci_tx_free_bufs_vec(struct ci_tx_queue *txq,
> > > > ci_desc_done_fn desc_done, bool ctx
> > > >                 void **cache_objs;
> > > >                 struct rte_mempool_cache *cache =
> > > > rte_mempool_default_cache(mp, rte_lcore_id());
> > > >
> > > > -               if (!cache || cache->len == 0)
> > > > +               if (cache == NULL)
> > > >                         goto normal;
> > > >
> > > >                 cache_objs = &cache->objs[cache->len];
> > > > --
> > > > 2.43.0
> > >
> > > Yep, it did look strange.
> > > Reviewed-by: Morten Brørup <m...@smartsharesystems.com>
> > >
> > Thanks for review.
> 
> BTW, I recall other Intel drivers having the same "feature":
> https://elixir.bootlin.com/dpdk/v24.11.1/source/drivers/net/iavf/iavf_rxtx_vec_avx512.c#L1876
> https://elixir.bootlin.com/dpdk/v24.11.1/source/drivers/net/ice/ice_rxtx_vec_avx512.c#L891
> 

With the deduplication work I did earlier this release, this code should
now be shared between ixgbe, i40e, iavf and ice drivers, so we hopefully
can fix all 4 with one change.

Reply via email to