Page MenuHomeFreeBSD

[fib algo] Delay algo init during fib growth phase to allow to reliably use rib KPI
ClosedPublic

Authored by melifaro on Apr 25 2021, 10:30 AM.

Details

Summary

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 afters 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 duplicating existing functions with an altered signature.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

melifaro added a reviewer: network.
melifaro retitled this revision from Delay algo init. to [fib algo] Delay algo init during fib growth phase to allow rt_tables_get_rnh_ptr() to always work..
melifaro retitled this revision from [fib algo] Delay algo init during fib growth phase to allow rt_tables_get_rnh_ptr() to always work. to [fib algo] Delay algo init during fib growth phase to allow to reliably use rib KPI.Apr 25 2021, 11:17 AM
This revision was not accepted when it landed; it landed in state Needs Review.Apr 27 2021, 10:11 PM
This revision was automatically updated to reflect the committed changes.