Subject: Re: gif interfaces and forwarding rate
To: Jason Thorpe <thorpej@wasabisystems.com>
From: None <itojun@iijlab.net>
List: tech-net
Date: 04/08/2003 09:38:28
>> Any idea on what the problem could be.  Any known limitations to the 
>> implementation?
>
>Hm... Looking at the code, it appears as if the ip_encap.c routines 
>still traverse the entire encaptab even if the radix code is being used 
>to match the tunnel.  Please make sure I'm not reading that code 
>incorrectly :-)

	there are two ways to register tunnel interface to ip_encap.c -
	encap_attach() and encap_attach_func().  if we use the latter,
	we cannot look it up by radix tree.  that's the reason why we traverse
	encaptab after radix lookup.

	if you use the default setting (!GIF_ENCAPCHECK) all gif interface
	will be registered by encap_attach(), so lookup will be done by radix
	tree.  otherwise, lookup will be done by function calls.

>Anyway, so, it's an O(n) algorithm, and part of the decay you see could 
>also be caused by cache thrashing as a result of touching a lot of 
>memory.

	O(n) with almost empty loop.

itojun