]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Convert route caching to nexthop caching.
authorAlexander V. Chernikov <melifaro@FreeBSD.org>
Sat, 25 Apr 2020 09:06:11 +0000 (09:06 +0000)
committerAlexander V. Chernikov <melifaro@FreeBSD.org>
Sat, 25 Apr 2020 09:06:11 +0000 (09:06 +0000)
commit983066f05bacda3e18aae456e56feb00f70c0b55
tree0d49459a664c8afd72259c14574ada801277c7c2
parente4a458bb1b31a0893296b17369163bdf4b492835
Convert route caching to nexthop caching.

This change is build on top of nexthop objects introduced in r359823.

Nexthops are separate datastructures, containing all necessary information
 to perform packet forwarding such as gateway interface and mtu. Nexthops
 are shared among the routes, providing more pre-computed cache-efficient
 data while requiring less memory. Splitting the LPM code and the attached
 data solves multiple long-standing problems in the routing layer,
 drastically reduces the coupling with outher parts of the stack and allows
 to transparently introduce faster lookup algorithms.

Route caching was (re)introduced to minimise (slow) routing lookups, allowing
 for notably better performance for large TCP senders. Caching works by
 acquiring rtentry reference, which is protected by per-rtentry mutex.
 If the routing table is changed (checked by comparing the rtable generation id)
 or link goes down, cache record gets withdrawn.

Nexthops have the same reference counting interface, backed by refcount(9).
This change merely replaces rtentry with the actual forwarding nextop as a
 cached object, which is mostly mechanical. Other moving parts like cache
 cleanup on rtable change remains the same.

Differential Revision: https://reviews.freebsd.org/D24340
25 files changed:
sys/kern/uipc_ktls.c
sys/net/radix_mpath.c
sys/net/route.c
sys/net/route.h
sys/net/route_var.h
sys/netinet/in_fib.c
sys/netinet/in_fib.h
sys/netinet/ip_input.c
sys/netinet/ip_output.c
sys/netinet/sctp_asconf.c
sys/netinet/sctp_os_bsd.h
sys/netinet/sctp_output.c
sys/netinet/sctp_pcb.c
sys/netinet/sctp_structs.h
sys/netinet/sctp_timer.c
sys/netinet/sctp_var.h
sys/netinet/tcp_output.c
sys/netinet/tcp_stacks/bbr.c
sys/netinet/tcp_subr.c
sys/netinet/udp_usrreq.c
sys/netinet6/in6.h
sys/netinet6/in6_pcb.c
sys/netinet6/in6_src.c
sys/netinet6/ip6_output.c
sys/netinet6/ip6_var.h