]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Fix rib generation count for fib algo.
authorAlexander V. Chernikov <melifaro@FreeBSD.org>
Sat, 17 Apr 2021 18:58:12 +0000 (18:58 +0000)
committerAlexander V. Chernikov <melifaro@FreeBSD.org>
Tue, 20 Apr 2021 22:02:41 +0000 (22:02 +0000)
commit33cb3cb2e3212705b10e7885b37f70a3c2987c9e
treea3eb0cb07864517e3d560daefd33b928c41abfdb
parent8ef97d2ba339f84d96b0c68235da92903fbf54ce
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
sys/net/route/fib_algo.c
sys/net/route/route_ctl.c
sys/net/route/route_var.h