netdev
[Top] [All Lists]

Re: Move fib_alias out of fib_hash.c

To: Robert Olsson <Robert.Olsson@xxxxxxxxxxx>
Subject: Re: Move fib_alias out of fib_hash.c
From: "David S. Miller" <davem@xxxxxxxxxxxxx>
Date: Wed, 29 Sep 2004 12:53:59 -0700
Cc: netdev@xxxxxxxxxxx, robert.olsson@xxxxxxxxxxx
In-reply-to: <16730.53965.503605.943263@xxxxxxxxxxxx>
References: <20040928214722.11aef8e0.davem@xxxxxxxxxxxxx> <16730.53965.503605.943263@xxxxxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
On Wed, 29 Sep 2004 17:20:45 +0200
Robert Olsson <Robert.Olsson@xxxxxxxxxxx> wrote:

>   we can interface new lookups cleanly. For a trie something like:

You are already making a critical logic error.

You cannot find the longest matching prefix and just use that.

Rather, you must iterate through all matching prefixes in the
table from longest to shortest, trying fib_semantic_match() on
each one until it says OK.

If you don't do that, then you're not providing the same behavior
of the current code.  If next hops go down, you have to try the
next longest matching prefix and so on and so forth.  It can also
be the case that the longest matching prefix entry has no matching
TOS key, whereas a shorter prefix does.

This makes using a new algorithm very non-trivial.

Probably what you should do is keep an array on the function
stack, recording shorter prefix entries you see on your walk
down to the longest matching prefix.  Then you process the array
one entry at a time back to the root, trying fib_semantic_match()
on each one.

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