From: Maxime Leroy <maxime@leroys.fr>
To: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Cc: dev@dpdk.org, Maxime Leroy <maxime@leroys.fr>
Subject: [RFC 0/3] fib: tbl8 reservation drift reproducer and proposed fix
Date: Thu, 7 May 2026 11:50:40 +0200 [thread overview]
Message-ID: <cover.1778146229.git.maxime@leroys.fr> (raw)
Asymmetric ADD/DEL sequences in FIB6 trie (a covering parent
removed between the ADD and DEL of a longer prefix) eventually
make ADD fail with -ENOSPC even when the tbl8 pool is empty.
Patch 2/3 is a small reproducer.
Root cause: rsvd_tbl8s is updated by depth_diff recomputed from
the current RIB, so increments at ADD and decrements at DEL do
not cancel when the RIB state changes in between. The counter
drifts and wraps to UINT32_MAX.
The simplest fix I could find (1/3, 3/3) is to drop rsvd_tbl8s
and use the pool counters already maintained by alloc/free:
tbl8_pool_pos in trie, cur_tbl8s in dir24_8. The DQ reclaim
inside tbl8_alloc() is moved into the pre-check.
I am not sure I understood the original intent of keeping
rsvd_tbl8s separate from the pool counters. In dir24_8 the two
mirror each other 1:1 and rsvd_tbl8s looks redundant; in trie,
depth_diff gives it a worst-case-reservation flavor but the
recomputation from the RIB is exactly what makes it drift. If
there was a deliberate reason, please point it out.
Patch 3/3 is a no-op cleanup that aligns dir24_8 with the trie
pattern.
Maxime Leroy (3):
fib6: fix tbl8 reservation drift in trie
test/fib6: add reproducer for tbl8 reservation drift
fib: drop redundant tbl8 reservation counter
app/test/test_fib6.c | 83 ++++++++++++++++++++++++++++++++++++++++++++
lib/fib/dir24_8.c | 31 ++++++-----------
lib/fib/dir24_8.h | 1 -
lib/fib/trie.c | 23 ++++++------
lib/fib/trie.h | 3 +-
5 files changed, 104 insertions(+), 37 deletions(-)
--
2.43.0
next reply other threads:[~2026-05-07 9:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-07 9:50 Maxime Leroy [this message]
2026-05-07 9:50 ` [RFC 1/3] fib6: fix tbl8 reservation drift in trie Maxime Leroy
2026-05-07 9:50 ` [RFC 2/3] test/fib6: add reproducer for tbl8 reservation drift Maxime Leroy
2026-05-07 9:50 ` [RFC 3/3] fib: drop redundant tbl8 reservation counter Maxime Leroy
2026-05-07 19:02 ` [RFC 0/3] fib: tbl8 reservation drift reproducer and proposed fix Stephen Hemminger
2026-05-11 7:29 ` Maxime Leroy
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=cover.1778146229.git.maxime@leroys.fr \
--to=maxime@leroys.fr \
--cc=dev@dpdk.org \
--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