DPDK patches and discussions
 help / color / mirror / Atom feed
* Ethdev driver request for changes
@ 2025-07-30  7:59 Morten Brørup
  2025-08-22 17:08 ` Bruce Richardson
  0 siblings, 1 reply; 2+ messages in thread
From: Morten Brørup @ 2025-07-30  7:59 UTC (permalink / raw)
  To: Ajit Khaparde, Somnath Kotur, Chas Williams, Min Hu (Connor,
	Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao,
	Harman Kalra, Hemant Agrawal, Sachin Saxena, Shai Brandes,
	Evgeny Schemeilin, Ron Beider, Amit Bernstein, Wajeeh Atrash,
	Gaetan Rivet, Dengdui Huang, Bruce Richardson, Praveen Shetty,
	Vladimir Medvedkin, Anatoly Burakov, Jingjing Wu, Rosen Xu,
	Andrew Boyer, Dariusz Sosnowski, Viacheslav Ovsiienko, Bing Zhao,
	Ori Kam, Suanming Mou, Matan Azrad, Harman Kalra, Wenbo Cao,
	Andrew Rybchenko, Jerin Jacob, Maciej Czekaj
  Cc: Thomas Monjalon, Andrew Rybchenko, dev

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-mb@smartsharesystems.com/

-Morten


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Ethdev driver request for changes
  2025-07-30  7:59 Ethdev driver request for changes Morten Brørup
@ 2025-08-22 17:08 ` Bruce Richardson
  0 siblings, 0 replies; 2+ messages in thread
From: Bruce Richardson @ 2025-08-22 17:08 UTC (permalink / raw)
  To: Morten Brørup
  Cc: Ajit Khaparde, Somnath Kotur, Chas Williams, Min Hu (Connor,
	Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao,
	Harman Kalra, Hemant Agrawal, Sachin Saxena, Shai Brandes,
	Evgeny Schemeilin, Ron Beider, Amit Bernstein, Wajeeh Atrash,
	Gaetan Rivet, Dengdui Huang, Praveen Shetty, Vladimir Medvedkin,
	Anatoly Burakov, Jingjing Wu, Rosen Xu, Andrew Boyer,
	Dariusz Sosnowski, Viacheslav Ovsiienko, Bing Zhao, Ori Kam,
	Suanming Mou, Matan Azrad, Wenbo Cao, Andrew Rybchenko,
	Jerin Jacob, Maciej Czekaj, Thomas Monjalon, dev

On Wed, Jul 30, 2025 at 09:59:52AM +0200, Morten Brørup wrote:
> 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.
> 
For Intel drivers: https://patches.dpdk.org/project/dpdk/list/?series=35995

/Bruce

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-08-22 17:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-30  7:59 Ethdev driver request for changes Morten Brørup
2025-08-22 17:08 ` Bruce Richardson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).