Ethdev driver maintainers (CC: Ethdev API maintainers),

Your ethdev drivers support RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE, and probably 
call rte_mempool_put_bulk() in the mempool lib when FAST_FREE'ing mbufs, 
thereby bypassing the mbuf lib.
The appropriate mbuf lib function is rte_mbuf_raw_free_bulk(), which is a 
relatively new [1] inline function.
It's a simple wrapper calling rte_mempool_put_bulk(), with the addition of 
performing mbuf sanity checks when the appropriate defines are enabled.

In this context, "the appropriate defines" should be RTE_LIBRTE_MBUF_DEBUG (and 
not also RTE_ENABLE_ASSERT), so I have provided a patch [2] to fix this.

Similarly, the relatively new [1] inline function rte_mbuf_raw_alloc_bulk() in 
the mbuf lib is a wrapper for rte_mempool_get_bulk() in the mempool lib, with 
added sanity checks (when the appropriate defines are enabled).

Request 1: Please consider changing your driver to call 
rte_mbuf_raw_free_bulk() instead of rte_mempool_put_bulk() when FAST_FREE'ing 
mbufs.

Request 2: Please consider changing your driver to call 
rte_mbuf_raw_alloc_bulk() instead of rte_mempool_get_bulk() when allocating 
mbufs.

Request 3: Please review the patch [2].

General question: Are ethdev drivers being tested with RTE_LIBRTE_MBUF_DEBUG 
enabled, or should they be?

[1]: 
https://git.dpdk.org/dpdk/commit/lib/mbuf/rte_mbuf.h?id=55624173bacb2becaa67793b71391884876673c1
[2]: 
https://inbox.dpdk.org/dev/20250722093431.555214-1...@smartsharesystems.com/

-Morten

Reply via email to