net/ipv6: Move nexthop data to fib6_nh
Introduce fib6_nh structure and move nexthop related data from rt6_info and rt6_info.dst to fib6_nh. References to dev, gateway or lwtstate from a FIB lookup perspective are converted to use fib6_nh; datapath references to dst version are left as is. Signed-off-by: David Ahern <dsahern@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
e8478e80e5
commit
5e670d844b
@@ -127,6 +127,16 @@ struct rt6_exception {
|
||||
#define FIB6_EXCEPTION_BUCKET_SIZE (1 << FIB6_EXCEPTION_BUCKET_SIZE_SHIFT)
|
||||
#define FIB6_MAX_DEPTH 5
|
||||
|
||||
struct fib6_nh {
|
||||
struct in6_addr nh_gw;
|
||||
struct net_device *nh_dev;
|
||||
struct lwtunnel_state *nh_lwtstate;
|
||||
|
||||
unsigned int nh_flags;
|
||||
atomic_t nh_upper_bound;
|
||||
int nh_weight;
|
||||
};
|
||||
|
||||
struct rt6_info {
|
||||
struct dst_entry dst;
|
||||
struct rt6_info __rcu *rt6_next;
|
||||
@@ -149,12 +159,9 @@ struct rt6_info {
|
||||
*/
|
||||
struct list_head rt6i_siblings;
|
||||
unsigned int rt6i_nsiblings;
|
||||
atomic_t rt6i_nh_upper_bound;
|
||||
|
||||
atomic_t rt6i_ref;
|
||||
|
||||
unsigned int rt6i_nh_flags;
|
||||
|
||||
/* These are in a separate cache line. */
|
||||
struct rt6key rt6i_dst ____cacheline_aligned_in_smp;
|
||||
u32 rt6i_flags;
|
||||
@@ -171,13 +178,14 @@ struct rt6_info {
|
||||
u32 rt6i_metric;
|
||||
u32 rt6i_pmtu;
|
||||
/* more non-fragment space at head required */
|
||||
int rt6i_nh_weight;
|
||||
unsigned short rt6i_nfheader_len;
|
||||
u8 rt6i_protocol;
|
||||
u8 fib6_type;
|
||||
u8 exception_bucket_flushed:1,
|
||||
should_flush:1,
|
||||
unused:6;
|
||||
|
||||
struct fib6_nh fib6_nh;
|
||||
};
|
||||
|
||||
#define for_each_fib6_node_rt_rcu(fn) \
|
||||
|
Reference in New Issue
Block a user