public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
From: Sebastian Huber <sh@sourceware.org>
To: newlib-cvs@sourceware.org
Subject: [newlib-cygwin] Convert route caching to nexthop caching.
Date: Mon, 11 Jul 2022 11:51:44 +0000 (GMT)	[thread overview]
Message-ID: <20220711115144.1C7DB385415A@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=b94869335751ff08d5d5b276d24eeab3f9da9a9b

commit b94869335751ff08d5d5b276d24eeab3f9da9a9b
Author: Alexander V. Chernikov <melifaro@FreeBSD.org>
Date:   Sat Apr 25 09:06:11 2020 +0000

    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

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_allv2routers;
  * IP6 route structure
  */
 #if __BSD_VISIBLE
+struct nhop_object;
 struct route_in6 {
+#if __FreeBSD_version >= 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


                 reply	other threads:[~2022-07-11 11:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220711115144.1C7DB385415A@sourceware.org \
    --to=sh@sourceware.org \
    --cc=newlib-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).