Skip to content

Commit

Permalink
Merge branch 'ipv6-next'
Browse files Browse the repository at this point in the history
Hannes Frederic Sowa says:

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

Leftover patches after rt6_genid removal after 705f1c8 ("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: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Oct 7, 2014
2 parents 1ff0dc9 + 327571c commit 6093f75
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 75 deletions.
20 changes: 15 additions & 5 deletions include/net/ip6_fib.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ struct fib6_node {

__u16 fn_bit; /* bit key */
__u16 fn_flags;
__u32 fn_sernum;
int fn_sernum;
struct rt6_info *rr_ptr;
};

Expand Down Expand Up @@ -202,15 +202,25 @@ static inline void ip6_rt_put(struct rt6_info *rt)
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 fib6_node *root, *node;
struct rt6_info *leaf;
unsigned char state;
unsigned char prune;
enum fib6_walk_state state;
bool prune;
unsigned int skip;
unsigned int count;
int (*func)(struct fib6_walker_t *);
int (*func)(struct fib6_walker *);
void *args;
};

Expand Down
2 changes: 1 addition & 1 deletion include/net/netns/ipv6.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ struct netns_ipv6 {
#endif
#endif
atomic_t dev_addr_genid;
atomic_t rt_genid;
atomic_t fib6_sernum;
};

#if IS_ENABLED(CONFIG_NF_DEFRAG_IPV6)
Expand Down
2 changes: 1 addition & 1 deletion net/ipv6/af_inet6.c
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@ static int __net_init inet6_net_init(struct net *net)
net->ipv6.sysctl.icmpv6_time = 1*HZ;
net->ipv6.sysctl.flowlabel_consistency = 1;
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);
if (err)
Expand Down
Loading

0 comments on commit 6093f75

Please sign in to comment.