<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div style="font-family: Aptos, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" dir="ltr">
Konstantin,</div>
<div style="font-family: Aptos, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" dir="ltr">
Does this path work for you?</div>
<div style="font-family: Aptos, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" dir="ltr">
-rt</div>
<div style="font-family: Aptos, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" dir="ltr">
<br>
</div>
<div id="mail-editor-reference-message-container">
<div style="padding: 3pt 0in 0in; border-width: 1pt medium medium; border-style: solid none none; border-color: rgb(181, 196, 223) currentcolor currentcolor;">
<div style="text-align: left; font-family: Aptos; font-size: 12pt; color: black;">
<b>From: </b>Morten Brørup <mb@smartsharesystems.com><br>
<b>Date: </b>Tuesday, September 29, 2026 at 11:20 AM<br>
<b>To: </b>Randy Tice (rtice) <rtice@cisco.com>; Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>; dev@dpdk.org <dev@dpdk.org><br>
<b>Cc: </b>Bruce Richardson <bruce.richardson@intel.com>; Harman Kalra <hkalra@marvell.com>; Stephen Hemminger <stephen@networkplumber.org><br>
<b>Subject: </b>RE: [PATCH v3 1/1] mbuf: add optional no-copy dynamic field storage<br>
<br>
</div>
</div>
<div id="mail-editor-reference-message-body">
<div class="ms-outlook-mobile-reference-message skipProofing" dir="ltr">
<meta name="Generator" content="Microsoft Word 12 (filtered medium)">
</div>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Calibri, "sans-serif"; font-size: 11pt; color: rgb(31, 73, 125);"><a name="_MailEndCompose" style="margin-top: 0px; margin-bottom: 0px;" data-outlook-id="ddb0e0d2-c671-4c92-8c3c-cbc0108ec9d4">Randy,</a></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Calibri, "sans-serif"; font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Calibri, "sans-serif"; font-size: 11pt; color: rgb(31, 73, 125);">This is very close to what I suggested you explore.</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Calibri, "sans-serif"; font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Calibri, "sans-serif"; font-size: 11pt; color: rgb(31, 73, 125);">But one piece is missing:</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Calibri, "sans-serif"; font-size: 11pt; color: rgb(31, 73, 125);">Registering fields in this metadata area should be managed through the dynamic mbuf fields API.</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Calibri, "sans-serif"; font-size: 11pt; color: rgb(31, 73, 125);">Without a central registry, only one module can use the new metadata area; it cannot be used by multiple modules without coordination.</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Calibri, "sans-serif"; font-size: 11pt; color: rgb(31, 73, 125);">And instead of rolling your own registry of fields in the metadata area, just reuse the dynamic mbuf fields machinery.</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Calibri, "sans-serif"; font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Calibri, "sans-serif"; font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Calibri, "sans-serif"; font-size: 11pt; color: rgb(31, 73, 125);">I agree with your proposed mbuf layout.</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Calibri, "sans-serif"; font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Calibri, "sans-serif"; font-size: 11pt; color: rgb(31, 73, 125);">There will be a performance cost for accessing the mbuf private data: rte_mbuf_to_priv() will change from adding a simple constant offset (sizeof(struct rte_mbuf)) to
adding the value of a global variable holding the offset, reflecting the startup-time configured metadata area size.</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Calibri, "sans-serif"; font-size: 11pt; color: rgb(31, 73, 125);">The global variable will be hot in the cache when working on mbuf bursts, so I think this performance cost will be insignificant.</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Calibri, "sans-serif"; font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Calibri, "sans-serif"; font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Calibri, "sans-serif"; font-size: 11pt; color: rgb(31, 73, 125);">Venlig hilsen / Kind regards,</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Calibri, "sans-serif"; font-size: 11pt; color: rgb(31, 73, 125);">-Morten Brørup</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Calibri, "sans-serif"; font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<div style="padding: 0cm 0cm 0cm 4pt; border-width: medium medium medium 1.5pt; border-style: none none none solid; border-color: currentcolor currentcolor currentcolor blue;">
<div style="padding: 3pt 0cm 0cm; border-width: 1pt medium medium; border-style: solid none none; border-color: rgb(181, 196, 223) currentcolor currentcolor;">
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Tahoma, "sans-serif"; font-size: 10pt;"><b>From:</b> Randy Tice (rtice) [mailto:rtice@cisco.com]<br>
<b>Sent:</b> Tuesday, 29 September 2026 16.45<br>
<b>To:</b> Konstantin Ananyev; Morten Brørup; dev@dpdk.org<br>
<b>Cc:</b> Bruce Richardson; Harman Kalra; Stephen Hemminger<br>
<b>Subject:</b> Re: [PATCH v3 1/1] mbuf: add optional no-copy dynamic field storage</span></p>
</div>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
</p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> Hi all,</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> </span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> Thanks for the discussion. We are now where I had hoped we’d get to during</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> RFC but we are here.</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> </span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> Konstantin, I understand your concern about making sizeof(struct rte_mbuf)</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> depend on a build-time option. That can create different mbuf layouts between</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> DPDK builds that otherwise present the same ABI/version, which is not a good</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> property for a core public structure.</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> </span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> After thinking through this again, I think the current patch may be trying too</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> hard to make this a dynamic-field allocator feature. The actual requirement is</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> simpler: a fixed global per-mbuf metadata area that is present in every</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> pktmbuf object, separate from ordinary application private data, and not</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> copied by mbuf copy/clone helpers.</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> </span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> The mbuf structure change would look roughly like this:</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> </span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> struct rte_mbuf {</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> ...</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> uint32_t dynfield1[9]; /**< Reserved for dynamic fields. */</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> +</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> + alignas(RTE_CACHE_LINE_SIZE)</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> + uint8_t metadata[];</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> + /**< Optional cache-line-aligned per-mbuf metadata area. */</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> };</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> </span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> Since this is a flexible array member, it does not change sizeof(struct</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> rte_mbuf). The object layout would become:</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> </span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> struct rte_mbuf fixed header</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> global per-mbuf metadata area</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> application private data</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> packet data buffer</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> </span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> With that layout, this could be sized at EAL init time rather than by a build</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> option, for example:</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> </span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> --mbuf-metadata-size=256</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> </span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> That avoids creating different DPDK builds with different mbuf struct sizes or</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> different build-time ABI expectations. The configured size would be part of</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> the process/runtime configuration instead of requiring applications,</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> libraries, and package providers to agree on a compile-time define.</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> </span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> The official mbuf helpers would account for this area before ordinary</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> priv_size, so application private data remains available and does not overlap</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> with the global metadata area.</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> </span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> This would also avoid changing the existing dynamic-field allocator and copy</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> semantics. The area would not be part of the dynamic-field registry; it would</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> be explicit per-mbuf metadata storage for applications that deliberately</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> enable it.</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> </span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> That seems to address the main concerns:</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> </span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> - sizeof(struct rte_mbuf) remains fixed for ABI purposes.</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> - the metadata area is globally present across pktmbuf pools when enabled.</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> - ordinary priv_size remains separate and available.</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> - dynamic-field allocator/copy behavior remains unchanged.</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> - users that do not enable the EAL option pay no extra per-mbuf storage cost.</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> - applications do not need to be built against a different mbuf-size define.</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> </span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> If this direction is acceptable, I can take a look at what it means in</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> practice for EAL configuration, mbuf layout helpers, pool constructors, and</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> places that currently do direct object-layout math.</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> </span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> Thanks,</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> -rt</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"> </span></p>
<div id="mail-editor-reference-message-container">
<div style="padding: 3pt 0cm 0cm; border-width: 1pt medium medium; border-style: solid none none; border-color: currentcolor;">
<p class="MsoNormal" style="margin: 0cm 0cm 12pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-family: Aptos; color: black;"><b>From: </b>Konstantin Ananyev <konstantin.v.ananyev@yandex.ru><br>
<b>Date: </b>Tuesday, September 29, 2026 at 10:14 AM<br>
<b>To: </b>Morten Brørup <mb@smartsharesystems.com>; Randy Tice (rtice) <rtice@cisco.com>; dev@dpdk.org <dev@dpdk.org><br>
<b>Cc: </b>Bruce Richardson <bruce.richardson@intel.com>; Harman Kalra <hkalra@marvell.com>; Stephen Hemminger <stephen@networkplumber.org><br>
<b>Subject: </b>Re: [PATCH v3 1/1] mbuf: add optional no-copy dynamic field storage</span></p>
</div>
<div id="mail-editor-reference-message-body">
<p class="MsoNormal" style="margin: 0cm 0cm 12pt; font-family: Times New Roman, "serif"; font-size: 12pt;">
<span style="font-size: 11pt;"><br>
<br>
>> From: Konstantin Ananyev [</span><span style="font-size: 11pt; color: blue;"><a href="mailto:konstantin.v.ananyev@yandex.ru" style="color: blue; margin-top: 0px; margin-bottom: 0px;" data-outlook-id="844faf7c-5ddb-45a3-8713-86321cf7aae9"><u>mailto:konstantin.v.ananyev@yandex.ru</u></a></span><span style="font-size: 11pt;">]<br>
>> Sent: Tuesday, 29 September 2026 15.13<br>
>><br>
>> 29.09.2026 13:44, Morten Brørup пишет:<br>
>>>> From: Konstantin Ananyev [</span><span style="font-size: 11pt; color: blue;"><a href="mailto:konstantin.v.ananyev@yandex.ru" style="color: blue; margin-top: 0px; margin-bottom: 0px;" data-outlook-id="99a48558-d654-4ae5-a8ca-63f9a61a6b78"><u>mailto:konstantin.v.ananyev@yandex.ru</u></a></span><span style="font-size: 11pt;">]<br>
>>>> Sent: Tuesday, 29 September 2026 14.00<br>
>>>><br>
>>>> 28.09.2026 19:16, Randy L Tice пишет:<br>
>>>>> From: Randy L Tice <rtice@cisco.com><br>
>>>>> Date: Thu, 03 Sep 2026 09:13:28 -0400<br>
>>>>><br>
>>>>> Add build-time support for optional cache-line-aligned dynamic-<br>
>> field<br>
>>>>> storage at the end of struct rte_mbuf.<br>
>>>>><br>
>>>>> The mbuf_dynfield3_size Meson option sets RTE_MBUF_DYNFIELD3_SIZE<br>
>> in<br>
>>>>> rte_build_config.h. A non-zero value enables the extra area and<br>
>> grows<br>
>>>>> every mbuf by the configured amount.<br>
>>>> I am strongly opposed to that patch.<br>
>>>> Inside mbuf we already do have priv_size that allows user to store<br>
>>>> his/her specific<br>
>>>> data straight after rte_mbuf in adjacent manner.<br>
>>>> It worked well so far for many use-cases (including VPP) and I don't<br>
>>>> see any<br>
>>>> reason why this is not enough.<br>
>>>> From other side - making size of core rte_mbuf configurable at<br>
>> run-<br>
>>>> time,<br>
>>>> will affect DPDK ABI stability in a negative way.<br>
>>>> Fro my perspective it is much plausible in terms of ABI stability<br>
>> and<br>
>>>> predictability<br>
>>>> to have just one fixed layout for the mbuf.<br>
>>>> Konstantin<br>
>>> The private data area (priv_size) is independent per mbuf pool, and<br>
>> selected at run-time when creating each pool. As Randy explained in the<br>
>> RFC, this is unavailable for mbuf pools created by other components.<br>
>><br>
>> I think it should be trivial to enforce minimal priv_size across all<br>
>> mbuf pools what will be obeyed by different components<br>
>> (as long as they do use rte_pktmbuf_pool_create() and friends):<br>
>> 1) introduce new EAL parameter 'mbuf-min-priv-size' or so (keep default<br>
>> as zero)<br>
>> 2) make rte_pktmbuf_pool_create_by_ops() and<br>
>> rte_pktmbuf_pool_create_extbuf() to check that input paramter<br>
>> 'priv_size' GE then value specified by EAL parameter, if so then return<br>
>> an error.<br>
> The private data area cannot be used.<br>
> Let's say one module creates an mbuf pool with priv_size of 8, and uses those 8 bytes,<br>
> and some second module creates an mbuf pool with priv_size of 16, and uses those 16 bytes.<br>
><br>
> How should a module (or the application) know at which offset to store its private data without overwriting the private data of other modules?<br>
><br>
> 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)<br>
ok, I see, you need an ability to register/unregister/query layout for<br>
that private buffer (what we have now for dynfields).<br>
Then yes, if we'll add an ability to expand mbuf dynfield[] buffer that<br>
might be useful, and probably will become<br>
more popular then current 'priv_size' apporach.<br>
But I believe it shouldn't be a build time option.<br>
><br>
>>> Mbuf dynamic fields are shared across all mbuf pools, and serves the<br>
>> need with an existing API. So I am strongly in favor of using the mbuf<br>
>> dynamic fields API for this.<br>
>>> I agree with Konstantin that it would be optimal if the size of the<br>
>> added dynfields area was run-time configurable (as an EAL startup<br>
>> parameter).<br>
>>> However, such a modification to the mbuf library would also require<br>
>> that the performance cost in the dataplane is negligible. We don't want<br>
>> to compromise on mbuf performance for applications not using this new<br>
>> feature.<br>
>>> Randy,<br>
>>> Could you please explore such an approach?<br>
>>><br>
>>> -Morten</span></p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>