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

Stephen Hemminger stephen at networkplumber.org
Tue Sep 16 23:17:31 CEST 2025


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.


More information about the dev mailing list