netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: kafai@fb.com
Cc: netdev@vger.kernel.org, hannes@stressinduktion.org
Subject: Re: [PATCH RFC v3 net 1/2] ipv6: Remove the net->ipv6.ip6_null_entry check
Date: Wed, 08 Oct 2014 15:08:38 -0400 (EDT)	[thread overview]
Message-ID: <20141008.150838.2078642969379360127.davem@davemloft.net> (raw)
In-Reply-To: <1412640315-22472-2-git-send-email-kafai@fb.com>

From: Martin KaFai Lau <kafai@fb.com>
Date: Mon, 6 Oct 2014 17:05:14 -0700

> The above BACKTRACK have already caught the rt == net->ipv6.ip6_null_entry case
> 
> Cc: Hannes Frederic Sowa <hannes@stressinduktion.org>
> Signed-off-by: Martin KaFai Lau <kafai@fb.com>
 ...
> @@ -936,8 +936,7 @@ restart:
>  	if (rt->rt6i_nsiblings)
>  		rt = rt6_multipath_select(rt, fl6, oif, strict | reachable);
>  	BACKTRACK(net, &fl6->saddr);
> -	if (rt == net->ipv6.ip6_null_entry ||
> -	    rt->rt6i_flags & RTF_CACHE)
> +	if (rt->rt6i_flags & RTF_CACHE)
>  		goto out;
>  
>  	dst_hold(&rt->dst);

I think this is sort of going in the wrong direction.

The BACKTRACK() macro hides a lot of side effects inside of it's
implementation, and worst of all it hides a change of control flow
with it's "goto out;" and "goto restart;"

I'd rather see us clean this up in some way that someone auditing this
code won't be tricked into missing the control flow side effects, than
adding more dependencies upon BACKTRACK()'s implementation.

Thanks.

  reply	other threads:[~2014-10-08 19:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-07  0:05 [PATCH RFC v3 net 0/2] ipv6: Avoid restarting fib6_lookup() for RTF_CACHE hit Martin KaFai Lau
2014-10-07  0:05 ` [PATCH RFC v3 net 1/2] ipv6: Remove the net->ipv6.ip6_null_entry check Martin KaFai Lau
2014-10-08 19:08   ` David Miller [this message]
2014-10-07  0:05 ` [PATCH RFC v3 net 2/2] ipv6: Avoid restarting fib6_lookup() for RTF_CACHE hit case Martin KaFai Lau
2014-10-08 19:32   ` David Miller
2014-10-09  4:19     ` Martin Lau
2014-10-07  0:10 ` [PATCH RFC v3 net 0/2] ipv6: Avoid restarting fib6_lookup() for RTF_CACHE hit Hannes Frederic Sowa

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=20141008.150838.2078642969379360127.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=hannes@stressinduktion.org \
    --cc=kafai@fb.com \
    --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 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).