[fib algo][dxr] Optimize trie updating.

Don't rebuild in vain trie parts unaffected by accumulated incremental
RIB updates.

PR:		257965
Tested by:	Konrad Kreciwilk
MFC after:	3 days
This commit is contained in:
Marko Zec 2021-09-15 22:36:59 +02:00
parent 442c8a245e
commit b51f8bae57

View File

@ -915,7 +915,14 @@ dxr_build(struct dxr *dxr)
for (i = da->updates_low >> dxr_x; i <= da->updates_high >> dxr_x;
i++) {
trie_unref(da, i);
if (!trie_rebuild) {
m = 0;
for (int j = 0; j < (1 << dxr_x); j += 32)
m |= da->updates_mask[((i << dxr_x) + j) >> 5];
if (m == 0)
continue;
trie_unref(da, i);
}
ti = trie_ref(da, i);
if (ti < 0)
return;