[PATCH v4] mbuf: optimize segment prefree

Morten Brørup mb at smartsharesystems.com
Thu Oct 23 09:04:51 CEST 2025


> > +#if !defined(RTE_TOOLCHAIN_GCC) || defined __DOXYGEN__
> >  /**
> >   * Returns TRUE if given mbuf is direct, or FALSE otherwise.
> >   *
> > @@ -714,6 +715,52 @@ struct rte_mbuf_ext_shared_info {
> >   */
> >  #define RTE_MBUF_DIRECT(mb) \
> >  	(!((mb)->ol_flags & (RTE_MBUF_F_INDIRECT | RTE_MBUF_F_EXTERNAL)))
> > +#else /* RTE_TOOLCHAIN_GCC */
> 
> Do we need the non-gcc block?

I have now tested with a bunch of compilers on Godbolt, and it seems only clang doesn't need this optimization, so I'll remove the compiler check and make the optimized variant the only one.



More information about the dev mailing list