[RFC v2 00/13] fib: shared and resizable tbl8 pool
Maxime Leroy
maxime at leroys.fr
Tue Nov 24 19:02:36 CET 2026
This RFC proposes an optional tbl8 pool shared by several FIBs, for
applications that keep one FIB per VRF.
num_tbl8 is hard to size: only routes longer than /24 use tbl8 groups,
nested routes share them, and the need changes with the routes learned
at runtime. With one FIB per VRF, each FIB has to be sized for its
worst case. A shared pool lets the FIBs draw from the same groups, and
a resizable pool removes the need to guess the peak.
v1: https://mails.dpdk.org/archives/dev/2026-March/335512.html
Changes since v1:
- Rebased on 26.11-rc4, on top of the trie fixes for bug 1970
(reservation with the RCU defer queue, no temporary tbl8).
- The pool never grows while an update holds a pointer into the tbl8
array: this fixes the use-after-free reported on v1.
- The tbl8 reservation is counted in the pool: the groups reserved by
the routes of one FIB can not be taken by another one, and freeing a
FIB returns its groups and its reservation to the pool.
- When the pool runs out of groups, the RCU defer queues of all its
FIBs are reclaimed.
- dir24_8 uses a stack of free groups in its own patch; num_tbl8 is no
longer rounded up to a multiple of 64.
- The pool is documented in the guide and the API index, and covered
by tests for growth and sharing.
- Callers filling rte_fib_conf or rte_fib6_conf field by field now
zero-initialize it.
The first patches (zero initialization of the configs, dir24_8 stack
conversion, shared tbl8 definitions) do not depend on the pool and can
be applied on their own.
Patches 2-3 (zero initialization of the FIB configs in app/graph and
node) are the same in the RFC for a lookup across a group of FIBs. The
two series touch the same place of dir24_8.c, so the second one
applied needs a rebase.
Open questions:
- ABI: the tbl8_pool field extends struct rte_fib_conf (40 to 48
bytes, flags moves) and struct rte_fib6_conf (32 to 40 bytes), so the
ABI check of the CI will fail. Keep the field for 27.11, or attach a
pool to a FIB with a new experimental call?
- Public API: v1 review suggested keeping the pool internal to the
library. An application with one FIB per VRF then has no way to
share tbl8 groups between its FIBs, which is the use case of this
series.
- With a shared pool in defer queue mode, rte_fib_free() and
rte_fib6_free() wait for the readers, so that the groups waiting in
the queue of the FIB return to the pool.
- Already in main: a group freed while the RCU defer queue is full is
lost ("Failed to push QSBR FIFO"). With a shared pool it is lost for
all its FIBs.
A bulk lookup across a group of FIBs, for bursts mixing VRFs, is
proposed in a separate RFC.
Maxime Leroy (13):
test/fib6: zero-initialize config struct
app/graph: zero-initialize FIB config structs
node: zero-initialize FIB config structs
examples/l3fwd: zero-initialize FIB6 config struct
fib: use a stack of free tbl8 groups for IPv4
fib: share tbl8 definitions between fib and fib6
fib: add shared tbl8 pool
fib: add resizable tbl8 pool
fib: add tbl8 pool stats API
test/fib: cover tbl8 pool growth
test/fib6: cover tbl8 pool growth
test/fib: cover tbl8 pool sharing
test/fib6: cover tbl8 pool sharing
app/graph/l3fwd.c | 4 +-
app/test/test_fib.c | 348 ++++++++++++++++++++++++++++
app/test/test_fib6.c | 277 ++++++++++++++++++++++-
app/test/test_fib6_perf.c | 2 +-
doc/api/doxy-api-index.md | 3 +-
doc/guides/prog_guide/fib_lib.rst | 40 ++++
examples/l3fwd/l3fwd_fib.c | 2 +-
lib/fib/dir24_8.c | 272 ++++++++++------------
lib/fib/dir24_8.h | 18 +-
lib/fib/fib_tbl8.h | 50 ++++
lib/fib/fib_tbl8_pool.c | 365 ++++++++++++++++++++++++++++++
lib/fib/fib_tbl8_pool.h | 135 +++++++++++
lib/fib/meson.build | 5 +-
lib/fib/rte_fib.h | 3 +
lib/fib/rte_fib6.h | 3 +
lib/fib/rte_fib_tbl8_pool.h | 159 +++++++++++++
lib/fib/trie.c | 291 +++++++++++-------------
lib/fib/trie.h | 16 +-
lib/node/ip4_lookup_fib.c | 2 +-
lib/node/ip6_lookup_fib.c | 2 +-
20 files changed, 1647 insertions(+), 350 deletions(-)
create mode 100644 lib/fib/fib_tbl8.h
create mode 100644 lib/fib/fib_tbl8_pool.c
create mode 100644 lib/fib/fib_tbl8_pool.h
create mode 100644 lib/fib/rte_fib_tbl8_pool.h
--
2.43.0
More information about the dev
mailing list