]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Convert route caching to nexthop caching.
authormelifaro <melifaro@FreeBSD.org>
Sat, 25 Apr 2020 09:06:11 +0000 (09:06 +0000)
committermelifaro <melifaro@FreeBSD.org>
Sat, 25 Apr 2020 09:06:11 +0000 (09:06 +0000)
commit07f4c41e556802ddc4e6f71272c60a7596ba601a
tree0d49459a664c8afd72259c14574ada801277c7c2
parent544dbc0072d64ec80854e32301efeb47f8081e3f
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