All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Graf <tgraf@suug.ch>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH]: Fix ipv6 round-robin locking
Date: Sun, 25 Mar 2007 00:40:30 +0100	[thread overview]
Message-ID: <20070324234030.GG521@postel.suug.ch> (raw)
In-Reply-To: <20070324.124436.104040932.davem@davemloft.net>

* David Miller <davem@davemloft.net> 2007-03-24 12:44
>     As per RFC2461, section 6.3.6, item #2, when no routers on the
>     matching list are known to be reachable or probably reachable we
>     do round robin on those available routes so that we make sure
>     to probe as many of them as possible to detect when one becomes
>     reachable faster.
>     
> +static struct rt6_info *find_match(struct rt6_info *rt, int oif, int strict,
> +				   int *mpri, struct rt6_info *match)
>  {
> +	int m;
> +
> +	if (rt6_check_expired(rt))
> +		goto out;
> +
> +	m = rt6_score_route(rt, oif, strict);
> +	if (m < 0)
> +		goto out;
> +
> +	if (m > *mpri) {
> +		if (strict & RT6_LOOKUP_F_REACHABLE)
> +			rt6_probe(match);
> +		*mpri = m;
> +		match = rt;
> +	} else if (strict & RT6_LOOKUP_F_REACHABLE) {
> +		rt6_probe(rt);
> +	}
> +
> +out:
> +	return match;
> +}

First of all, I haven't spotted any errors in your patch.

Seondly, I'm not sure I've fully understood why this round robin mechanism
is needed to ensure as many routers as possible are probed as soon as
possible. I'd understand it if we'd only probe just one router per selection
process but to my undertanding we try and probe _all_ routers as long as
its score is positive (and rate limitation doesn't step in). The score can
only be negative  if rt6_check_dev() returns 0, the neighbour state is
NUD_FAILED or not present at all. I don't see how the position in the list
would have any affect on this. rt6_select() is called for all routers
regardless of its score, the position of a router doesn't matter.

The only effect of this code I can see is that we return a different
_probably_ reachable router while no router is reachable. This would implement
what item #1 of 6.3.6 proposes.

I'm just making sure we know what we're doing :-)

  reply	other threads:[~2007-03-24 23:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-24 19:44 [PATCH]: Fix ipv6 round-robin locking David Miller
2007-03-24 23:40 ` Thomas Graf [this message]
2007-03-25  1:15   ` David Miller
2007-03-28  9:16 ` YOSHIFUJI Hideaki / 吉藤英明
2007-03-28  9:19   ` David Miller

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=20070324234030.GG521@postel.suug.ch \
    --to=tgraf@suug.ch \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.