DPDK patches and discussions
 help / color / mirror / Atom feed
* mbuf pool pointer optimization is obsolete
@ 2022-09-25  8:10 Morten Brørup
  0 siblings, 0 replies; only message in thread
From: Morten Brørup @ 2022-09-25  8:10 UTC (permalink / raw)
  To: Olivier Matz, Thomas Monjalon, dev; +Cc: Ferruh Yigit, Andrew Rybchenko

Dear Olivier, Thomas and DPDK PMD developers:

In November 2020, the pool pointer in the mbuf structure was moved to the first cache line [1].

[1]: http://git.dpdk.org/dpdk/commit/lib/librte_mbuf/rte_mbuf_core.h?id=4630290af46ed44a58515067b6d2add9c044252a

That patch also made rte_mbuf_to_baddr() obsolete, but we didn't notice back then. I think this function should be deprecated and marked for removal. And its note about the pool pointer being in the 2nd cache line should be removed.


Furthermore, some PMDs still seem to use an alternative pool pointer (e.g. in the port queue structure) instead of the pool pointer in the mbuf; possibly inspired by the optimization advice given in the documentation for rte_mbuf_to_baddr(): "@note: Accessing mempool pointer of a mbuf is expensive because the pointer is stored in the 2nd cache line of mbuf. If mempool is known, it is better not to reference the mempool pointer in mbuf but calling rte_mbuf_buf_addr() would be more efficient."

Since this precondition (i.e. the pool pointer being located in the mbuf's 2nd cache line) is no longer true, PMD developers should consider if their design (using an mempool pointer from elsewhere) is still optimal, or if using the pool pointer in the mbuf structure would be better.


Med venlig hilsen / Kind regards,
-Morten Brørup


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-09-25  8:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-25  8:10 mbuf pool pointer optimization is obsolete Morten Brørup

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).