HomeFreeBSD

[fib algo] Delay algo init at fib growth to to allow to reliably use rib KPI.

Description

[fib algo] Delay algo init at fib growth to to allow to reliably use rib KPI.

Currently, most of the rib(9) KPI does not use rnh pointers, using
fibnum and family parameters to determine the rib pointer instead.
This works well except for the case when we initialize new rib pointers
during fib growth.
In that case, there is no mapping between fib/family and the new rib,
as an entirely new rib pointer array is populated.

Address this by delaying fib algo initialization till after switching
to the new pointer array and updating the number of fibs.
Set datapath pointer to the dummy function, so the potential callers
won't crash the kernel in the brief moment when the rib exists, but
no fib algo is attached.

This change allows to avoid creating duplicates of existing rib functions,
with altered signature.

Differential Revision: https://reviews.freebsd.org/D29969
MFC after: 1 week

Details

Provenance
melifaroAuthored on Apr 25 2021, 10:22 AM
Differential Revision
D29969: [fib algo] Delay algo init during fib growth phase to allow to reliably use rib KPI
Parents
rG6e1abda231bf: riscv: Remove old qemu compatibility code
Branches
Unknown
Tags
Unknown