]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
fib_algo: shift / mask by constants in dxr_lookup()
authorMarko Zec <zec@FreeBSD.org>
Sun, 16 Jan 2022 23:13:47 +0000 (00:13 +0100)
committerMarko Zec <zec@FreeBSD.org>
Sun, 6 Feb 2022 07:33:17 +0000 (08:33 +0100)
commitd055313f8c60ae57ff0422911f1b99e82ef0497c
treebcdd03ecc769e3a60f8b4feedb9e02f92dfc431d
parent62a323ecbcdc14e12d9403ee1dac5ddd9ad857af
fib_algo: shift / mask by constants in dxr_lookup()

Since trie configuration remains invariant during each DXR instance
lifetime, instead of shifting and masking lookup keys by values
computed at runtime, compile upfront several dxr_lookup()
configurations with hardcoded shift / mask constants, and choose the
apropriate lookup function version after each DXR instance rebuild.

In synthetic tests this yields small but measurable (5-10%) lookup
throughput improvement, depending on FIB size and  prefix patterns.

MFC after: 3 days

(cherry picked from commit e7abe200c27b5723d315258ca658760fa84c7cf1)
sys/netinet/in_fib_dxr.c