Skip to content

Commit

Permalink
ipv6: Use a 31-bit multipath hash
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ido Schimmel authored and David S. Miller committed Jan 10, 2018
1 parent d7dedee commit 7696c06
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/ipv6/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7696c06

Please sign in to comment.