HomeFreeBSD

Fix rib generation count for fib algo.

Description

Fix rib generation count for fib algo.

Currently, PCB caching mechanism relies on the rib generation
counter (rnh_gen) to invalidate cached nhops/LLE entries.

With certain fib algorithms, it is now possible that the
datapath lookup state applies RIB changes with some delay.
In that scenario, PCB cache will invalidate on the RIB change,
but the new lookup may result in the same nexthop being returned.
When fib algo finally gets in sync with the RIB changes, PCB cache
will not receive any notification and will end up caching the stale data.

To fix this, introduce additional counter, rnh_gen_rib, which is used
only when FIB_ALGO is enabled.
This counter is incremented by the control plane. Each time when fib algo
synchronises with the RIB, it updates rnh_gen to the current rnh_gen_rib value.

Differential Revision: https://reviews.freebsd.org/D29812
Reviewed by: donner
MFC after: 2 weeks

(cherry picked from commit 33cb3cb2e3212705b10e7885b37f70a3c2987c9e)

Details

Provenance
melifaroAuthored on Apr 17 2021, 6:58 PM
Reviewer
donner
Differential Revision
D29812: Fix rib generation count for fib algo.
Parents
rG6fa0160556e3: Add batched update support for the fib algo.
Branches
Unknown
Tags
Unknown