Commit 6093f757 authored by David S. Miller's avatar David S. Miller

Merge branch 'ipv6-next'

Hannes Frederic Sowa says:

====================
ipv6: cleanup after rt6_genid removal

Leftover patches after rt6_genid removal after 705f1c86 ("ipv6:
remove rt6i_genid").

Major two changes are:
* keep fib6_sernum per namespace to reduce number of flushes in case
  system has high number of namespaces
* make fn_sernum updates cheaper

v2: Incorporated feedback from Cong Wang, thanks a lot!
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 1ff0dc94 327571cb
...@@ -64,7 +64,7 @@ struct fib6_node { ...@@ -64,7 +64,7 @@ struct fib6_node {
__u16 fn_bit; /* bit key */ __u16 fn_bit; /* bit key */
__u16 fn_flags; __u16 fn_flags;
__u32 fn_sernum; int fn_sernum;
struct rt6_info *rr_ptr; struct rt6_info *rr_ptr;
}; };
...@@ -202,15 +202,25 @@ static inline void ip6_rt_put(struct rt6_info *rt) ...@@ -202,15 +202,25 @@ static inline void ip6_rt_put(struct rt6_info *rt)
dst_release(&rt->dst); dst_release(&rt->dst);
} }
struct fib6_walker_t { enum fib6_walk_state {
#ifdef CONFIG_IPV6_SUBTREES
FWS_S,
#endif
FWS_L,
FWS_R,
FWS_C,
FWS_U
};
struct fib6_walker {
struct list_head lh; struct list_head lh;
struct fib6_node *root, *node; struct fib6_node *root, *node;
struct rt6_info *leaf; struct rt6_info *leaf;
unsigned char state; enum fib6_walk_state state;
unsigned char prune; bool prune;
unsigned int skip; unsigned int skip;
unsigned int count; unsigned int count;
int (*func)(struct fib6_walker_t *); int (*func)(struct fib6_walker *);
void *args; void *args;
}; };
......
...@@ -76,7 +76,7 @@ struct netns_ipv6 { ...@@ -76,7 +76,7 @@ struct netns_ipv6 {
#endif #endif
#endif #endif
atomic_t dev_addr_genid; atomic_t dev_addr_genid;
atomic_t rt_genid; atomic_t fib6_sernum;
}; };
#if IS_ENABLED(CONFIG_NF_DEFRAG_IPV6) #if IS_ENABLED(CONFIG_NF_DEFRAG_IPV6)
......
...@@ -766,7 +766,7 @@ static int __net_init inet6_net_init(struct net *net) ...@@ -766,7 +766,7 @@ static int __net_init inet6_net_init(struct net *net)
net->ipv6.sysctl.icmpv6_time = 1*HZ; net->ipv6.sysctl.icmpv6_time = 1*HZ;
net->ipv6.sysctl.flowlabel_consistency = 1; net->ipv6.sysctl.flowlabel_consistency = 1;
net->ipv6.sysctl.auto_flowlabels = 0; net->ipv6.sysctl.auto_flowlabels = 0;
atomic_set(&net->ipv6.rt_genid, 0); atomic_set(&net->ipv6.fib6_sernum, 1);
err = ipv6_init_mibs(net); err = ipv6_init_mibs(net);
if (err) if (err)
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment