From patchwork Fri Oct 28 12:32:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Sitnicki X-Patchwork-Id: 688372 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3t537Q6gh2z9t0X for ; Fri, 28 Oct 2016 23:32:50 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760366AbcJ1Mcs (ORCPT ); Fri, 28 Oct 2016 08:32:48 -0400 Received: from mail-wm0-f46.google.com ([74.125.82.46]:37122 "EHLO mail-wm0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757449AbcJ1Mcm (ORCPT ); Fri, 28 Oct 2016 08:32:42 -0400 Received: by mail-wm0-f46.google.com with SMTP id 140so73769376wmv.0 for ; Fri, 28 Oct 2016 05:32:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=1j3s2VR6xstvsMRTFktQk/n+nE+ewMHqzaVG3F10Vds=; b=gc7mpcOhSKCHLd78S817W1ZmYW4eDvfOfc6NUgRJC/1jeq8SXQkgaC6g1FSA9ptHwL bru8O9dJ0nTYQ89VVhZjyvo7QAhUU8tijdqUGT25nyF3Kzen1vBr8C4KVdSfsG+m4DPh 84CyWI5114TABeVClpyURs28vdUkMinw2ws3M+MjMdYOySFSbXGBCh091SfWAIh0iXt4 Hua/RIN2Cq0SR3GOK0+aaj9DGv4hIHhvWIbcKbDhckqGv8Kgyl3IA+66DT9AWkdAM/fj CGojwLhfjHq79yc70wiw2MUxoTfMINZ+0chpwrbZhbY7r+awm4ON3du96rHyfXanYGXn 56yA== X-Gm-Message-State: ABUngvc6wbMxrDpkiWeHF491aT59t3XMh0R2wc5qn7grZrVnVWXu0if/dlEFGe0ZyZRi2Qku X-Received: by 10.28.18.11 with SMTP id 11mr3761624wms.10.1477657957761; Fri, 28 Oct 2016 05:32:37 -0700 (PDT) Received: from redhat.com ([149.6.38.86]) by smtp.gmail.com with ESMTPSA id m5sm8711709wmd.17.2016.10.28.05.32.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Oct 2016 05:32:37 -0700 (PDT) From: Jakub Sitnicki To: netdev@vger.kernel.org Cc: "David S. Miller" , Hannes Frederic Sowa , Hideaki YOSHIFUJI , Tom Herbert Subject: [PATCH net-next v2 1/5] ipv6: Fold rt6_info_hash_nhsfn() into its only caller Date: Fri, 28 Oct 2016 14:32:31 +0200 Message-Id: <1477657955-5157-2-git-send-email-jkbs@redhat.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1477657955-5157-1-git-send-email-jkbs@redhat.com> References: <1477657955-5157-1-git-send-email-jkbs@redhat.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Commit 644d0e656958 ("ipv6 Use get_hash_from_flowi6 for rt6 hash") has turned rt6_info_hash_nhsfn() into a one-liner, so it no longer makes sense to keep it around. Also the accompanying documentation comment has become outdated, so just remove it altogether. Signed-off-by: Jakub Sitnicki Acked-by: Hannes Frederic Sowa --- net/ipv6/route.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/net/ipv6/route.c b/net/ipv6/route.c index bdbc38e..0514b35 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -425,16 +425,6 @@ static bool rt6_check_expired(const struct rt6_info *rt) return false; } -/* Multipath route selection: - * Hash based function using packet header and flowlabel. - * Adapted from fib_info_hashfn() - */ -static int rt6_info_hash_nhsfn(unsigned int candidate_count, - const struct flowi6 *fl6) -{ - return get_hash_from_flowi6(fl6) % candidate_count; -} - static struct rt6_info *rt6_multipath_select(struct rt6_info *match, struct flowi6 *fl6, int oif, int strict) @@ -442,7 +432,7 @@ static struct rt6_info *rt6_multipath_select(struct rt6_info *match, struct rt6_info *sibling, *next_sibling; int route_choosen; - route_choosen = rt6_info_hash_nhsfn(match->rt6i_nsiblings + 1, fl6); + route_choosen = get_hash_from_flowi6(fl6) % (match->rt6i_nsiblings + 1); /* Don't change the route, if route_choosen == 0 * (siblings does not include ourself) */