Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 09 Dec 2004 16:26:50 +0100
From:      Andre Oppermann <andre@freebsd.org>
To:        Ruslan Ermilov <ru@freebsd.org>
Cc:        cvs-all@freebsd.org
Subject:   Re: cvs commit: src/sys/netinet in_gif.c
Message-ID:  <41B86EBA.BF6E2856@freebsd.org>
References:  <200412061902.iB6J2hJ6000543@repoman.freebsd.org> <20041206224339.GB51442@ip.net.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
Ruslan Ermilov wrote:
> 
> On Mon, Dec 06, 2004 at 07:02:43PM +0000, Gleb Smirnoff wrote:
> > glebius     2004-12-06 19:02:43 UTC
> >
> >   FreeBSD src repository
> >
> >   Modified files:
> >     sys/netinet          in_gif.c
> >   Log:
> >   - Make route cacheing optional, configurable via IFF_LINK0 flag.
> >   - Turn it off by default.
> >
> >   Requested by:   many
> >   Reviewed by:    andre
> >   Approved by:    julian (mentor)
> >   MFC after:      3 days
> >
> >   Revision  Changes    Path
> >   1.27      +6 -0      src/sys/netinet/in_gif.c
> >
> This looks suboptimal.  In the !IFF_LINK0 case, I suggest
> not messing with sc->gif_ro at all and passing ip_output()
> a NULL route pointer.  Loop detection here is incomplete,
> and the correct detection is already done in if_gif.c.
> Other route checks just duplicate existing functionality.
> 
> By the way, I have a WIP (attached) that adds versioning
> to the routing table.  Whenever a routing table is altered,
> the version is bumped.  The primary intent is for cached
> routes, and it was invented specifically to address this
> gif(4) problem, but also the remnants of PR kern/10778.

Route caching at the consumers of the route API is evil and
should be avoided.  If there is any caching it should be in
or managed by the route lookup function in one central place.
This also helps to avoid concurrency and locking issues.
IMO this is the only way to go and where I want to end up in
a not too distant future.

-- 
Andre



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?41B86EBA.BF6E2856>