Date: Wed, 15 Sep 2021 20:50:10 GMT From: Marko Zec <zec@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: b51f8bae570b - main - [fib algo][dxr] Optimize trie updating. Message-ID: <202109152050.18FKoAb5062368@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by zec: URL: https://cgit.FreeBSD.org/src/commit/?id=b51f8bae570b4e908191a1dae9da38aacf8c0fab commit b51f8bae570b4e908191a1dae9da38aacf8c0fab Author: Marko Zec <zec@FreeBSD.org> AuthorDate: 2021-09-15 20:36:59 +0000 Commit: Marko Zec <zec@FreeBSD.org> 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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202109152050.18FKoAb5062368>