The branch main has been updated by zec:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=b51f8bae570b4e908191a1dae9da38aacf8c0fab

commit b51f8bae570b4e908191a1dae9da38aacf8c0fab
Author:     Marko Zec <[email protected]>
AuthorDate: 2021-09-15 20:36:59 +0000
Commit:     Marko Zec <[email protected]>
CommitDate: 2021-09-15 20:42:49 +0000

    [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
---
 sys/netinet/in_fib_dxr.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

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;
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to