From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 47527C282CE for ; Tue, 9 Apr 2019 21:41:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 12A2B2133D for ; Tue, 9 Apr 2019 21:41:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554846100; bh=TGUOxR5d5l4LGU3Zdo9S9bCALCOzDGscUSlz6xPkOFE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=PSbaTN0qJ9eDqIMLafGqJ5Xqn089l2NHv1944EJhAt4N+IAzPgdKAnra8/fRmWoba QzGvFLchSAl9Y+XwsBwhWF9ojRChxfcWFx1nuUt71Efa2uXf8XjON0WiP8o0oayRc8 Ceuzup1Kfgu/kt+HIvpBYWkJ+e0ZDGphkY1NB7s8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727105AbfDIVli (ORCPT ); Tue, 9 Apr 2019 17:41:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:56024 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726739AbfDIVlA (ORCPT ); Tue, 9 Apr 2019 17:41:00 -0400 Received: from kenny.it.cumulusnetworks.com. (fw.cumulusnetworks.com [216.129.126.126]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6365C217F4; Tue, 9 Apr 2019 21:40:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554846059; bh=TGUOxR5d5l4LGU3Zdo9S9bCALCOzDGscUSlz6xPkOFE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YBfoLJAK+SnMvRNhLOruWb2swyA/VQswFQkbbiwgRGoi3Kt4piIE70ahUjf2LNLHJ NlMUbuuZSwAMak+KU52+BrAiTgtEzqot0FT5CuMwX+DlLiBpuVZhXZLjT9Oew6nzXm GBDREWfFadJLTqMn3s+0+4VlSdlXx+FBscCyjX0g= From: David Ahern To: davem@davemloft.net, netdev@vger.kernel.org Cc: idosch@mellanox.com, David Ahern Subject: [PATCH net-next 03/10] ipv6: Change rt6_probe to take a fib6_nh Date: Tue, 9 Apr 2019 14:41:12 -0700 Message-Id: <20190409214119.15258-4-dsahern@kernel.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190409214119.15258-1-dsahern@kernel.org> References: <20190409214119.15258-1-dsahern@kernel.org> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: David Ahern rt6_probe sends probes for gateways in a nexthop. As such it really depends on a fib6_nh, not a fib entry. Move last_probe to fib6_nh and update rt6_probe to a fib6_nh struct. Signed-off-by: David Ahern --- include/net/ip6_fib.h | 8 ++++---- net/ipv6/route.c | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h index 58dbb4e82908..2e9235adfa0d 100644 --- a/include/net/ip6_fib.h +++ b/include/net/ip6_fib.h @@ -127,6 +127,10 @@ struct rt6_exception { struct fib6_nh { struct fib_nh_common nh_common; + +#ifdef CONFIG_IPV6_ROUTER_PREF + unsigned long last_probe; +#endif }; struct fib6_info { @@ -155,10 +159,6 @@ struct fib6_info { struct rt6_info * __percpu *rt6i_pcpu; struct rt6_exception_bucket __rcu *rt6i_exception_bucket; -#ifdef CONFIG_IPV6_ROUTER_PREF - unsigned long last_probe; -#endif - u32 fib6_metric; u8 fib6_protocol; u8 fib6_type; diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 9630339d4b76..c2b0d6f049e3 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -517,7 +517,7 @@ static void rt6_probe_deferred(struct work_struct *w) kfree(work); } -static void rt6_probe(struct fib6_info *rt) +static void rt6_probe(struct fib6_nh *fib6_nh) { struct __rt6_probe_work *work = NULL; const struct in6_addr *nh_gw; @@ -533,11 +533,11 @@ static void rt6_probe(struct fib6_info *rt) * Router Reachability Probe MUST be rate-limited * to no more than one per minute. */ - if (!rt || !rt->fib6_nh.fib_nh_gw_family) + if (fib6_nh->fib_nh_gw_family) return; - nh_gw = &rt->fib6_nh.fib_nh_gw6; - dev = rt->fib6_nh.fib_nh_dev; + nh_gw = &fib6_nh->fib_nh_gw6; + dev = fib6_nh->fib_nh_dev; rcu_read_lock_bh(); idev = __in6_dev_get(dev); neigh = __ipv6_neigh_lookup_noref(dev, nh_gw); @@ -554,13 +554,13 @@ static void rt6_probe(struct fib6_info *rt) __neigh_set_probe_once(neigh); } write_unlock(&neigh->lock); - } else if (time_after(jiffies, rt->last_probe + + } else if (time_after(jiffies, fib6_nh->last_probe + idev->cnf.rtr_probe_interval)) { work = kmalloc(sizeof(*work), GFP_ATOMIC); } if (work) { - rt->last_probe = jiffies; + fib6_nh->last_probe = jiffies; INIT_WORK(&work->work, rt6_probe_deferred); work->target = *nh_gw; dev_hold(dev); @@ -572,7 +572,7 @@ static void rt6_probe(struct fib6_info *rt) rcu_read_unlock_bh(); } #else -static inline void rt6_probe(struct fib6_info *rt) +static inline void rt6_probe(struct fib6_nh *fib6_nh) { } #endif @@ -657,7 +657,7 @@ static struct fib6_info *find_match(struct fib6_info *rt, int oif, int strict, } if (strict & RT6_LOOKUP_F_REACHABLE) - rt6_probe(rt); + rt6_probe(&rt->fib6_nh); /* note that m can be RT6_NUD_FAIL_PROBE at this point */ if (m > *mpri) { -- 2.11.0