DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: "Stephen Hemminger" <stephen@networkplumber.org>,
	"Anatoly Burakov" <anatoly.burakov@intel.com>,
	"Andrew Rybchenko" <andrew.rybchenko@oktetlabs.ru>,
	"Morten Brørup" <mb@smartsharesystems.com>,
	"Konstantin Ananyev" <konstantin.ananyev@huawei.com>,
	"Wathsala Vithanage" <wathsala.vithanage@arm.com>
Subject: [PATCH v2 2/3] eal: increase memzone name size to 64
Date: Tue, 22 Sep 2026 08:52:09 -0700	[thread overview]
Message-ID: <20260922155249.3115271-3-stephen@networkplumber.org> (raw)
In-Reply-To: <20260922155249.3115271-1-stephen@networkplumber.org>

Memzone names are limited to 31 characters, and ring, mempool and
stack names lose the length of their prefixes on top of that.
A mempool name is limited to 25 characters, which leaves little room
for libraries such as rib and fib that derive names from the name
given by the application.

Increase RTE_MEMZONE_NAMESIZE to 64. The derived ring, mempool,
stack and RCU defer queue sizes follow.

Reorder struct rte_ring and struct rte_mempool so the larger name
does not push datapath fields into another cache line.

For rte_ring, flags and the size fields come first, followed by the
memzone pointer and the name. The cache alignment moves from the
first field to the structure itself. struct rte_ring grows by one
cache line.

For rte_mempool the fields used in the datapath are gathered at the
start: pool_data/pool_id, local_cache, ops_index and cache_size.
The remaining fields, along with pool_config, mz and name, follow.
Previously local_cache and ops_index were in the second cache line.
struct rte_mempool stays 192 bytes.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 doc/guides/rel_notes/release_26_11.rst | 21 +++++++++++++++++++
 lib/eal/include/rte_memzone.h          |  2 +-
 lib/mempool/rte_mempool.h              | 29 +++++++++++++-------------
 lib/ring/rte_ring_core.h               |  9 ++++----
 4 files changed, 41 insertions(+), 20 deletions(-)

diff --git a/doc/guides/rel_notes/release_26_11.rst b/doc/guides/rel_notes/release_26_11.rst
index 4b3e5d995c..99847e9745 100644
--- a/doc/guides/rel_notes/release_26_11.rst
+++ b/doc/guides/rel_notes/release_26_11.rst
@@ -139,6 +139,27 @@ ABI Changes
    Also, make sure to start the actual text at the margin.
    =======================================================
 
+* **Increased memzone maximum name size.**
+
+  ``RTE_MEMZONE_NAMESIZE`` was increased from 32 to 64,
+  and the derived ``RTE_RING_NAMESIZE``, ``RTE_MEMPOOL_NAMESIZE``,
+  ``RTE_STACK_NAMESIZE`` and ``RTE_RCU_QSBR_DQ_NAMESIZE`` grew accordingly.
+  This impacts the following structures:
+
+  * ``struct rte_memzone`` grew by 32 bytes.
+
+  * ``struct rte_ring`` grew by one cache line,
+    and ``memzone`` and ``name`` were moved after the size fields
+    to keep the datapath fields in the first cache line.
+
+  * ``struct rte_mempool`` is unchanged in size,
+    but the fields were reordered so the datapath fields
+    (``pool_data``/``pool_id``, ``local_cache``, ``ops_index``
+    and ``cache_size``) come first,
+    and ``name``, ``pool_config`` and ``mz`` were moved after them.
+
+  * ``struct rte_stack`` grew by one cache line.
+
 
 Known Issues
 ------------
