freebsd-skq/sys/net
Alexander V. Chernikov f5baf8bb12 Add modular fib lookup framework.
This change introduces framework that allows to dynamically
 attach or detach longest prefix match (lpm) lookup algorithms
 to speed up datapath route tables lookups.

Framework takes care of handling initial synchronisation,
 route subscription, nhop/nhop groups reference and indexing,
 dataplane attachments and fib instance algorithm setup/teardown.
Framework features automatic algorithm selection, allowing for
 picking the best matching algorithm on-the-fly based on the
 amount of routes in the routing table.

Currently framework code is guarded under FIB_ALGO config option.
An idea is to enable it by default in the next couple of weeks.

The following algorithms are provided by default:
IPv4:
* bsearch4 (lockless binary search in a special IP array), tailored for
  small-fib (<16 routes)
* radix4_lockless (lockless immutable radix, re-created on every rtable change),
  tailored for small-fib (<1000 routes)
* radix4 (base system radix backend)
* dpdk_lpm4 (DPDK DIR24-8-based lookups), lockless datastrucure, optimized
  for large-fib (D27412)
IPv6:
* radix6_lockless (lockless immutable radix, re-created on every rtable change),
  tailed for small-fib (<1000 routes)
* radix6 (base system radix backend)
* dpdk_lpm6 (DPDK DIR24-8-based lookups), lockless datastrucure, optimized
  for large-fib (D27412)

Performance changes:
Micro benchmarks (I7-7660U, single-core lookups, 2048k dst, code in D27604):
IPv4:
8 routes:
  radix4: ~20mpps
  radix4_lockless: ~24.8mpps
  bsearch4: ~69mpps
  dpdk_lpm4: ~67 mpps
700k routes:
  radix4_lockless: 3.3mpps
  dpdk_lpm4: 46mpps

IPv6:
8 routes:
  radix6_lockless: ~20mpps
  dpdk_lpm6: ~70mpps
100k routes:
  radix6_lockless: 13.9mpps
  dpdk_lpm6: 57mpps

Forwarding benchmarks:
+ 10-15% IPv4 forwarding performance (small-fib, bsearch4)
+ 25% IPv4 forwarding performance (full-view, dpdk_lpm4)
+ 20% IPv6 forwarding performance (full-view, dpdk_lpm6)

Control:
Framwork adds the following runtime sysctls:

List algos
* net.route.algo.inet.algo_list: bsearch4, radix4_lockless, radix4
* net.route.algo.inet6.algo_list: radix6_lockless, radix6, dpdk_lpm6
Debug level (7=LOG_DEBUG, per-route)
net.route.algo.debug_level: 5
Algo selection (currently only for fib 0):
net.route.algo.inet.algo: bsearch4
net.route.algo.inet6.algo: radix6_lockless

Support for manually changing algos in non-default fib will be added
soon. Some sysctl names will be changed in the near future.

