DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Morten Brørup" <mb@smartsharesystems.com>
To: "Konstantin Ananyev" <konstantin.v.ananyev@yandex.ru>,
	"Randy L Tice" <rtice@cisco.com>, <dev@dpdk.org>
Cc: "Bruce Richardson" <bruce.richardson@intel.com>,
	"Harman Kalra" <hkalra@marvell.com>,
	"Stephen Hemminger" <stephen@networkplumber.org>
Subject: RE: [PATCH v3 1/1] mbuf: add optional no-copy dynamic field storage
Date: Tue, 29 Sep 2026 15:34:24 +0200	[thread overview]
Message-ID: <98CBD80474FA8B44BF855DF32C47DC35F65A88@smartserver.smartshare.dk> (raw)
In-Reply-To: <4b426d5e-d141-486a-b9e1-acd85c260507@yandex.ru>

> From: Konstantin Ananyev [mailto:konstantin.v.ananyev@yandex.ru]
> Sent: Tuesday, 29 September 2026 15.13
> 
> 29.09.2026 13:44, Morten Brørup пишет:
> >> From: Konstantin Ananyev [mailto:konstantin.v.ananyev@yandex.ru]
> >> Sent: Tuesday, 29 September 2026 14.00
> >>
> >> 28.09.2026 19:16, Randy L Tice пишет:
> >>> From: Randy L Tice <rtice@cisco.com>
> >>> Date: Thu, 03 Sep 2026 09:13:28 -0400
> >>>
> >>> Add build-time support for optional cache-line-aligned dynamic-
> field
> >>> storage at the end of struct rte_mbuf.
> >>>
> >>> The mbuf_dynfield3_size Meson option sets RTE_MBUF_DYNFIELD3_SIZE
> in
> >>> rte_build_config.h. A non-zero value enables the extra area and
> grows
> >>> every mbuf by the configured amount.
> >> I am strongly opposed to that patch.
> >> Inside mbuf we already do have priv_size that allows user to store
> >> his/her specific
> >> data straight after rte_mbuf in adjacent manner.
> >> It worked well so far for many use-cases (including VPP) and I don't
> >> see any
> >> reason why this is not enough.
> >>   From other side - making size of core rte_mbuf configurable at
> run-
> >> time,
> >> will affect DPDK ABI stability in a negative way.
> >> Fro my perspective it is much plausible in terms of ABI stability
> and
> >> predictability
> >> to have just one fixed layout for the mbuf.
> >> Konstantin
> > The private data area (priv_size) is independent per mbuf pool, and
> selected at run-time when creating each pool. As Randy explained in the
> RFC, this is unavailable for mbuf pools created by other components.
> 
> I think it should be trivial to enforce minimal priv_size across all
> mbuf pools what will be obeyed by different components
> (as long as they do use rte_pktmbuf_pool_create() and friends):
> 1) introduce new EAL parameter 'mbuf-min-priv-size' or so (keep default
> as zero)
> 2) make rte_pktmbuf_pool_create_by_ops() and
> rte_pktmbuf_pool_create_extbuf() to check that input paramter
> 'priv_size' GE then value specified by EAL parameter, if so then return
> an error.

The private data area cannot be used.
Let's say one module creates an mbuf pool with priv_size of 8, and uses those 8 bytes,
and some second module creates an mbuf pool with priv_size of 16, and uses those 16 bytes.

How should a module (or the application) know at which offset to store its private data without overwriting the private data of other modules?

The mbuf dynamic field's registry manages centrally where each module should store its own data, and the data is even accessible by other modules (because they can fetch the offset to the data from the registry).

> 
> >
> > Mbuf dynamic fields are shared across all mbuf pools, and serves the
> need with an existing API. So I am strongly in favor of using the mbuf
> dynamic fields API for this.
> >
> > I agree with Konstantin that it would be optimal if the size of the
> added dynfields area was run-time configurable (as an EAL startup
> parameter).
> > However, such a modification to the mbuf library would also require
> that the performance cost in the dataplane is negligible. We don't want
> to compromise on mbuf performance for applications not using this new
> feature.
> >
> > Randy,
> > Could you please explore such an approach?
> >
> > -Morten


  reply	other threads:[~2026-09-29 13:34 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-24 19:37 [PATCH 0/1] mbuf: add optional dynfield3 storage Randy L Tice
2026-09-24 19:37 ` [PATCH 1/1] " Randy L Tice
2026-09-25  9:48   ` Morten Brørup
2026-09-25 19:31 ` [PATCH v2 0/1] " Randy L Tice
2026-09-25 19:31   ` [PATCH v2 1/1] " Randy L Tice
2026-09-26 16:51     ` Stephen Hemminger
2026-09-28 14:45       ` Randy Tice (rtice)
2026-09-28 18:16   ` [PATCH v3 0/1] mbuf: add optional no-copy dynamic field storage Randy L Tice
2026-09-28 18:16     ` [PATCH v3 1/1] " Randy L Tice
2026-09-29  7:15       ` Morten Brørup
2026-09-29 11:59       ` Konstantin Ananyev
2026-09-29 12:44         ` Morten Brørup
2026-09-29 13:12           ` Konstantin Ananyev
2026-09-29 13:34             ` Morten Brørup [this message]
2026-09-29 14:14               ` Konstantin Ananyev
2026-09-29 14:44                 ` Randy Tice (rtice)
2026-09-29 15:20                   ` Morten Brørup
2026-09-29 19:03                     ` Randy Tice (rtice)
2026-09-29 19:28                       ` Konstantin Ananyev
2026-09-29 19:26                   ` Konstantin Ananyev
2026-10-06 15:54     ` [PATCH v4 0/1] mbuf: add runtime metadata dynamic-field storage Randy L Tice
2026-10-06 15:54       ` [PATCH v4 1/1] " Randy L Tice
2026-10-06 16:51       ` [PATCH v4 0/1] " Stephen Hemminger
2026-10-08 16:15         ` Randy Tice (rtice)

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=98CBD80474FA8B44BF855DF32C47DC35F65A88@smartserver.smartshare.dk \
    --to=mb@smartsharesystems.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=hkalra@marvell.com \
    --cc=konstantin.v.ananyev@yandex.ru \
    --cc=rtice@cisco.com \
    --cc=stephen@networkplumber.org \
    /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