summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid Ahern <dsahern@gmail.com>2019-05-22 20:27:58 -0700
committerDavid S. Miller <davem@davemloft.net>2019-05-24 13:26:44 -0700
commitcc5c073a693fa6ed7a207b0436114f68cce72434 (patch)
tree1fb7f4548614be447a54add7cae5d61d54466f9a /include
parentc0b220cf7d80eb8a36ae9f12cae6df4577a6814e (diff)
ipv6: Move exception bucket to fib6_nh
Similar to the pcpu routes exceptions are really per nexthop, so move rt6i_exception_bucket from fib6_info to fib6_nh. To avoid additional increases to the size of fib6_nh for a 1-bit flag, use the lowest bit in the allocated memory pointer for the flushed flag. Add helpers for retrieving the bucket pointer to mask off the flag. The cleanup of the exception bucket is moved to fib6_nh_release. fib6_nh_flush_exceptions can now be called from 2 contexts: 1. deleting a fib entry 2. deleting a fib6_nh For 1., fib6_nh_flush_exceptions is called for a specific fib6_info that is getting deleted. All exceptions in the cache using the entry are deleted. For 2, the fib6_nh itself is getting destroyed so fib6_nh_flush_exceptions is called for a NULL fib6_info which means flush all entries. The pmtu.sh selftest exercises the affected code paths - from creating exceptions to cleaning them up on device delete. All tests pass without any rcu locking or memleak warnings. Signed-off-by: David Ahern <dsahern@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/net/ip6_fib.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h
index 38e87ef81b7e..6b4852cf2fc2 100644
--- a/include/net/ip6_fib.h
+++ b/include/net/ip6_fib.h
@@ -133,6 +133,7 @@ struct fib6_nh {
#endif
struct rt6_info * __percpu *rt6i_pcpu;
+ struct rt6_exception_bucket __rcu *rt6i_exception_bucket;
};
struct fib6_info {
@@ -158,18 +159,15 @@ struct fib6_info {
struct rt6key fib6_src;
struct rt6key fib6_prefsrc;
- struct rt6_exception_bucket __rcu *rt6i_exception_bucket;
-
u32 fib6_metric;
u8 fib6_protocol;
u8 fib6_type;
- u8 exception_bucket_flushed:1,
- should_flush:1,
+ u8 should_flush:1,
dst_nocount:1,
dst_nopolicy:1,
dst_host:1,
fib6_destroying:1,
- unused:2;
+ unused:3;
struct fib6_nh fib6_nh;
struct rcu_head rcu;