From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1921) id 1C7DB385415A; Mon, 11 Jul 2022 11:51:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1C7DB385415A Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Sebastian Huber To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] Convert route caching to nexthop caching. X-Act-Checkin: newlib-cygwin X-Git-Author: Alexander V. Chernikov X-Git-Refname: refs/heads/master X-Git-Oldrev: 09e5cb57a0c837c0c442668a8dacea19a1d9522a X-Git-Newrev: b94869335751ff08d5d5b276d24eeab3f9da9a9b Message-Id: <20220711115144.1C7DB385415A@sourceware.org> Date: Mon, 11 Jul 2022 11:51:44 +0000 (GMT) X-BeenThere: newlib-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib GIT logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jul 2022 11:51:44 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3Db9486933575= 1ff08d5d5b276d24eeab3f9da9a9b commit b94869335751ff08d5d5b276d24eeab3f9da9a9b Author: Alexander V. Chernikov Date: Sat Apr 25 09:06:11 2020 +0000 Convert route caching to nexthop caching. =20 This change is build on top of nexthop objects introduced in r359823. =20 Nexthops are separate datastructures, containing all necessary informat= ion to perform packet forwarding such as gateway interface and mtu. Nextho= ps are shared among the routes, providing more pre-computed cache-efficie= nt data while requiring less memory. Splitting the LPM code and the attac= hed data solves multiple long-standing problems in the routing layer, drastically reduces the coupling with outher parts of the stack and al= lows to transparently introduce faster lookup algorithms. =20 Route caching was (re)introduced to minimise (slow) routing lookups, al= lowing 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 gener= ation id) or link goes down, cache record gets withdrawn. =20 Nexthops have the same reference counting interface, backed by refcount= (9). This change merely replaces rtentry with the actual forwarding nextop a= s a cached object, which is mostly mechanical. Other moving parts like cac= he cleanup on rtable change remains the same. =20 Differential Revision: https://reviews.freebsd.org/D24340 Diff: --- newlib/libc/sys/rtems/include/netinet6/in6.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/newlib/libc/sys/rtems/include/netinet6/in6.h b/newlib/libc/sys= /rtems/include/netinet6/in6.h index f6399eed1..68d4c3e4e 100644 --- a/newlib/libc/sys/rtems/include/netinet6/in6.h +++ b/newlib/libc/sys/rtems/include/netinet6/in6.h @@ -265,8 +265,13 @@ extern const struct in6_addr in6addr_linklocal_allv2ro= uters; * IP6 route structure */ #if __BSD_VISIBLE +struct nhop_object; struct route_in6 { +#if __FreeBSD_version >=3D 1300092 + struct nhop_object *ro_nh; +#else struct rtentry *ro_rt; +#endif struct llentry *ro_lle; /* * ro_prepend and ro_plen are only used for bpf to pass in a