aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet
diff options
context:
space:
mode:
authorMarko Zec <zec@FreeBSD.org>2021-09-15 20:36:59 +0000
committerMarko Zec <zec@FreeBSD.org>2021-09-15 20:42:49 +0000
commitb51f8bae570b4e908191a1dae9da38aacf8c0fab (patch)
tree7831b39d36117e0263b029c5057c6c0ba18049da /sys/netinet
parent442c8a245ee3c6640fc9321e18e8316edf469805 (diff)
downloadsrc-b51f8bae570b4e908191a1dae9da38aacf8c0fab.tar.gz
src-b51f8bae570b4e908191a1dae9da38aacf8c0fab.zip
[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
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/in_fib_dxr.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/netinet/in_fib_dxr.c b/sys/netinet/in_fib_dxr.c
index 7afe2a3da024..3c4e5700cd6c 100644
--- a/sys/netinet/in_fib_dxr.c
+++ b/sys/netinet/in_fib_dxr.c
@@ -915,7 +915,14 @@ dxr2_try_squeeze:
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;