From patchwork Wed Aug 23 07:58:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Sitnicki X-Patchwork-Id: 804874 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3xcfvL292Bz9sNd for ; Wed, 23 Aug 2017 17:58:54 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753549AbdHWH6w (ORCPT ); Wed, 23 Aug 2017 03:58:52 -0400 Received: from mail-wm0-f47.google.com ([74.125.82.47]:38115 "EHLO mail-wm0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753420AbdHWH6k (ORCPT ); Wed, 23 Aug 2017 03:58:40 -0400 Received: by mail-wm0-f47.google.com with SMTP id l19so9702945wmi.1 for ; Wed, 23 Aug 2017 00:58:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=qkfg3SIbPv+YueDt65z7WDGCK0XMXqBd6TbB92u23mE=; b=r2g6stuHH6PZq8Ce7m7vj1cwCRBVWITWOh5oqAxTcxE/TWgfW3SHMR4kWpHEOJlU5V 9+htN7E2B3hdFsZ2Q/h4g3/fZjNQXR9K9U3T7z0jlDLGDYKRTw5xB2+RBRogw3MHpVis TsIVjJG6fJh8QBbthCGVEUmqP3z+ftlqrLnLOuYIlAy8cJyVNUGPQJIpIeQiWoIfatQM C+zxqUuiswSS2evY8B/jWjzD3cwx3sJ3Rq32R6OEWjPUfAu2uE/1uxd0RgqYzqc90i0g yk6GgOINE+AF8//x3SZXaG2qw24nFseJruHhfpbjngZveUgXEeOmiDPmwaCorUag/gmH 11kA== X-Gm-Message-State: AHYfb5jIDnoIFPj88TQED4eExy8lvNM/cCDbCfUHwB7tX0kEpJFbPYuW yqq5flEmUYlC1FiEjYh32w== X-Received: by 10.28.178.130 with SMTP id b124mr1251567wmf.164.1503475119018; Wed, 23 Aug 2017 00:58:39 -0700 (PDT) Received: from redhat.com (red-hat-inc.vlan404.asr1.mad1.gblx.net. [64.215.113.190]) by smtp.gmail.com with ESMTPSA id i67sm788212wri.83.2017.08.23.00.58.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 23 Aug 2017 00:58:38 -0700 (PDT) From: Jakub Sitnicki To: netdev@vger.kernel.org Cc: "David S. Miller" , Hannes Frederic Sowa , Nikolay Aleksandrov , Tom Herbert Subject: [PATCH net-next v3 3/4] ipv6: Fold rt6_info_hash_nhsfn() into its only caller Date: Wed, 23 Aug 2017 09:58:30 +0200 Message-Id: <20170823075831.27031-4-jkbs@redhat.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170823075831.27031-1-jkbs@redhat.com> References: <20170823075831.27031-1-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 remove the accompanying comment that has become outdated. Signed-off-by: Jakub Sitnicki --- 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 6c4dd57..246e7d7 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -445,16 +445,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) @@ -462,7 +452,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) */