summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorIdo Schimmel2018-01-09 15:40:26 +0100
committerDavid S. Miller2018-01-10 21:14:44 +0100
commit7696c06a189c0f1f4d0a7e49e28d10e1050ec529 (patch)
tree523cddaf3bdb72c4116ace07b533d7ef131c3190 /net
parentipv6: Calculate hash thresholds for IPv6 nexthops (diff)
downloadkernel-qcow2-linux-7696c06a189c0f1f4d0a7e49e28d10e1050ec529.tar.gz
kernel-qcow2-linux-7696c06a189c0f1f4d0a7e49e28d10e1050ec529.tar.xz
kernel-qcow2-linux-7696c06a189c0f1f4d0a7e49e28d10e1050ec529.zip
ipv6: Use a 31-bit multipath hash
The hash thresholds assigned to IPv6 nexthops are in the range of [-1, 2^31 - 1], where a negative value is assigned to nexthops that should not be considered during multipath selection. Therefore, in a similar fashion to IPv4, we need to use the upper 31-bits of the multipath hash for multipath selection. 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 'net')
-rw-r--r--net/ipv6/route.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index ced2c9bed10b..09e8e10b101d 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1833,10 +1833,10 @@ u32 rt6_multipath_hash(const struct flowi6 *fl6, const struct sk_buff *skb)
if (skb) {
ip6_multipath_l3_keys(skb, &hash_keys);
- return flow_hash_from_keys(&hash_keys);
+ return flow_hash_from_keys(&hash_keys) >> 1;
}
- return get_hash_from_flowi6(fl6);
+ return get_hash_from_flowi6(fl6) >> 1;
}
void ip6_route_input(struct sk_buff *skb)