Differential Revision: https://reviews.freebsd.org/D27401
2020-12-25 11:33:17 +00:00
..
altq net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
route Add modular fib lookup framework. 2020-12-25 11:33:17 +00:00
bpf_buffer.c
bpf_buffer.h
bpf_filter.c
bpf_jitter.c Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many) 2020-02-26 14:26:36 +00:00
bpf_jitter.h
bpf_zerocopy.c
bpf_zerocopy.h
bpf.c net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
bpf.h
bpfdesc.h
bridgestp.c net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
bridgestp.h net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
debugnet_inet.c net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
debugnet_int.h Implement NetGDB(4) 2019-10-17 21:33:01 +00:00
debugnet.c Convert debugnet to the new routing KPI. 2020-04-26 18:42:38 +00:00
debugnet.h Implement NetGDB(4) 2019-10-17 21:33:01 +00:00
dlt.h MFV r353141 (by phillip): 2019-12-21 21:01:03 +00:00
ethernet.h net: add ETHER_IS_IPV6_MULTICAST 2020-10-30 13:32:58 +00:00
firewire.h
ieee8023ad_lacp.c LACP: When suppressing distributing, return ENOBUFS 2020-11-18 14:55:49 +00:00
ieee8023ad_lacp.h LACP: When suppressing distributing, return ENOBUFS 2020-11-18 14:55:49 +00:00
ieee_oui.h
if_arp.h
if_bridge.c bridge: call member interface ioctl() without NET_EPOCH 2020-10-06 19:19:56 +00:00
if_bridgevar.h libifconfig: Add function to get bridge status 2020-07-01 02:32:41 +00:00
if_clone.c Add support for stacked VLANs (IEEE 802.1ad, AKA Q-in-Q). 2020-10-21 21:28:20 +00:00
if_clone.h epair: Do not abuse params to register the second interface 2020-01-28 22:44:24 +00:00
if_dead.c
if_debug.c
if_disc.c
if_dl.h net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
if_edsc.c if_edsc: generate an arbitrary MAC address 2020-03-02 02:45:57 +00:00
if_enc.c Consistently include opt_ipsec.h for consumers of <netipsec/ipsec.h>. 2020-05-29 19:22:40 +00:00
if_enc.h
if_epair.c net: Revert vnet/epair cleanup race mitigation 2020-12-01 16:34:43 +00:00
if_ethersubr.c Remove not needed variable initialization. 2020-12-23 12:04:46 +01:00
if_fwsubr.c
if_gif.c net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
if_gif.h gif_transmit() must always be called in the network epoch. 2020-01-15 06:18:32 +00:00
if_gre.c Add if_reassing method to all tunneling interfaces. 2020-06-03 13:02:31 +00:00
if_gre.h
if_infiniband.c More style fixes (partial revert of r366994). 2020-10-24 13:07:50 +00:00
if_ipsec.c net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
if_ipsec.h
if_lagg.c Fixup r368446 with KERN_TLS. 2020-12-08 23:54:09 +00:00
if_lagg.h Add support for IP over infiniband, IPoIB, to lagg(4). Currently only 2020-10-22 09:47:12 +00:00
if_llatbl.c net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
if_llatbl.h Implement optional table entry limits for if_llatbl. 2020-03-04 17:17:02 +00:00
if_llc.h
if_loop.c net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
if_me.c Add if_reassing method to all tunneling interfaces. 2020-06-03 13:02:31 +00:00
if_media.c if_media.c SIOCGMEDIAX handler: improve loop 2020-11-03 14:33:04 +00:00
if_media.h if_media: definitions for 40GE LM4 ethernet media type 2020-09-16 14:45:16 +00:00
if_mib.c net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
if_mib.h
if_pflog.h
if_pfsync.h net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
if_sppp.h
if_spppfr.c
if_spppsubr.c net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
if_stf.c Complete conversions from fib<4|6>_lookup_nh_<basic|ext> to fib<4|6>_lookup(). 2020-07-02 21:04:08 +00:00
if_tap.h tap: add support for virtio-net offloads 2019-10-18 21:53:27 +00:00
if_tun.h
if_tuntap.c net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
if_types.h Add support for IP over infiniband, IPoIB, to lagg(4). Currently only 2020-10-22 09:47:12 +00:00
if_var.h if: Remove ifnet_rwlock 2020-11-25 10:56:38 +00:00
if_vlan_var.h Add support for stacked VLANs (IEEE 802.1ad, AKA Q-in-Q). 2020-10-21 21:28:20 +00:00
if_vlan.c Add m_snd_tag_alloc() as a wrapper around if_snd_tag_alloc(). 2020-10-29 23:28:39 +00:00
if_vxlan.c vxlan: stop checking CSUM_ENCAP_VXLAN when converting inner CSUM flags into normal, for decapsulation. 2020-12-23 10:54:06 +02:00
if_vxlan.h if_vxlan(4): add support for hardware assisted checksumming, TSO, and RSS. 2020-09-18 02:37:57 +00:00
if.c net: Revert vnet/epair cleanup race mitigation 2020-12-01 16:34:43 +00:00
if.h style(9): Correct whitespace in struct definitions 2020-12-11 01:00:07 +00:00
ifdi_if.m iflib: Stop interface before (un)registering VLAN 2020-04-27 22:02:44 +00:00
iflib_clone.c Import kernel WireGuard support 2020-11-29 19:38:03 +00:00
iflib_private.h
iflib.c iflib: Avoid leaking the freelist bitmaps upon driver detach 2020-12-07 14:53:14 +00:00
iflib.h net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
ifq.h Make net/ifq.h C++ friendly 2020-11-20 14:45:45 +00:00
infiniband.h Factor out generic IP over infiniband, IPoIB, definitions and code 2020-10-22 09:09:53 +00:00
mp_ring.c net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
mp_ring.h
mppc.h
mppcc.c kernel: provide panicky version of __unreachable 2020-05-13 18:07:37 +00:00
mppcd.c
netisr_internal.h
netisr.c net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
netisr.h
netmap_legacy.h net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
netmap_user.h netmap: fix constness warnings generated by "-Wcast-qual" 2020-10-03 09:33:29 +00:00
netmap_virt.h netmap: disable passthrough with no hypervisor support 2020-01-13 21:47:23 +00:00
netmap.h net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
paravirt.h
pfil.c Since now drivers that support pfil run their interrupts in the network 2020-01-23 01:49:22 +00:00
pfil.h
pfkeyv2.h Add SADB_SAFLAGS_ESN flag 2020-10-16 11:22:29 +00:00
pfvar.h pf: Use counter(9) for pf_state byte/packet tracking 2020-12-23 12:03:21 +01:00
ppp_defs.h
radix.c Fix definition of rn_addmask() 2020-11-08 19:02:22 +00:00
radix.h
raw_cb.c Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many) 2020-02-26 14:26:36 +00:00
raw_cb.h
raw_usrreq.c
rndis.h
route.c Add modular fib lookup framework. 2020-12-25 11:33:17 +00:00
route.h Renumber NHR_* flags after NHR_IFAIF removal in r368127. 2020-11-30 21:42:55 +00:00
rss_config.c net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
rss_config.h
rtsock.c rtsock: quiet -Wunused-variable in LINT-NOIP kernels 2020-12-24 12:34:18 -08:00
sff8436.h net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
sff8472.h net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
slcompress.c net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
slcompress.h net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
toeplitz.c
toeplitz.h
vnet.c Partially revert VNET change and expand VNET structure. 2020-02-17 11:08:50 +00:00
vnet.h net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00