netdev
[Top] [All Lists]

Re: rt_cache_flush()

To: Andi Kleen <ak@xxxxxx>, "James R. Leu" <jleu@xxxxxxxxxxxxxx>
Subject: Re: rt_cache_flush()
From: "James R. Leu" <jleu@xxxxxxxxxxxxxx>
Date: Mon, 1 May 2000 15:36:01 -0500
Cc: netdev@xxxxxxxxxxx
In-reply-to: <20000501211145.A10174@fred.muc.de>; from Andi Kleen on Mon, May 01, 2000 at 09:11:45PM +0200
Organization: none
References: <20000501103620.A7015@doit.wisc.edu> <20000501211145.A10174@fred.muc.de>
Reply-to: jleu@xxxxxxxxxxxxxx
Sender: owner-netdev@xxxxxxxxxxx
On Mon, May 01, 2000 at 09:11:45PM +0200, Andi Kleen wrote:
> On Mon, May 01, 2000 at 04:36:56PM +0200, James R. Leu wrote:
> > I am fiddling with entries in the fib table and each time I modify a
> > fib entry I want all entries in the route cache that used this fib entry
> > to be flushed.
> > 
> > rt_cache_flush() seems to want to flush the whole cache.  For some reason
> > it doesn't seem to be working.  Is this the correct way to flush the entire
> > route cache?  What about entries that still have a ref_cnt > 0?
> 
> You set rt->u.dst.obsolete = 1 and expect the clients to relookup when they 
> can.

I'm not sure I have that availble to me at the level I'm at.  Here is wha
I'm doing:

-I wrote a function called fn_hash_lookup_exact().  This finds an exact
 match in the fib (not longest, EXACT).
-I add a snigglet of info to it (an outgoing MPLS label to be exact)
-I then to a rt_cache_flush(-1)

Ideally I would like for only the route cache entries that matched
the fib_node I found to be yanked from the cache (immediatly).  I'll settle
for the entire cache being flushed.

It looks like the cache is being flushed, but it take a small amount
of time.  In that time, some packet go by and continue to use the old entry.
If I stop all packets, modify the fib_node (resulting in a rt_cache_flush(-1))
and wait a couple of seconds, then send packets, things seem to work as
expected.

Is there any way to get my ideal scenario above?  If not can I speed up the
cache flush?

Thanks,
Jim

-- 
James R. Leu

<Prev in Thread] Current Thread [Next in Thread>