Skip to content

RFC fib: tbl8 reservation drift reproducer and proposed fix

Maxime Leroy dpdk-dev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest3 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3fib6: fix tbl8 reservation drift in trielib/fib/trie.c lib/fib/trie.h+11 -150 replies
2/3test/fib6: add reproducer for tbl8 reservation driftapp/test/test_fib6.c+83 -00 replies
3/3fib: drop redundant tbl8 reservation counterlib/fib/dir24_8.c lib/fib/dir24_8.h+10 -220 replies

Reviews trailers per patch

None of the 3 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchVladimir Medvedkin
SeriesA-b
1/3
2/3
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [RFC 0/3] fib: tbl8 reservation drift reproducer and proposed fix

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(-)
Signature · 1 line
2.43.0