> From: Stephen Hemminger [mailto:[email protected]]
> Sent: Monday, 21 September 2026 23.57
>
> 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.
>
> Move name out of the first cache line of struct rte_ring and
> struct rte_mempool so the larger name does not push datapath
> fields into another cache line. For mempool this also brings
> local_cache, cache_size and ops_index into the first cache line,
> where previously they were in the second. struct rte_mempool
> stays 192 bytes; struct rte_ring grows by one cache line.
>
> Signed-off-by: Stephen Hemminger <[email protected]>
The name length limits are there for practical reasons only; they are not there
to impose restrictions on names.
And with the prefixes being stacked in front of the names, the current 31
character limit is too small.
This is a good improvement.
Not a qualifying as a "bugfix", but absolutely lifting a silly restriction.
A few improvements (read: feature creep) suggested inline below.
> ---
> doc/guides/rel_notes/release_26_11.rst | 19 +++++++++++++++++++
> lib/eal/include/rte_memzone.h | 2 +-
> lib/mempool/rte_mempool.h | 8 ++++----
> lib/ring/rte_ring_core.h | 5 ++---
> 4 files changed, 26 insertions(+), 8 deletions(-)
>
> diff --git a/doc/guides/rel_notes/release_26_11.rst
> b/doc/guides/rel_notes/release_26_11.rst
> index 4b3e5d995c..380aecb5a7 100644
> --- a/doc/guides/rel_notes/release_26_11.rst
> +++ b/doc/guides/rel_notes/release_26_11.rst
> @@ -139,6 +139,25 @@ 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 ``name`` was moved after the size fields
> + to keep the datapath fields in the first cache line.
> +
> + * ``struct rte_mempool`` is unchanged in size,
> + but ``name``, ``pool_config`` and ``mz`` were moved
> + after the fields used in the datapath.
> +
> + * ``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..d2ae56e49f 100644
> --- a/lib/mempool/rte_mempool.h
> +++ b/lib/mempool/rte_mempool.h
> @@ -230,13 +230,11 @@ 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
> */
> unsigned int flags; /**< Flags of the mempool. */
> int socket_id; /**< Socket id passed at create.
> */
> uint32_t size; /**< Max size of the mempool. */
> @@ -257,7 +255,9 @@ struct __rte_cache_aligned rte_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 */
I have submitted a patch introducing a new "sizeof_cache_per_lcore" field [1].
This new field must be close to the "local_cache" field.
Also, for mempool cache misses, the "ops_index" and "pool_data" fields should
be close together. Optimally also close to the "local_cache" field, so they
have been fetched with it.
[1]:
https://patchwork.dpdk.org/project/dpdk/patch/[email protected]/
AFAIK, only these four fields hot in the dataplane:
- local_cache, sizeof_cache_per_lcore (new field):
Used for access to objects in cache.
- ops_index, pool_data/pool_id:
Used on cache miss for access to objects in backing store.
The other fields are not used in the dataplane, and can be moved down below
these four, which should be first.
Note: The cache_size field is currently hot, but my patch makes it cold.
> diff --git a/lib/ring/rte_ring_core.h b/lib/ring/rte_ring_core.h
> index 6cd6ce9884..4359ca8006 100644
> --- a/lib/ring/rte_ring_core.h
> +++ b/lib/ring/rte_ring_core.h
> @@ -114,14 +114,13 @@ struct rte_ring_hts_headtail {
> * a problem.
> */
> struct rte_ring {
> - alignas(RTE_CACHE_LINE_SIZE) char name[RTE_RING_NAMESIZE];
> - /**< Name of the ring. */
> - int flags; /**< Flags supplied at creation. */
> + alignas(RTE_CACHE_LINE_SIZE) 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 */
> + char name[RTE_RING_NAMESIZE]; /**< Name of the ring. */
>
> RTE_CACHE_GUARD;
>
> --
> 2.53.0
Suggest rearranging the ring slightly more, like the mempool...
1. Move cache alignment to the structure itself, instead of its first field:
"struct __rte_cache_aligned rte_ring" instead of "alignas(RTE_CACHE_LINE_SIZE)
int flags".
2. Move the memzone pointer down too, just ahead of the name.