Subject: Re: works in progress: route cache invalidation, RADIX_MPATH
To: None <>
From: Antti Kantee <>
List: tech-net
Date: 12/10/2006 14:58:39
On Sat Dec 09 2006 at 01:09:16 +0100, Joerg Sonnenberger wrote:
> This is part one to actually do this. The difference to David's approach
> is that I want to actually abstract the route cache (re)validation and
> ultimately avoid doing the domain specific flushing.
> The patch starts this by changing all the proper rtfree calls to the new
> API and starts to adjust the various updates. The next part will add
> rtcache_check() calls in the various places where the cached route is
> accessed and enforcing the calls to rtcache_init(). 
> I want to commit this first as it is mostly mechanical and makes
> reviewing the other parts easier.

Just skimming through the patch, how about making rtcache_init() return if
the cache is valid.  It'd avoid a lot of rtcache_init(); if (!= NULL) foo;

Then (of course!), I find the naming confusing.  I'd expect _check()
to return if the cache valid, not have side effects.  Maybe call it
_reheat()? (ok, equally sucky name, but at least less confusing ;) Also,
maybe _invalidate() instead of _free() and add isvalid() to avoid manual
comparison against NULL.

And while you're abstracting, it would be nice if _init() could take
the address to truly *init* the route cache (err.. or route, route not
being rtentry.  gotta love the naming).  And then we'd just call _update()
or _hopefully_soon_to_be_renamed_check() everywhere else.

The use of rtcache in pf seems excessive.  Maybe it would be better to
fix the routing interface to allow such a query (yes, I know, it wasn't
the point here, but this part just stuck out of the patch).

I'll comment less mechanically when the patches get less mechanical.
Or after I get coffee, whichever happens last ;)

routing gore looks more palatable already.  thanks!

p.s. didn't even skim the netiso part ... ;p

Antti Kantee <>                     Of course he runs NetBSD                
    "la qualité la plus indispensable du cuisinier est l'exactitude"