freebsd-dev/sys/netinet6
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
..
dest6.c
frag6.c net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
icmp6.c Fix use-after-free in icmp6_notify_error(). 2020-10-28 20:22:20 +00:00
icmp6.h
in6_cksum.c net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
in6_fib_algo.c Add modular fib lookup framework. 2020-12-25 11:33:17 +00:00
in6_fib.c Add modular fib lookup framework. 2020-12-25 11:33:17 +00:00
in6_fib.h Add modular fib lookup framework. 2020-12-25 11:33:17 +00:00
in6_gif.c
in6_ifattach.c Make sure the multicast release tasks are properly drained when 2020-08-10 10:46:08 +00:00
in6_ifattach.h
in6_jail.c
in6_mcast.c net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
in6_pcb.c Filter TCP connections to SO_REUSEPORT_LB listen sockets by NUMA domain 2020-12-19 22:04:46 +00:00
in6_pcb.h Filter TCP connections to SO_REUSEPORT_LB listen sockets by NUMA domain 2020-12-19 22:04:46 +00:00
in6_pcbgroup.c
in6_proto.c Remove unused nhop_ref_any() function. 2020-09-20 21:32:52 +00:00
in6_rmx.c Introduce scalable route multipath. 2020-10-03 10:47:17 +00:00
in6_rss.c Implement flowid calculation for outbound connections to balance 2020-10-18 17:15:47 +00:00
in6_rss.h Implement flowid calculation for outbound connections to balance 2020-10-18 17:15:47 +00:00
in6_src.c Remove unused nhop_ref_any() function. 2020-09-20 21:32:52 +00:00
in6_var.h Simplify dom_<rtattach|rtdetach>. 2020-08-14 21:29:56 +00:00
in6.c net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
in6.h Expose nonstandard IPv6 kernel definitions to standalone builds. 2020-12-04 21:51:47 +00:00
ip6_ecn.h
ip6_fastfwd.c net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
ip6_forward.c ipv6: quit dropping packets looping back on p2p interfaces 2020-08-31 01:45:48 +00:00
ip6_gre.c
ip6_id.c
ip6_input.c net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
ip6_mroute.c net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
ip6_mroute.h
ip6_output.c Implement flowid calculation for outbound connections to balance 2020-10-18 17:15:47 +00:00
ip6_var.h
ip6.h
ip6protosw.h
ip_fw_nat64.h
ip_fw_nptv6.h net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
mld6_var.h
mld6.c net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
mld6.h
nd6_nbr.c icmp6: Count packets dropped due to an invalid hop limit 2020-10-19 17:07:19 +00:00
nd6_rtr.c Refactor rib iterator functions. 2020-11-22 20:21:10 +00:00
nd6.c Remove RADIX_MPATH config option. 2020-11-29 19:43:33 +00:00
nd6.h Switch inet6 default route subscription to the new rib subscription api. 2020-07-12 11:24:23 +00:00
pim6_var.h
pim6.h
raw_ip6.c Implement flowid calculation for outbound connections to balance 2020-10-18 17:15:47 +00:00
raw_ip6.h
route6.c
scope6_var.h Make net.inet6.ip6.deembed_scopeid behaviour default & remove sysctl. 2020-08-15 11:37:44 +00:00
scope6.c net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
sctp6_usrreq.c net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
sctp6_var.h
send.c
send.h
tcp6_var.h
udp6_usrreq.c Implement flowid calculation for outbound connections to balance 2020-10-18 17:15:47 +00:00
udp6_var.h