aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/ip6_route.h
diff options
context:
space:
mode:
authorIdo Schimmel <idosch@mellanox.com>2018-01-09 09:40:25 -0500
committerDavid S. Miller <davem@davemloft.net>2018-01-10 15:14:44 -0500
commitd7dedee184e775f77d321cfa1c660a7680cf6588 (patch)
tree7d59d50b661562ccf2cfad936be59b37f7f69b99 /include/net/ip6_route.h
parente2b3b35eb9896f26c98b9a2c047d9111638059a2 (diff)
ipv6: Calculate hash thresholds for IPv6 nexthops
Before we convert IPv6 to use hash-threshold instead of modulo-N, we first need each nexthop to store its region boundary in the hash function's output space. The boundary is calculated by dividing the output space equally between the different active nexthops. That is, nexthops that are not dead or linkdown. The boundaries are rebalanced whenever a nexthop is added or removed to a multipath route and whenever a nexthop becomes active or inactive. Signed-off-by: Ido Schimmel <idosch@mellanox.com> Acked-by: David Ahern <dsahern@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/ip6_route.h')
-rw-r--r--include/net/ip6_route.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
index 34cd3b0c6ded..27d23a65f3cd 100644
--- a/include/net/ip6_route.h
+++ b/include/net/ip6_route.h
@@ -66,6 +66,12 @@ static inline bool rt6_need_strict(const struct in6_addr *daddr)
66 (IPV6_ADDR_MULTICAST | IPV6_ADDR_LINKLOCAL | IPV6_ADDR_LOOPBACK); 66 (IPV6_ADDR_MULTICAST | IPV6_ADDR_LINKLOCAL | IPV6_ADDR_LOOPBACK);
67} 67}
68 68
69static inline bool rt6_qualify_for_ecmp(const struct rt6_info *rt)
70{
71 return (rt->rt6i_flags & (RTF_GATEWAY|RTF_ADDRCONF|RTF_DYNAMIC)) ==
72 RTF_GATEWAY;
73}
74
69void ip6_route_input(struct sk_buff *skb); 75void ip6_route_input(struct sk_buff *skb);
70struct dst_entry *ip6_route_input_lookup(struct net *net, 76struct dst_entry *ip6_route_input_lookup(struct net *net,
71 struct net_device *dev, 77 struct net_device *dev,
@@ -171,6 +177,7 @@ void rt6_clean_tohost(struct net *net, struct in6_addr *gateway);
171void rt6_sync_up(struct net_device *dev, unsigned int nh_flags); 177void rt6_sync_up(struct net_device *dev, unsigned int nh_flags);
172void rt6_disable_ip(struct net_device *dev, unsigned long event); 178void rt6_disable_ip(struct net_device *dev, unsigned long event);
173void rt6_sync_down_dev(struct net_device *dev, unsigned long event); 179void rt6_sync_down_dev(struct net_device *dev, unsigned long event);
180void rt6_multipath_rebalance(struct rt6_info *rt);
174 181
175static inline const struct rt6_info *skb_rt6_info(const struct sk_buff *skb) 182static inline const struct rt6_info *skb_rt6_info(const struct sk_buff *skb)
176{ 183{