From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ido Schimmel Subject: [PATCH net-next 2/4] ipv6: Use a 31-bit multipath hash Date: Tue, 9 Jan 2018 16:40:26 +0200 Message-ID: <20180109144028.30133-3-idosch@mellanox.com> References: <20180109144028.30133-1-idosch@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain Cc: davem@davemloft.net, dsahern@gmail.com, roopa@cumulusnetworks.com, nikolay@cumulusnetworks.com, pch@ordbogen.com, jkbs@redhat.com, yoshfuji@linux-ipv6.org, mlxsw@mellanox.com, Ido Schimmel To: netdev@vger.kernel.org Return-path: Received: from mail-ve1eur01on0063.outbound.protection.outlook.com ([104.47.1.63]:36512 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754895AbeAIOmA (ORCPT ); Tue, 9 Jan 2018 09:42:00 -0500 In-Reply-To: <20180109144028.30133-1-idosch@mellanox.com> Sender: netdev-owner@vger.kernel.org List-ID: 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 --- net/ipv6/route.c | 4 ++-- 1 file 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) -- 2.14.3