aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet6/in6.h
diff options
context:
space:
mode:
authorAlexander V. Chernikov <melifaro@FreeBSD.org>2020-04-25 09:06:11 +0000
committerAlexander V. Chernikov <melifaro@FreeBSD.org>2020-04-25 09:06:11 +0000
commit983066f05bacda3e18aae456e56feb00f70c0b55 (patch)
tree0d49459a664c8afd72259c14574ada801277c7c2 /sys/netinet6/in6.h
parente4a458bb1b31a0893296b17369163bdf4b492835 (diff)
downloadsrc-983066f05bacda3e18aae456e56feb00f70c0b55.tar.gz
src-983066f05bacda3e18aae456e56feb00f70c0b55.zip
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
Notes
Notes: svn path=/head/; revision=360292
Diffstat (limited to 'sys/netinet6/in6.h')
-rw-r--r--sys/netinet6/in6.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/netinet6/in6.h b/sys/netinet6/in6.h
index 56ab11460af2..1092130919cb 100644
--- a/sys/netinet6/in6.h
+++ b/sys/netinet6/in6.h
@@ -375,8 +375,9 @@ extern const struct in6_addr in6addr_linklocal_allv2routers;
* IP6 route structure
*/
#if __BSD_VISIBLE
+struct nhop_object;
struct route_in6 {
- struct rtentry *ro_rt;
+ struct nhop_object *ro_nh;
struct llentry *ro_lle;
/*
* ro_prepend and ro_plen are only used for bpf to pass in a