dev.dpdk.org archive mirror
 help / color / mirror / Atom feed
From: "Morten Brørup" <mb@smartsharesystems.com>
To: "Olivier Matz" <olivier.matz@6wind.com>,
	"Thomas Monjalon" <thomas@monjalon.net>, <dev@dpdk.org>
Cc: "Ferruh Yigit" <ferruh.yigit@xilinx.com>,
	"Andrew Rybchenko" <andrew.rybchenko@oktetlabs.ru>
Subject: mbuf pool pointer optimization is obsolete
Date: Sun, 25 Sep 2022 10:10:46 +0200	[thread overview]
Message-ID: <98CBD80474FA8B44BF855DF32C47DC35D87354@smartserver.smartshare.dk> (raw)

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


                 reply	other threads:[~2022-09-25  8:10 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=98CBD80474FA8B44BF855DF32C47DC35D87354@smartserver.smartshare.dk \
    --to=mb@smartsharesystems.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@xilinx.com \
    --cc=olivier.matz@6wind.com \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).