diff --git a/lib/eal/include/rte_memzone.h b/lib/eal/include/rte_memzone.h
index 5a0e1b8a15..d5c92fe0ec 100644
--- a/lib/eal/include/rte_memzone.h
+++ b/lib/eal/include/rte_memzone.h
@@ -47,7 +47,7 @@ extern "C" {
  */
 struct __rte_packed_begin rte_memzone {
 
-#define RTE_MEMZONE_NAMESIZE 32       /**< Maximum length of memory zone name.*/
+#define RTE_MEMZONE_NAMESIZE 64       /**< Maximum length of memory zone name.*/
 	char name[RTE_MEMZONE_NAMESIZE];  /**< Name of the memory zone. */
 
 	rte_iova_t iova;                  /**< Start IO address. */
diff --git a/lib/mempool/rte_mempool.h b/lib/mempool/rte_mempool.h
index 50d958c7c6..5c7fd46720 100644
--- a/lib/mempool/rte_mempool.h
+++ b/lib/mempool/rte_mempool.h
@@ -230,34 +230,35 @@ struct __rte_cache_aligned rte_mempool_info {
  * The RTE mempool structure.
  */
 struct __rte_cache_aligned rte_mempool {
-	char name[RTE_MEMPOOL_NAMESIZE]; /**< Name of mempool. */
 	union {
 		void *pool_data;         /**< Ring or pool to store objects. */
 		uint64_t pool_id;        /**< External mempool identifier. */
 	};
-	void *pool_config;               /**< optional args for ops alloc. */
-	const struct rte_memzone *mz;    /**< Memzone where pool is alloc'd. */
+	struct rte_mempool_cache *local_cache; /**< Per-lcore local cache */
+	/**
+	 * Index into rte_mempool_ops_table array of mempool ops
+	 * structs, which contain callback function pointers.
+	 * We're using an index here rather than pointers to the callbacks
+	 * to facilitate any secondary processes that may want to use
+	 * this mempool.
+	 */
+	int32_t ops_index;
+	uint32_t cache_size;
+	/**< Size of per-lcore default local cache. */
+
 	unsigned int flags;              /**< Flags of the mempool. */
 	int socket_id;                   /**< Socket id passed at create. */
 	uint32_t size;                   /**< Max size of the mempool. */
-	uint32_t cache_size;
-	/**< Size of per-lcore default local cache. */
 
 	uint32_t elt_size;               /**< Size of an element. */
 	uint32_t header_size;            /**< Size of header (before elt). */
 	uint32_t trailer_size;           /**< Size of trailer (after elt). */
 
 	unsigned private_data_size;      /**< Size of private data. */
-	/**
-	 * Index into rte_mempool_ops_table array of mempool ops
-	 * structs, which contain callback function pointers.
-	 * We're using an index here rather than pointers to the callbacks
-	 * to facilitate any secondary processes that may want to use
-	 * this mempool.
-	 */
-	int32_t ops_index;
 
-	struct rte_mempool_cache *local_cache; /**< Per-lcore local cache */
+	void *pool_config;               /**< optional args for ops alloc. */
+	const struct rte_memzone *mz;    /**< Memzone where pool is alloc'd. */
+	char name[RTE_MEMPOOL_NAMESIZE]; /**< Name of mempool. */
 
 	uint32_t populated_size;         /**< Number of populated objects. */
 	struct rte_mempool_objhdr_list elt_list; /**< List of objects in pool */
diff --git a/lib/ring/rte_ring_core.h b/lib/ring/rte_ring_core.h
index 6cd6ce9884..5425cdcef2 100644
--- a/lib/ring/rte_ring_core.h
+++ b/lib/ring/rte_ring_core.h
@@ -113,15 +113,14 @@ struct rte_ring_hts_headtail {
  * values in a modulo-32bit base: that's why the overflow of the indexes is not
  * a problem.
  */
-struct rte_ring {
-	alignas(RTE_CACHE_LINE_SIZE) char name[RTE_RING_NAMESIZE];
-	/**< Name of the ring. */
+struct __rte_cache_aligned rte_ring {
 	int flags;               /**< Flags supplied at creation. */
-	const struct rte_memzone *memzone;
-			/**< Memzone, if any, containing the rte_ring */
 	uint32_t size;           /**< Size of ring. */
 	uint32_t mask;           /**< Mask (size-1) of ring. */
 	uint32_t capacity;       /**< Usable size of ring */
+	const struct rte_memzone *memzone;
+			/**< Memzone, if any, containing the rte_ring */
+	char name[RTE_RING_NAMESIZE]; /**< Name of the ring. */
 
 	RTE_CACHE_GUARD;
 
-- 
2.53.0


  parent reply	other threads:[~2026-09-22 15:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-21 21:57 [PATCH] eal: increase memzone name size to 64 Stephen Hemminger
2026-09-22 10:42 ` Morten Brørup
2026-09-22 15:52 ` [PATCH v2 0/3] increase memzone name size and fix rib/fib prefixes Stephen Hemminger
2026-09-22 15:52   ` [PATCH v2 1/3] app/crypto-perf: fix asymmetric op pool name size Stephen Hemminger
2026-09-22 18:25     ` [EXTERNAL] " Akhil Goyal
2026-09-22 15:52   ` Stephen Hemminger [this message]
2026-09-22 15:52   ` [PATCH v2 3/3] fib, rib: fix name prefixes Stephen Hemminger
2026-09-22 19:46     ` Medvedkin, Vladimir

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=20260922155249.3115271-3-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=anatoly.burakov@intel.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=dev@dpdk.org \
    --cc=konstantin.ananyev@huawei.com \
    --cc=mb@smartsharesystems.com \
    --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