dpdk: add patch removing redundant rsvd_tbl8s counter#620
Conversation
Bring in a local DPDK patch that fixes a latent bug in the IPv6 FIB TRIE algorithm where rsvd_tbl8s drifts past zero on certain ADD/DEL patterns and wraps to UINT32_MAX, causing every subsequent long-prefix add to fail with -ENOSPC even though tbl8_pool_pos is far below number_tbl8s. The bug surfaces when a covering parent prefix is deleted before its children: depth_diff at DEL time is computed against a different RIB state than at ADD time and the cumulative reservation accounting diverges. Replacing rsvd_tbl8s with the actual pool occupancy counter (tbl8_pool_pos for trie, cur_tbl8s for dir24_8) eliminates the asymmetry. The pre-allocation refusal semantics are preserved. The patch is intended to be submitted upstream to dpdk-dev; it is carried locally until accepted so grout users get a working FIB6 under SRv6 churn. Signed-off-by: Maxime Leroy <maxime@leroys.fr>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR updates DPDK patch files to remove the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Bring in a local DPDK patch that fixes a latent bug in the IPv6 FIB TRIE algorithm where rsvd_tbl8s drifts past zero on certain ADD/DEL patterns and wraps to UINT32_MAX, causing every subsequent long-prefix add to fail with -ENOSPC even though tbl8_pool_pos is far below number_tbl8s.
The bug surfaces when a covering parent prefix is deleted before its children: depth_diff at DEL time is computed against a different RIB state than at ADD time and the cumulative reservation accounting diverges. Replacing rsvd_tbl8s with the actual pool occupancy counter (tbl8_pool_pos for trie, cur_tbl8s for dir24_8) eliminates the asymmetry. The pre-allocation refusal semantics are preserved.
The patch is intended to be submitted upstream to dpdk-dev; it is carried locally until accepted so grout users get a working FIB6 under SRv6 churn.
Summary
Introduces a DPDK patch addressing an underflow bug in IPv6 FIB trie's pre-allocation reservation counter.
Problem
The
rsvd_tbl8scounter instruct rte_trie_tbl(IPv6) drifts and underflows toUINT32_MAXwhen a covering parent prefix is deleted before its children. The counter is updated bydepth_diffcomputed at each ADD/DEL from current RIB state viarte_rib6_get_nxt()andrte_rib6_lookup_parent(). Since the RIB is not invariant between ADD and later DEL,depth_diffat DEL time need not equal the value at ADD time. Example asymmetry:/28:depth_diff=1,rsvd_tbl8s += 1/48(child of/28):depth_diff=2,rsvd_tbl8s += 2/28(children alive): sibling found,depth_diff=0,rsvd_tbl8s -= 0/48:depth_diff=3,rsvd_tbl8s -= 3rsvd_tbl8sdecreased by 1 per cycleOver repeated cycles, the counter wraps to
UINT32_MAX-N, causing the pre-check to unconditionally reject ADD operations for long prefixes even when actual pool occupancy (tbl8_pool_pos) is far belownumber_tbl8s. Observed in production with BGP SRv6 churn under FRR/zebra restart cycles, where parent locators (/40, /48) are deleted before child SIDs (/64, /128). After ~174 asymmetric cycles,rsvd_tbl8swrapped to 4294967122 withtbl8_pool_posat 39 of 262144.Solution
Replace
rsvd_tbl8swith actual pool occupancy counters:trie_modify()now comparesdp->tbl8_pool_pos + depth_diffagainstdp->number_tbl8s. Thetbl8_pool_poscounter is maintained natively bytbl8_get()andtbl8_put()and is always accurate by construction.dir24_8_modify()now comparesdp->cur_tbl8sagainstdp->number_tbl8s. Thecur_tbl8scounter was added by commit 96c3d06a3578 and already tracks occupancy intbl8_alloc()andtbl8_cleanup_and_free(), makingrsvd_tbl8sredundant. The dir24_8 increment is symmetric (binary, 0 or 1 based on whether a /25-/32 sibling exists) and exhibits no underflow bug.Changes
dpdk/fib6-remove-redundant-rsvd_tbl8s-counter.patchtodiff_fileslist.uint32_t rsvd_tbl8sfield fromstruct rte_trie_tblandstruct dir24_8_tbl, removes all increment/decrement code paths for the counter, and simplifiesgoto-based early-success paths to directreturn 0.