netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: YOSHIFUJI Hideaki <hideaki@yoshifuji.org>
To: Hannes Frederic Sowa <hannes@stressinduktion.org>,
	netdev@vger.kernel.org
Cc: eric.dumazet@gmail.com, vyasevich@gmail.com,
	nicolas.dichtel@6wind.com, kafai@fb.com
Subject: Re: [PATCH net-next 5/8] ipv6: new function fib6_flush_trees and use it instead of bumping removed rt6_genid
Date: Sun, 21 Sep 2014 11:21:52 +0900	[thread overview]
Message-ID: <541E3640.6020907@yoshifuji.org> (raw)
In-Reply-To: <c0a1543fe7608640f2dd1f37f8fe5978f30536d1.1411249633.git.hannes@stressinduktion.org>

Hannes Frederic Sowa wrote:
> fib6_flush_trees is still a very costly operation but now is only called
> by xfrm code when a policy changes or ipv6 addresses are added/removed.
> 
> fib6_flush_tree must walk all ipv6 routing tables and modify fn_sernum,
> so all sockets relookup their dst_entries. Use a NULL callback, so we
> only walk the nodes without looking at the rt6_infos.
> 
> Cc: Eric Dumazet <eric.dumazet@gmail.com>
> Cc: Vlad Yasevich <vyasevich@gmail.com>
> Cc: Nicolas Dichtel <nicolas.dichtel@6wind.com>
> Cc: Martin Lau <kafai@fb.com>
> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
> ---
>  include/net/net_namespace.h | 14 +++-----------
>  include/net/netns/ipv6.h    |  1 -
>  net/ipv6/addrconf_core.c    |  6 ++++++
>  net/ipv6/af_inet6.c         |  1 -
>  net/ipv6/ip6_fib.c          | 21 +++++++++++++++++----
>  net/ipv6/route.c            |  4 ----
>  6 files changed, 26 insertions(+), 21 deletions(-)
> 
> diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
> index 361d260..61aad36 100644
> --- a/include/net/net_namespace.h
> +++ b/include/net/net_namespace.h
> @@ -353,21 +353,13 @@ static inline void rt_genid_bump_ipv4(struct net *net)
>  }
>  
>  #if IS_ENABLED(CONFIG_IPV6)
> -static inline int rt_genid_ipv6(struct net *net)
> -{
> -	return atomic_read(&net->ipv6.rt_genid);
> -}
> -
> +extern void (*__fib6_flush_trees)(struct net *);
>  static inline void rt_genid_bump_ipv6(struct net *net)
>  {
> -	atomic_inc(&net->ipv6.rt_genid);
> +	if (__fib6_flush_trees)
> +		__fib6_flush_trees(net);
>  }
>  #else

Now it does not "bump" the genid anymore.  Why not to change the
function name to reflect the fact?

--yoshfuji

  reply	other threads:[~2014-09-21  2:21 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-20 22:05 [PATCH net-next 0/8] ipv6: fib6: socket dst_entry improvments and cleanups Hannes Frederic Sowa
2014-09-20 22:05 ` [PATCH net-next 1/8] ipv6: support for fib6_clean_* to update fn_sernum Hannes Frederic Sowa
2014-09-21  2:07   ` YOSHIFUJI Hideaki
2014-09-21 10:09     ` Hannes Frederic Sowa
2014-09-20 22:05 ` [PATCH net-next 2/8] ipv6: a bit more typesafety Hannes Frederic Sowa
2014-09-21  2:13   ` YOSHIFUJI Hideaki
2014-09-21 10:08     ` Hannes Frederic Sowa
2014-09-20 22:05 ` [PATCH net-next 3/8] ipv6: only generate one new serial number during fib6_add() Hannes Frederic Sowa
2014-09-20 22:05 ` [PATCH net-next 4/8] ipv6: if no function for cleaner is specified only visit fib6_nodes Hannes Frederic Sowa
2014-09-20 22:05 ` [PATCH net-next 5/8] ipv6: new function fib6_flush_trees and use it instead of bumping removed rt6_genid Hannes Frederic Sowa
2014-09-21  2:21   ` YOSHIFUJI Hideaki [this message]
2014-09-21 10:11     ` Hannes Frederic Sowa
2014-09-20 22:05 ` [PATCH net-next 6/8] ipv6: no need to bump rt_genid_ipv6 on address addition Hannes Frederic Sowa
2014-09-20 22:05 ` [PATCH net-next 7/8] ipv6: keep rt_sernum per namespace to reduce number of flushes Hannes Frederic Sowa
2014-09-20 22:05 ` [PATCH net-next 8/8] ipv6: switch rt_sernum to atomic_t and clean up types 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=541E3640.6020907@yoshifuji.org \
    --to=hideaki@yoshifuji.org \
    --cc=eric.dumazet@gmail.com \
    --cc=hannes@stressinduktion.org \
    --cc=kafai@fb.com \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.dichtel@6wind.com \
    --cc=vyasevich@gmail.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).