On Tue, 24 Feb 2026 14:33:41 +0100 Robin Jarry <[email protected]> wrote:
> Both dir24_8 (IPv4) and trie (IPv6) algorithms already track tbl8 group > allocation internally but there is no way for applications to query this > information. Monitoring tbl8 usage is important to detect exhaustion > before route insertions start failing. > > Add rte_fib_tbl8_get_stats() and rte_fib6_tbl8_get_stats() to let > applications retrieve the number of tbl8 groups currently in use and the > total capacity. For dir24_8, the used count comes from cur_tbl8s. For > trie, it comes from tbl8_pool_pos which reflects the actual number of > allocated entries since the pool is a stack. > > Add unit tests for both functions covering invalid arguments, unsupported > FIB types and verifying that the used count changes correctly after route > insertions and deletions. > > Signed-off-by: Robin Jarry <[email protected]> Exposing fib usage statistics is good idea but rather than returning statistics individually as call pointers, it would be better to have new statistics structure similar to ethdev xstats with name and value. That would allow for expansion and be generic against table implementations.

