[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.11.1409180749570.4152@ja.home.ssi.bg>
Date: Thu, 18 Sep 2014 08:17:08 +0300 (EEST)
From: Julian Anastasov <ja@....bg>
To: Nicolas Cavallari <nicolas.cavallari@...en-communications.fr>
cc: netdev@...r.kernel.org, "David S. Miller" <davem@...emloft.net>,
Alexey Kuznetsov <kuznet@....inr.ac.ru>,
James Morris <jmorris@...ei.org>,
Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>,
Patrick McHardy <kaber@...sh.net>
Subject: Re: [PATCHv2] ipv4: Do not cache routing failures due to disabled
forwarding.
Hello,
On Mon, 15 Sep 2014, Nicolas Cavallari wrote:
> If we cache them, the kernel will reuse them, independently of
> whether forwarding is enabled or not. Which means that if forwarding is
> disabled on the input interface where the first routing request comes
> from, then that unreachable result will be cached and reused for
> other interfaces, even if forwarding is enabled on them.
>
> This can be verified with two interfaces A and B and an output interface
> C, where B has forwarding enabled, but not A and trying
> ip route get $dst iif A from $src && ip route get $dst iif B from $src
>
> Signed-off-by: Nicolas Cavallari <nicolas.cavallari@...en-communications.fr>
Looks good to me,
Reviewed-by: Julian Anastasov <ja@....bg>
Still, I fail to see how the compiler optimizes
the jump, 'goto local_input' still jumps to res.fi check.
I tried even likely() after 'local_input:" checks for
res.fi and !itag but the 'if (res.fi) {' block is still
moved below and reached with jnz. I expected likely() to
prefer the res.fi != NULL path.
> ---
> v2: simplify patch using julian anastasov's suggestion.
>
> net/ipv4/route.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/net/ipv4/route.c b/net/ipv4/route.c
> index 234a43e..b09fda8 100644
> --- a/net/ipv4/route.c
> +++ b/net/ipv4/route.c
> @@ -1798,6 +1798,7 @@ local_input:
> no_route:
> RT_CACHE_STAT_INC(in_no_route);
> res.type = RTN_UNREACHABLE;
> + res.fi = NULL;
> goto local_input;
>
> /*
> --
> 2.1.0
Regards
--
Julian Anastasov <ja@....bg>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists