* [PATCH] eal: increase memzone name size to 64 @ 2026-09-21 21:57 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 0 siblings, 2 replies; 8+ messages in thread From: Stephen Hemminger @ 2026-09-21 21:57 UTC (permalink / raw) To: dev Cc: Stephen Hemminger, Anatoly Burakov, Andrew Rybchenko, Morten Brørup, Konstantin Ananyev, Wathsala Vithanage 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 <stephen@networkplumber.org> --- 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 */ 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 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* RE: [PATCH] eal: increase memzone name size to 64 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 1 sibling, 0 replies; 8+ messages in thread From: Morten Brørup @ 2026-09-22 10:42 UTC (permalink / raw) To: Stephen Hemminger, dev Cc: Anatoly Burakov, Andrew Rybchenko, Konstantin Ananyev, Wathsala Vithanage > From: Stephen Hemminger [mailto:stephen@networkplumber.org] > 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 <stephen@networkplumber.org> 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/20260910103613.808038-7-mb@smartsharesystems.com/ 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. ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 0/3] increase memzone name size and fix rib/fib prefixes 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 ` Stephen Hemminger 2026-09-22 15:52 ` [PATCH v2 1/3] app/crypto-perf: fix asymmetric op pool name size Stephen Hemminger ` (2 more replies) 1 sibling, 3 replies; 8+ messages in thread From: Stephen Hemminger @ 2026-09-22 15:52 UTC (permalink / raw) To: dev; +Cc: Stephen Hemminger This series increases memzone name size and also incorporates the patch to check FIB and RIB namesizes. Memzone names are limited to 31 characters, and ring, mempool and stack names lose the length of their prefixes on top of that. Patches: 1. fixes hardcoded 32 size in crypto-perf app. 2. increases RTE_MEMZONE_NAMESIZE to 64 and reorders slightly. 3. Anurag Mandal's "fib, rib: fix name prefixes" v2, rebased. v2 - merge in name size and rib, fib - incorporate review comments Anurag Mandal (1): fib, rib: fix name prefixes Stephen Hemminger (2): app/crypto-perf: fix asymmetric op pool name size eal: increase memzone name size to 64 app/test-crypto-perf/cperf_test_common.c | 4 +-- doc/guides/rel_notes/release_26_11.rst | 36 ++++++++++++++++++++++++ lib/eal/include/rte_memzone.h | 2 +- lib/fib/rte_fib.c | 16 +++++++++-- lib/fib/rte_fib6.c | 16 +++++++++-- lib/mempool/rte_mempool.h | 29 ++++++++++--------- lib/rib/rte_rib.c | 14 +++++++-- lib/rib/rte_rib6.c | 14 +++++++-- lib/ring/rte_ring_core.h | 9 +++--- 9 files changed, 108 insertions(+), 32 deletions(-) -- 2.53.0 ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 1/3] app/crypto-perf: fix asymmetric op pool name size 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 ` Stephen Hemminger 2026-09-22 18:25 ` [EXTERNAL] " Akhil Goyal 2026-09-22 15:52 ` [PATCH v2 2/3] eal: increase memzone name size to 64 Stephen Hemminger 2026-09-22 15:52 ` [PATCH v2 3/3] fib, rib: fix name prefixes Stephen Hemminger 2 siblings, 1 reply; 8+ messages in thread From: Stephen Hemminger @ 2026-09-22 15:52 UTC (permalink / raw) To: dev; +Cc: Stephen Hemminger, Kai Ji, Akhil Goyal, Kiran Kumar K The asymmetric op pool name buffer is 32 bytes but snprintf is given RTE_MEMPOOL_NAMESIZE as the size. This is harmless only as long as RTE_MEMPOOL_NAMESIZE is not larger than 32. Size the buffer with RTE_MEMPOOL_NAMESIZE and use sizeof() for the snprintf limit, as the symmetric path already does. Fixes: ba588ce3f933 ("test/crypto-perf: test asymmetric crypto throughput") Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> --- app/test-crypto-perf/cperf_test_common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/test-crypto-perf/cperf_test_common.c b/app/test-crypto-perf/cperf_test_common.c index 0bcaa6dfd8..b2eabf470e 100644 --- a/app/test-crypto-perf/cperf_test_common.c +++ b/app/test-crypto-perf/cperf_test_common.c @@ -145,7 +145,7 @@ cperf_alloc_common_memory(const struct cperf_options *options, struct rte_mempool **pool) { const char *mp_ops_name; - char pool_name[32] = ""; + char pool_name[RTE_MEMPOOL_NAMESIZE] = ""; int ret; /* Calculate the object size */ @@ -154,7 +154,7 @@ cperf_alloc_common_memory(const struct cperf_options *options, if (cperf_is_asym_test(options)) { crypto_op_size += sizeof(struct rte_crypto_asym_op); - snprintf(pool_name, RTE_MEMPOOL_NAMESIZE, "perf_asym_op_pool%u", + snprintf(pool_name, sizeof(pool_name), "perf_asym_op_pool%u", rte_socket_id()); *pool = rte_crypto_op_pool_create( pool_name, RTE_CRYPTO_OP_TYPE_ASYMMETRIC, -- 2.53.0 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* RE: [EXTERNAL] [PATCH v2 1/3] app/crypto-perf: fix asymmetric op pool name size 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 ` Akhil Goyal 0 siblings, 0 replies; 8+ messages in thread From: Akhil Goyal @ 2026-09-22 18:25 UTC (permalink / raw) To: Stephen Hemminger, dev@dpdk.org; +Cc: Kai Ji, Kiran Kumar Kokkilagadda > The asymmetric op pool name buffer is 32 bytes but snprintf is given > RTE_MEMPOOL_NAMESIZE as the size. This is harmless only as long as > RTE_MEMPOOL_NAMESIZE is not larger than 32. > > Size the buffer with RTE_MEMPOOL_NAMESIZE and use sizeof() for the > snprintf limit, as the symmetric path already does. > > Fixes: ba588ce3f933 ("test/crypto-perf: test asymmetric crypto throughput") > Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> > --- > app/test-crypto-perf/cperf_test_common.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Acked-by: Akhil Goyal <gakhil@marvell.com> ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 2/3] eal: increase memzone name size to 64 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 15:52 ` Stephen Hemminger 2026-09-22 15:52 ` [PATCH v2 3/3] fib, rib: fix name prefixes Stephen Hemminger 2 siblings, 0 replies; 8+ messages in thread From: Stephen Hemminger @ 2026-09-22 15:52 UTC (permalink / raw) To: dev Cc: Stephen Hemminger, Anatoly Burakov, Andrew Rybchenko, Morten Brørup, Konstantin Ananyev, Wathsala Vithanage 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 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 3/3] fib, rib: fix name prefixes 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 15:52 ` [PATCH v2 2/3] eal: increase memzone name size to 64 Stephen Hemminger @ 2026-09-22 15:52 ` Stephen Hemminger 2026-09-22 19:46 ` Medvedkin, Vladimir 2 siblings, 1 reply; 8+ messages in thread From: Stephen Hemminger @ 2026-09-22 15:52 UTC (permalink / raw) To: dev Cc: Anurag Mandal, Morten Brørup, Stephen Hemminger, Vladimir Medvedkin From: Anurag Mandal <anurag.mandal@intel.com> The RIB library named the mempool holding its nodes "MP_<name>". That prefix is the one the mempool library itself prepends to the backing memzone, so the memzone ended up named "MP_MP_<name>" which is improper. The FIB library passed its own name unchanged to the underlying RIB and did not add a prefix to the RIB name. This patch names each object after its owner. The node mempool of a RIB is now "RIB_<name>" or "RIB6_<name>", and the RIB owned by a FIB is now "FIB_<name>" or "FIB6_<name>". A mempool name is limited to RTE_MEMPOOL_NAMESIZE, which is shorter than RTE_RIB_NAMESIZE. The name was passed down silently and an oversized one surfaced as an opaque rte_mempool_create() failure, so check the derived name up front and return ENAMETOOLONG instead. As the prefixes above are added on top of the name, the maximum length of a name is limited to the following: RIB : 53 characters RIB6: 52 characters FIB : 49 characters FIB6: 47 characters Bugzilla ID: 1981 1982 Fixes: 5a5793a5ffa2 ("rib: add RIB library") Fixes: f7e861e21c46 ("rib: support IPv6") Fixes: 39e927248416 ("fib: add FIB library") Fixes: 40d41a8a7b34 ("fib: support IPv6") Signed-off-by: Anurag Mandal <anurag.mandal@intel.com> Acked-by: Morten Brørup <mb@smartsharesystems.com> [stephen: recomputed the name length limits for 64 byte memzone names, dropped the now unneeded test, example and node renames] Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> --- doc/guides/rel_notes/release_26_11.rst | 15 +++++++++++++++ lib/fib/rte_fib.c | 16 +++++++++++++--- lib/fib/rte_fib6.c | 16 +++++++++++++--- lib/rib/rte_rib.c | 14 ++++++++++++-- lib/rib/rte_rib6.c | 14 ++++++++++++-- 5 files changed, 65 insertions(+), 10 deletions(-) diff --git a/doc/guides/rel_notes/release_26_11.rst b/doc/guides/rel_notes/release_26_11.rst index 99847e9745..31de764a9d 100644 --- a/doc/guides/rel_notes/release_26_11.rst +++ b/doc/guides/rel_notes/release_26_11.rst @@ -123,6 +123,21 @@ API Changes * ``rte_tel_data_add_dict_uint_hex`` * ``rte_telemetry_register_cmd_arg`` +* rib: The node mempool created by ``rte_rib_create()`` and ``rte_rib6_create()`` + is now named ``RIB_<name>`` and ``RIB6_<name>`` instead of ``MP_<name>``. + +* fib: The RIB created by ``rte_fib_create()`` and ``rte_fib6_create()`` + is now named ``FIB_<name>`` and ``FIB6_<name>``. + +* rib, fib: The name of a RIB, RIB6, FIB or FIB6 is used to derive the name of + its node mempool, which is bounded by ``RTE_MEMPOOL_NAMESIZE``. + As the prefixes above are added on top of the name, + the maximum length of a name is the following: + + * RIB - 53 characters. + * RIB6 - 52 characters. + * FIB - 49 characters. + * FIB6 - 47 characters. ABI Changes ----------- diff --git a/lib/fib/rte_fib.c b/lib/fib/rte_fib.c index 184210f380..7a587820ad 100644 --- a/lib/fib/rte_fib.c +++ b/lib/fib/rte_fib.c @@ -37,6 +37,9 @@ EAL_REGISTER_TAILQ(rte_fib_tailq) #define FIB_RETURN_IF_TRUE(cond, retval) #endif +/* Prefix used for the memory objects owned by a FIB. */ +#define FIB_MEM_PREFIX "FIB_" + struct rte_fib { char name[RTE_FIB_NAMESIZE]; enum rte_fib_type type; /**< Type of FIB struct */ @@ -173,14 +176,21 @@ rte_fib_create(const char *name, int socket_id, struct rte_fib_conf *conf) rib_conf.ext_sz = conf->rib_ext_sz; rib_conf.max_nodes = conf->max_routes * 2; - rib = rte_rib_create(name, socket_id, &rib_conf); + /* Add FIB Prefix to its mempool name */ + ret = snprintf(mem_name, sizeof(mem_name), FIB_MEM_PREFIX "%s", name); + if (ret < 0 || ret >= (int)sizeof(mem_name)) { + FIB_LOG(ERR, "FIB name %s is too long", name); + rte_errno = ENAMETOOLONG; + return NULL; + } + + rib = rte_rib_create(mem_name, socket_id, &rib_conf); if (rib == NULL) { FIB_LOG(ERR, - "Can not allocate RIB %s", name); + "Can not allocate RIB for FIB: %s", mem_name); return NULL; } - snprintf(mem_name, sizeof(mem_name), "FIB_%s", name); fib_list = RTE_TAILQ_CAST(rte_fib_tailq.head, rte_fib_list); rte_mcfg_tailq_write_lock(); diff --git a/lib/fib/rte_fib6.c b/lib/fib/rte_fib6.c index 770becdb61..1a31ab09aa 100644 --- a/lib/fib/rte_fib6.c +++ b/lib/fib/rte_fib6.c @@ -37,6 +37,9 @@ EAL_REGISTER_TAILQ(rte_fib6_tailq) #define FIB6_RETURN_IF_TRUE(cond, retval) #endif +/* Prefix used for the memory objects owned by a FIB6. */ +#define FIB6_MEM_PREFIX "FIB6_" + struct rte_fib6 { char name[RTE_FIB6_NAMESIZE]; enum rte_fib6_type type; /**< Type of FIB struct */ @@ -172,14 +175,21 @@ rte_fib6_create(const char *name, int socket_id, struct rte_fib6_conf *conf) rib_conf.ext_sz = conf->rib_ext_sz; rib_conf.max_nodes = conf->max_routes * 2; - rib = rte_rib6_create(name, socket_id, &rib_conf); + /* Add FIB6 Prefix to its mempool name */ + ret = snprintf(mem_name, sizeof(mem_name), FIB6_MEM_PREFIX "%s", name); + if (ret < 0 || ret >= (int)sizeof(mem_name)) { + FIB_LOG(ERR, "FIB6 name %s is too long", name); + rte_errno = ENAMETOOLONG; + return NULL; + } + + rib = rte_rib6_create(mem_name, socket_id, &rib_conf); if (rib == NULL) { FIB_LOG(ERR, - "Can not allocate RIB %s", name); + "Can not allocate RIB6 for FIB6 %s", mem_name); return NULL; } - snprintf(mem_name, sizeof(mem_name), "FIB6_%s", name); fib_list = RTE_TAILQ_CAST(rte_fib6_tailq.head, rte_fib6_list); rte_mcfg_tailq_write_lock(); diff --git a/lib/rib/rte_rib.c b/lib/rib/rte_rib.c index 046db131ca..55802f0060 100644 --- a/lib/rib/rte_rib.c +++ b/lib/rib/rte_rib.c @@ -32,6 +32,8 @@ EAL_REGISTER_TAILQ(rte_rib_tailq) #define RIB_MAXDEPTH 32 /* Maximum length of a RIB name. */ #define RTE_RIB_NAMESIZE 64 +/* Prefix used for the memory objects owned by a RIB. */ +#define RIB_MEM_PREFIX "RIB_" struct rte_rib_node { struct rte_rib_node *left; @@ -417,6 +419,7 @@ rte_rib_create(const char *name, int socket_id, const struct rte_rib_conf *conf) struct rte_tailq_entry *te; struct rte_rib_list *rib_list; struct rte_mempool *node_pool; + int ret; /* Check user arguments. */ if (unlikely(name == NULL || conf == NULL || conf->max_nodes <= 0)) { @@ -424,7 +427,15 @@ rte_rib_create(const char *name, int socket_id, const struct rte_rib_conf *conf) return NULL; } - snprintf(mem_name, sizeof(mem_name), "MP_%s", name); + /* Add RIB Prefix to its node mempool name */ + ret = snprintf(mem_name, sizeof(mem_name), RIB_MEM_PREFIX "%s", name); + if (unlikely(ret < 0 || ret >= (int)RTE_MEMPOOL_NAMESIZE)) { + RIB_LOG(ERR, "RIB name %s is too long, limit is %zu characters", + name, RTE_MEMPOOL_NAMESIZE - sizeof(RIB_MEM_PREFIX)); + rte_errno = ENAMETOOLONG; + return NULL; + } + node_pool = rte_mempool_create(mem_name, conf->max_nodes, sizeof(struct rte_rib_node) + conf->ext_sz, 0, 0, NULL, NULL, NULL, NULL, socket_id, 0); @@ -435,7 +446,6 @@ rte_rib_create(const char *name, int socket_id, const struct rte_rib_conf *conf) return NULL; } - snprintf(mem_name, sizeof(mem_name), "RIB_%s", name); rib_list = RTE_TAILQ_CAST(rte_rib_tailq.head, rte_rib_list); rte_mcfg_tailq_write_lock(); diff --git a/lib/rib/rte_rib6.c b/lib/rib/rte_rib6.c index 918ddbdfd3..7d9a0ba36f 100644 --- a/lib/rib/rte_rib6.c +++ b/lib/rib/rte_rib6.c @@ -24,6 +24,8 @@ #define RTE_RIB_VALID_NODE 1 /* Maximum length of a RIB6 name. */ #define RTE_RIB6_NAMESIZE 64 +/* Prefix used for the memory objects owned by a RIB6. */ +#define RIB6_MEM_PREFIX "RIB6_" TAILQ_HEAD(rte_rib6_list, rte_tailq_entry); static struct rte_tailq_elem rte_rib6_tailq = { @@ -480,6 +482,7 @@ rte_rib6_create(const char *name, int socket_id, struct rte_tailq_entry *te; struct rte_rib6_list *rib6_list; struct rte_mempool *node_pool; + int ret; /* Check user arguments. */ if (unlikely(name == NULL || conf == NULL || conf->max_nodes <= 0)) { @@ -487,7 +490,15 @@ rte_rib6_create(const char *name, int socket_id, return NULL; } - snprintf(mem_name, sizeof(mem_name), "MP_%s", name); + /* Add RIB6 Prefix to its node mempool name */ + ret = snprintf(mem_name, sizeof(mem_name), RIB6_MEM_PREFIX "%s", name); + if (unlikely(ret < 0 || ret >= (int)RTE_MEMPOOL_NAMESIZE)) { + RIB_LOG(ERR, "RIB6 name %s is too long, limit is %zu characters", + name, RTE_MEMPOOL_NAMESIZE - sizeof(RIB6_MEM_PREFIX)); + rte_errno = ENAMETOOLONG; + return NULL; + } + node_pool = rte_mempool_create(mem_name, conf->max_nodes, sizeof(struct rte_rib6_node) + conf->ext_sz, 0, 0, NULL, NULL, NULL, NULL, socket_id, 0); @@ -498,7 +509,6 @@ rte_rib6_create(const char *name, int socket_id, return NULL; } - snprintf(mem_name, sizeof(mem_name), "RIB6_%s", name); rib6_list = RTE_TAILQ_CAST(rte_rib6_tailq.head, rte_rib6_list); rte_mcfg_tailq_write_lock(); -- 2.53.0 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v2 3/3] fib, rib: fix name prefixes 2026-09-22 15:52 ` [PATCH v2 3/3] fib, rib: fix name prefixes Stephen Hemminger @ 2026-09-22 19:46 ` Medvedkin, Vladimir 0 siblings, 0 replies; 8+ messages in thread From: Medvedkin, Vladimir @ 2026-09-22 19:46 UTC (permalink / raw) To: Stephen Hemminger, dev; +Cc: Anurag Mandal, Morten Brørup Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com> On 9/22/2026 4:52 PM, Stephen Hemminger wrote: > From: Anurag Mandal <anurag.mandal@intel.com> > > The RIB library named the mempool holding its nodes "MP_<name>". > That prefix is the one the mempool library itself prepends to > the backing memzone, so the memzone ended up named > "MP_MP_<name>" which is improper. > > The FIB library passed its own name unchanged to the underlying > RIB and did not add a prefix to the RIB name. > > This patch names each object after its owner. > The node mempool of a RIB is now "RIB_<name>" or "RIB6_<name>", > and the RIB owned by a FIB is now "FIB_<name>" or "FIB6_<name>". > > A mempool name is limited to RTE_MEMPOOL_NAMESIZE, which is > shorter than RTE_RIB_NAMESIZE. > The name was passed down silently and an oversized one surfaced > as an opaque rte_mempool_create() failure, so check the derived > name up front and return ENAMETOOLONG instead. > As the prefixes above are added on top of the name, the maximum > length of a name is limited to the following: > RIB : 53 characters > RIB6: 52 characters > FIB : 49 characters > FIB6: 47 characters > > Bugzilla ID: 1981 1982 > Fixes: 5a5793a5ffa2 ("rib: add RIB library") > Fixes: f7e861e21c46 ("rib: support IPv6") > Fixes: 39e927248416 ("fib: add FIB library") > Fixes: 40d41a8a7b34 ("fib: support IPv6") > > Signed-off-by: Anurag Mandal <anurag.mandal@intel.com> > Acked-by: Morten Brørup <mb@smartsharesystems.com> > [stephen: recomputed the name length limits for 64 byte memzone > names, dropped the now unneeded test, example and node renames] > Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> > --- > doc/guides/rel_notes/release_26_11.rst | 15 +++++++++++++++ > lib/fib/rte_fib.c | 16 +++++++++++++--- > lib/fib/rte_fib6.c | 16 +++++++++++++--- > lib/rib/rte_rib.c | 14 ++++++++++++-- > lib/rib/rte_rib6.c | 14 ++++++++++++-- > 5 files changed, 65 insertions(+), 10 deletions(-) > > diff --git a/doc/guides/rel_notes/release_26_11.rst b/doc/guides/rel_notes/release_26_11.rst > index 99847e9745..31de764a9d 100644 > --- a/doc/guides/rel_notes/release_26_11.rst > +++ b/doc/guides/rel_notes/release_26_11.rst > @@ -123,6 +123,21 @@ API Changes > * ``rte_tel_data_add_dict_uint_hex`` > * ``rte_telemetry_register_cmd_arg`` > > +* rib: The node mempool created by ``rte_rib_create()`` and ``rte_rib6_create()`` > + is now named ``RIB_<name>`` and ``RIB6_<name>`` instead of ``MP_<name>``. > + > +* fib: The RIB created by ``rte_fib_create()`` and ``rte_fib6_create()`` > + is now named ``FIB_<name>`` and ``FIB6_<name>``. > + > +* rib, fib: The name of a RIB, RIB6, FIB or FIB6 is used to derive the name of > + its node mempool, which is bounded by ``RTE_MEMPOOL_NAMESIZE``. > + As the prefixes above are added on top of the name, > + the maximum length of a name is the following: > + > + * RIB - 53 characters. > + * RIB6 - 52 characters. > + * FIB - 49 characters. > + * FIB6 - 47 characters. > > ABI Changes > ----------- > diff --git a/lib/fib/rte_fib.c b/lib/fib/rte_fib.c > index 184210f380..7a587820ad 100644 > --- a/lib/fib/rte_fib.c > +++ b/lib/fib/rte_fib.c > @@ -37,6 +37,9 @@ EAL_REGISTER_TAILQ(rte_fib_tailq) > #define FIB_RETURN_IF_TRUE(cond, retval) > #endif > > +/* Prefix used for the memory objects owned by a FIB. */ > +#define FIB_MEM_PREFIX "FIB_" > + > struct rte_fib { > char name[RTE_FIB_NAMESIZE]; > enum rte_fib_type type; /**< Type of FIB struct */ > @@ -173,14 +176,21 @@ rte_fib_create(const char *name, int socket_id, struct rte_fib_conf *conf) > rib_conf.ext_sz = conf->rib_ext_sz; > rib_conf.max_nodes = conf->max_routes * 2; > > - rib = rte_rib_create(name, socket_id, &rib_conf); > + /* Add FIB Prefix to its mempool name */ > + ret = snprintf(mem_name, sizeof(mem_name), FIB_MEM_PREFIX "%s", name); > + if (ret < 0 || ret >= (int)sizeof(mem_name)) { > + FIB_LOG(ERR, "FIB name %s is too long", name); > + rte_errno = ENAMETOOLONG; > + return NULL; > + } > + > + rib = rte_rib_create(mem_name, socket_id, &rib_conf); > if (rib == NULL) { > FIB_LOG(ERR, > - "Can not allocate RIB %s", name); > + "Can not allocate RIB for FIB: %s", mem_name); > return NULL; > } > > - snprintf(mem_name, sizeof(mem_name), "FIB_%s", name); > fib_list = RTE_TAILQ_CAST(rte_fib_tailq.head, rte_fib_list); > > rte_mcfg_tailq_write_lock(); > diff --git a/lib/fib/rte_fib6.c b/lib/fib/rte_fib6.c > index 770becdb61..1a31ab09aa 100644 > --- a/lib/fib/rte_fib6.c > +++ b/lib/fib/rte_fib6.c > @@ -37,6 +37,9 @@ EAL_REGISTER_TAILQ(rte_fib6_tailq) > #define FIB6_RETURN_IF_TRUE(cond, retval) > #endif > > +/* Prefix used for the memory objects owned by a FIB6. */ > +#define FIB6_MEM_PREFIX "FIB6_" > + > struct rte_fib6 { > char name[RTE_FIB6_NAMESIZE]; > enum rte_fib6_type type; /**< Type of FIB struct */ > @@ -172,14 +175,21 @@ rte_fib6_create(const char *name, int socket_id, struct rte_fib6_conf *conf) > rib_conf.ext_sz = conf->rib_ext_sz; > rib_conf.max_nodes = conf->max_routes * 2; > > - rib = rte_rib6_create(name, socket_id, &rib_conf); > + /* Add FIB6 Prefix to its mempool name */ > + ret = snprintf(mem_name, sizeof(mem_name), FIB6_MEM_PREFIX "%s", name); > + if (ret < 0 || ret >= (int)sizeof(mem_name)) { > + FIB_LOG(ERR, "FIB6 name %s is too long", name); > + rte_errno = ENAMETOOLONG; > + return NULL; > + } > + > + rib = rte_rib6_create(mem_name, socket_id, &rib_conf); > if (rib == NULL) { > FIB_LOG(ERR, > - "Can not allocate RIB %s", name); > + "Can not allocate RIB6 for FIB6 %s", mem_name); > return NULL; > } > > - snprintf(mem_name, sizeof(mem_name), "FIB6_%s", name); > fib_list = RTE_TAILQ_CAST(rte_fib6_tailq.head, rte_fib6_list); > > rte_mcfg_tailq_write_lock(); > diff --git a/lib/rib/rte_rib.c b/lib/rib/rte_rib.c > index 046db131ca..55802f0060 100644 > --- a/lib/rib/rte_rib.c > +++ b/lib/rib/rte_rib.c > @@ -32,6 +32,8 @@ EAL_REGISTER_TAILQ(rte_rib_tailq) > #define RIB_MAXDEPTH 32 > /* Maximum length of a RIB name. */ > #define RTE_RIB_NAMESIZE 64 > +/* Prefix used for the memory objects owned by a RIB. */ > +#define RIB_MEM_PREFIX "RIB_" > > struct rte_rib_node { > struct rte_rib_node *left; > @@ -417,6 +419,7 @@ rte_rib_create(const char *name, int socket_id, const struct rte_rib_conf *conf) > struct rte_tailq_entry *te; > struct rte_rib_list *rib_list; > struct rte_mempool *node_pool; > + int ret; > > /* Check user arguments. */ > if (unlikely(name == NULL || conf == NULL || conf->max_nodes <= 0)) { > @@ -424,7 +427,15 @@ rte_rib_create(const char *name, int socket_id, const struct rte_rib_conf *conf) > return NULL; > } > > - snprintf(mem_name, sizeof(mem_name), "MP_%s", name); > + /* Add RIB Prefix to its node mempool name */ > + ret = snprintf(mem_name, sizeof(mem_name), RIB_MEM_PREFIX "%s", name); > + if (unlikely(ret < 0 || ret >= (int)RTE_MEMPOOL_NAMESIZE)) { > + RIB_LOG(ERR, "RIB name %s is too long, limit is %zu characters", > + name, RTE_MEMPOOL_NAMESIZE - sizeof(RIB_MEM_PREFIX)); > + rte_errno = ENAMETOOLONG; > + return NULL; > + } > + > node_pool = rte_mempool_create(mem_name, conf->max_nodes, > sizeof(struct rte_rib_node) + conf->ext_sz, 0, 0, > NULL, NULL, NULL, NULL, socket_id, 0); > @@ -435,7 +446,6 @@ rte_rib_create(const char *name, int socket_id, const struct rte_rib_conf *conf) > return NULL; > } > > - snprintf(mem_name, sizeof(mem_name), "RIB_%s", name); > rib_list = RTE_TAILQ_CAST(rte_rib_tailq.head, rte_rib_list); > > rte_mcfg_tailq_write_lock(); > diff --git a/lib/rib/rte_rib6.c b/lib/rib/rte_rib6.c > index 918ddbdfd3..7d9a0ba36f 100644 > --- a/lib/rib/rte_rib6.c > +++ b/lib/rib/rte_rib6.c > @@ -24,6 +24,8 @@ > #define RTE_RIB_VALID_NODE 1 > /* Maximum length of a RIB6 name. */ > #define RTE_RIB6_NAMESIZE 64 > +/* Prefix used for the memory objects owned by a RIB6. */ > +#define RIB6_MEM_PREFIX "RIB6_" > > TAILQ_HEAD(rte_rib6_list, rte_tailq_entry); > static struct rte_tailq_elem rte_rib6_tailq = { > @@ -480,6 +482,7 @@ rte_rib6_create(const char *name, int socket_id, > struct rte_tailq_entry *te; > struct rte_rib6_list *rib6_list; > struct rte_mempool *node_pool; > + int ret; > > /* Check user arguments. */ > if (unlikely(name == NULL || conf == NULL || conf->max_nodes <= 0)) { > @@ -487,7 +490,15 @@ rte_rib6_create(const char *name, int socket_id, > return NULL; > } > > - snprintf(mem_name, sizeof(mem_name), "MP_%s", name); > + /* Add RIB6 Prefix to its node mempool name */ > + ret = snprintf(mem_name, sizeof(mem_name), RIB6_MEM_PREFIX "%s", name); > + if (unlikely(ret < 0 || ret >= (int)RTE_MEMPOOL_NAMESIZE)) { > + RIB_LOG(ERR, "RIB6 name %s is too long, limit is %zu characters", > + name, RTE_MEMPOOL_NAMESIZE - sizeof(RIB6_MEM_PREFIX)); > + rte_errno = ENAMETOOLONG; > + return NULL; > + } > + > node_pool = rte_mempool_create(mem_name, conf->max_nodes, > sizeof(struct rte_rib6_node) + conf->ext_sz, 0, 0, > NULL, NULL, NULL, NULL, socket_id, 0); > @@ -498,7 +509,6 @@ rte_rib6_create(const char *name, int socket_id, > return NULL; > } > > - snprintf(mem_name, sizeof(mem_name), "RIB6_%s", name); > rib6_list = RTE_TAILQ_CAST(rte_rib6_tailq.head, rte_rib6_list); > > rte_mcfg_tailq_write_lock(); -- Regards, Vladimir ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2026-09-22 19:46 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 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 ` [PATCH v2 2/3] eal: increase memzone name size to 64 Stephen Hemminger 2026-09-22 15:52 ` [PATCH v2 3/3] fib, rib: fix name prefixes Stephen Hemminger 2026-09-22 19:46 ` Medvedkin, Vladimir
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox