netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "David S. Miller" <davem@davemloft.net>
To: Robert Olsson <Robert.Olsson@data.slu.se>
Cc: netdev@oss.sgi.com, robert.olsson@data.slu.se
Subject: Re: Move fib_alias out of fib_hash.c
Date: Wed, 29 Sep 2004 12:53:59 -0700	[thread overview]
Message-ID: <20040929125359.12a00ba7.davem@davemloft.net> (raw)
In-Reply-To: <16730.53965.503605.943263@robur.slu.se>

On Wed, 29 Sep 2004 17:20:45 +0200
Robert Olsson <Robert.Olsson@data.slu.se> 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.

  reply	other threads:[~2004-09-29 19:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-29  4:47 Move fib_alias out of fib_hash.c David S. Miller
2004-09-29 15:20 ` Robert Olsson
2004-09-29 19:53   ` David S. Miller [this message]
2004-09-29 21:20     ` Steven Blake
2004-09-29 21:27       ` David S. Miller
2004-09-29 22:09         ` Andi Kleen
2004-09-29 22:24           ` Ben Greear
2004-09-30  8:08             ` Andi Kleen
2004-09-30 15:51               ` Ben Greear
2004-09-29 21:43       ` Robert Olsson
2004-09-29 21:30     ` Robert Olsson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040929125359.12a00ba7.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=Robert.Olsson@data.slu.se \
    --cc=netdev@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).