From: Stephen Hemminger <stephen@networkplumber.org>
To: Anurag Mandal <anurag.mandal@intel.com>
Cc: dev@dpdk.org, mb@smartsharesystems.com, vladimir.medvedkin@intel.com
Subject: Re: [PATCH v2] fib, rib: fix name prefixes
Date: Mon, 21 Sep 2026 14:59:27 -0700 [thread overview]
Message-ID: <20260921145927.7e3a1331@phoenix.local> (raw)
In-Reply-To: <20260813074626.1134195-1-anurag.mandal@intel.com>
On Thu, 13 Aug 2026 07:46:26 +0000
Anurag Mandal <anurag.mandal@intel.com> wrote:
> 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 makes name 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 much
> 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 new
> maximum length of a name is limited to the following:
> RIB : 21 characters
> RIB6: 20 characters
> FIB : 17 characters
> FIB6: 15 characters
> Hence, shortening the names used by the graph nodes, the l3fwd
> example and the unit tests accordingly.
>
> 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>
> ---
This looks good, but would also like to bump up memzone size as well.
AI review:
Review: [PATCH v2] fib, rib: fix name prefixes
Applied to main (6bbb7b3) with the release notes hunk excluded; that
hunk does not apply and needs a rebase. Builds with -Dwerror=true.
rib, rib6, fib and fib6 autotests pass. Name length limits verified
with a probe program against the built libraries.
Warning
1. Fixes tags on a change that shrinks the accepted name length.
RTE_MEMPOOL_NAMESIZE is 26, so a mempool name is at most 25
characters. Before this patch the RIB mempool was "MP_<name>" and
FIB passed its name through unchanged, so RIB, RIB6, FIB and FIB6
all accepted names up to 22 characters. After this patch:
RIB 22 -> 21
RIB6 22 -> 20
FIB 22 -> 17
FIB6 22 -> 15
An application using a 16..22 character FIB6 name works on 25.11
and fails with ENAMETOOLONG after this patch. With Fixes tags the
stable maintainers will consider it for backport, which would be a
regression in an LTS.
The "MP_MP_" memzone name is cosmetic. Split into two patches:
the up-front length check with the Fixes tags (backportable, no
limit change), and the prefix rename without Fixes for 26.11 only.
2. FIB length check does not enforce the FIB limit.
rte_fib_create() and rte_fib6_create() check the prefixed name
against sizeof(mem_name), which is RTE_FIB_NAMESIZE (64). The real
limit is enforced one level down in rte_rib_create(), so an
18 character FIB name produces:
RIB: RIB name FIB_aaaaaaaaaaaaaaaaaa is too long, limit is 21
FIB: Can not allocate RIB for FIB: FIB_aaaaaaaaaaaaaaaaaa
The user never passed "FIB_..." and the stated limit is wrong for
the FIB caller (21 vs 17; 20 vs 15 for FIB6). Check against the
derived limit in FIB itself, and put the maximum name lengths in
the public headers so applications can size names without reading
release notes.
3. No test for the new ENAMETOOLONG path.
The tests were only shortened to fit. Add cases to test_rib,
test_rib6, test_fib and test_fib6 that create a name at the limit
(expect success) and at limit + 1 (expect NULL with
rte_errno == ENAMETOOLONG).
Info
4. Release notes: "name,the" is missing a space; "maximum length of
a name are" should be "is". The four limit lines are not a list in
RST and render as one run-on paragraph; use a nested bullet list.
5. "Bugzilla ID: 1981 1982" should be one tag per line.
6. The comment "Add FIB Prefix to its mempool name" in rte_fib.c and
rte_fib6.c is inaccurate; the prefixed string is the RIB name.
prev parent reply other threads:[~2026-09-21 21:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-12 11:02 [PATCH] lib: fix mempool name prefixes Anurag Mandal
2026-08-12 11:33 ` Morten Brørup
2026-08-12 11:43 ` Morten Brørup
2026-08-13 7:46 ` [PATCH v2] fib, rib: fix " Anurag Mandal
2026-09-21 21:59 ` Stephen Hemminger [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=20260921145927.7e3a1331@phoenix.local \
--to=stephen@networkplumber.org \
--cc=anurag.mandal@intel.com \
--cc=dev@dpdk.org \
--cc=mb@smartsharesystems.com \
--cc=vladimir.medvedkin@intel.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