HomeFreeBSD

fib_algo: shift / mask by constants in dxr_lookup()

Description

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)

Details

Provenance
zecAuthored on Jan 16 2022, 11:13 PM
Parents
rG62a323ecbcdc: dma: limit lines to 998 characters
Branches
Unknown
Tags
Unknown