From: "Morten Brørup" <mb@smartsharesystems.com>
To: "Stephen Hemminger" <stephen@networkplumber.org>, <dev@dpdk.org>,
"Anurag Mandal" <anurag.mandal@intel.com>
Cc: "Anatoly Burakov" <anatoly.burakov@intel.com>,
"Konstantin Ananyev" <konstantin.ananyev@huawei.com>,
"Wathsala Vithanage" <wathsala.vithanage@arm.com>
Subject: RE: [RFC] increase name sizes and reorder structures
Date: Thu, 20 Aug 2026 12:00:22 +0200 [thread overview]
Message-ID: <98CBD80474FA8B44BF855DF32C47DC35F65A03@smartserver.smartshare.dk> (raw)
In-Reply-To: <20260813171418.568620-1-stephen@networkplumber.org>
Anurag raised an interesting question regarding Bug 1980 [1], which got me thinking...
Now that the max mempool name length has increased by three bytes, it is safe to reduce by one byte without breaking existing applications using long mempool names.
How about adding a modification of rte_mempool.h [2] like this (untested), to fix Bug 1980 (at least for stack drivers):
-/**< Maximum length of a memory pool's name. */
-#define RTE_MEMPOOL_NAMESIZE (RTE_RING_NAMESIZE - \
- sizeof(RTE_MEMPOOL_MZ_PREFIX) + 1)
+/**
+ * Maximum length of a memory pool's name.
+ *
+ * Needs room for memzone prefix indicating "mempool" type:
+ * "MP_<name>"
+ * Note:
+ * The mempool driver needs room for its own memzone prefix too, e.g.:
+ * "RG_MP_<name>" (ring driver) or "STK_MP_<name>" (stack driver)
+ * In order to fail early on too long names when creating the mempool,
+ * the length of the memzone name reserved by various mempool drivers are
+ * not considered; only the ring and stack drivers are considered here.
+ * If the name eventually turns out to be too long for the chosen mempool driver,
+ * populating the mempool will fail.
+ */
+#define RTE_MEMPOOL_OPS_REPRESENTATIVE_NAMESIZE \
+ RTE_MAX(RTE_RING_NAMESIZE, RTE_STACK_NAMESIZE)
+#define RTE_MEMPOOL_NAMESIZE \
+ (RTE_MEMPOOL_OPS_REPRESENTATIVE_NAMESIZE - \
+ (sizeof(RTE_MEMPOOL_MZ_PREFIX) - 1))
[1]: https://bugs.dpdk.org/show_bug.cgi?id=1980
[2]: https://elixir.bootlin.com/dpdk/v26.07/source/lib/mempool/rte_mempool.h#L130
Then, the release notes should be updated too:
- * mempool: The maximum length of a mempool name ``RTE_MEMPOOL_NAMESIZE`` increased from 26 to 29.
- * mempool: The maximum length of a mempool name ``RTE_MEMPOOL_NAMESIZE`` increased from 26 to 28.
prev parent reply other threads:[~2026-08-20 10:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-13 17:12 [RFC] increase name sizes and reorder structures Stephen Hemminger
2026-08-14 12:12 ` Morten Brørup
2026-08-14 15:19 ` Stephen Hemminger
2026-08-20 10:00 ` Morten Brørup [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=98CBD80474FA8B44BF855DF32C47DC35F65A03@smartserver.smartshare.dk \
--to=mb@smartsharesystems.com \
--cc=anatoly.burakov@intel.com \
--cc=anurag.mandal@intel.com \
--cc=dev@dpdk.org \
--cc=konstantin.ananyev@huawei.com \
--cc=stephen@networkplumber.org \
--cc=wathsala.vithanage@arm.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