From: Thomas Monjalon <thomas@monjalon.net>
To: Ferruh Yigit <ferruh.yigit@intel.com>
Cc: dev@dpdk.org, Olivier Matz <olivier.matz@6wind.com>
Subject: Re: [dpdk-dev] advice to pmd maintainters: do not touch mbuf initialized fields
Date: Sat, 08 Jul 2017 22:36:08 +0200 [thread overview]
Message-ID: <6567149.GEPADMWmoG@xps> (raw)
In-Reply-To: <20170608110607.30887c26@platinum>
08/06/2017 11:06, Olivier Matz:
> Hi,
>
> In the structure reorganization patchset [1], some work was done
> to ensure that the values of the following fields are always initialized
> for mbuf that are inside the mbuf pool (not yet allocated).
>
> In other words, calling rte_mbuf_raw_alloc() or rte_mempool_get() return
> mbufs that are initialized as following:
>
> m->next = NULL
> m->nb_segs = 1
> m->refcnt = 1
>
> This property can be used in the Rx path of PMDs where the mbuf
> structure is filled from the hardware descriptors: the initialization of
> these fields can be skipped to gain few cycles per packet, and to avoid
> an access to the second cache line (m->next) before it is prefetched.
>
> It is advised to do this optimization in the PMDs for this reason, and
> also because we could want to move some of these fields to the second
> mbuf cache line in the future: accessing them in the Rx path would cost.
>
> This work has already been done at several places:
>
> http://dpdk.org/browse/dpdk/commit/?id=ebb7bcabb
> http://dpdk.org/browse/next/dpdk-next-net/commit/?id=e211a7569
> http://dpdk.org/browse/next/dpdk-next-net/commit/?id=a37cf9005
> http://dpdk.org/browse/next/dpdk-next-net/commit/?id=fb83a23ee
> ...
>
> Feel free to ask if you have any question.
Please Ferruh, could you check which drivers are not yet updated
regarding this optimization?
Thanks
prev parent reply other threads:[~2017-07-08 20:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-08 9:06 Olivier Matz
2017-07-08 20:36 ` Thomas Monjalon [this message]
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=6567149.GEPADMWmoG@xps \
--to=thomas@monjalon.net \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=olivier.matz@6wind.com \
/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).