[PATCH v2 1/4] mbuf: record mbuf operations history

Morten Brørup mb at smartsharesystems.com
Wed Sep 17 03:22:47 CEST 2025


> From: Thomas Monjalon [mailto:thomas at monjalon.net]
> Sent: Tuesday, 16 September 2025 23.34
> 
> 16/09/2025 23:17, Stephen Hemminger:
> > On Tue, 16 Sep 2025 18:12:04 +0300
> > Shani Peretz <shperetz at nvidia.com> wrote:
> >
> > > @@ -607,6 +608,9 @@ static inline struct rte_mbuf
> *rte_mbuf_raw_alloc(struct rte_mempool *mp)
> > >  	if (rte_mempool_get(mp, &ret.ptr) < 0)
> > >  		return NULL;
> > >  	__rte_mbuf_raw_sanity_check(ret.m);
> > > +#if RTE_MBUF_HISTORY_DEBUG
> > > +	rte_mbuf_history_mark(ret.m, RTE_MBUF_ALLOC);
> > > +#endif
> > >  	return ret.m;
> > >  }
> >
> > If you made rte_mbuf_history_mark a dummy function if
> RTE_MBUF_HISTORY_DEBUG
> > was not defined, then you could remove most of the #ifdef clutter and
> > would get type checking on normal builds.
> 
> Yes good idea!

+1

> We need to check whether an empty inline function will be completely
> optimized out by the compilers (clang and GCC).
> 
It works for trace.



More information about the dev mailing list