summaryrefslogtreecommitdiffstats
path: root/include/net/ip6_fib.h
diff options
context:
space:
mode:
authorDavid Ahern <dsahern@gmail.com>2018-04-18 02:33:14 +0200
committerDavid S. Miller <davem@davemloft.net>2018-04-18 05:41:16 +0200
commit5e670d844b2a4e47d1b9b9aceb14dd3c12a6d4bf (patch)
tree2ad5e74ffea0c7bae6f318475cf37231658c19e5 /include/net/ip6_fib.h
parentnet/ipv6: Save route type in rt6_info (diff)
downloadlinux-5e670d844b2a4e47d1b9b9aceb14dd3c12a6d4bf.tar.xz
linux-5e670d844b2a4e47d1b9b9aceb14dd3c12a6d4bf.zip
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>
Diffstat (limited to 'include/net/ip6_fib.h')
-rw-r--r--include/net/ip6_fib.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h
index 0165820bbafb..f0a88370ba95 100644
--- a/include/net/ip6_fib.h
+++ b/include/net/ip6_fib.h
@@ -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) \