From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Ahern Subject: Re: [PATCH net-next] net/ipv6: Add knob to skip DELROUTE message on device down Date: Tue, 9 Oct 2018 17:21:57 -0600 Message-ID: <3afc7ed6-cc3f-73fa-fa89-5f2467da30c1@gmail.com> References: <20181009212751.17695-1-dsahern@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: roopa@cumulusnetworks.com To: netdev@vger.kernel.org, davem@davemloft.net Return-path: Received: from mail-pg1-f196.google.com ([209.85.215.196]:35722 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725766AbeJJGlS (ORCPT ); Wed, 10 Oct 2018 02:41:18 -0400 Received: by mail-pg1-f196.google.com with SMTP id v133-v6so1568694pgb.2 for ; Tue, 09 Oct 2018 16:22:00 -0700 (PDT) In-Reply-To: <20181009212751.17695-1-dsahern@kernel.org> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 10/9/18 3:27 PM, David Ahern wrote: > From: David Ahern > > Another difference between IPv4 and IPv6 is the generation of RTM_DELROUTE > notifications when a device is taken down (admin down) or deleted. IPv4 > does not generate a message for routes evicted by the down or delete; > IPv6 does. A NOS at scale really needs to avoid these messages and have > IPv4 and IPv6 behave similarly, relying on userspace to handle link > notifications and evict the routes. > > At this point existing user behavior needs to be preserved. Since > notifications are a global action (not per app) the only way to preserve > existing behavior and allow the messages to be skipped is to add a new > sysctl (net/ipv6/route/skip_notify_on_dev_down) which can be set to > disable the notificatioons. > > IPv6 route code already supports the option to skip the message (it is > used for multipath routes for example). Besides the new sysctl we need > to pass the skip_notify setting through the generic fib6_clean and > fib6_walk functions to fib6_clean_node and to set skip_notify on calls > to __ip_del_rt for the addrconf_ifdown path. > > Signed-off-by: David Ahern > --- > Documentation/networking/ip-sysctl.txt | 8 +++++++ > include/net/addrconf.h | 3 ++- > include/net/ip6_fib.h | 3 +++ > include/net/ip6_route.h | 1 + > include/net/netns/ipv6.h | 1 + > net/ipv6/addrconf.c | 44 ++++++++++++++++++++++------------ > net/ipv6/anycast.c | 10 +++++--- > net/ipv6/ip6_fib.c | 20 ++++++++++++---- > net/ipv6/route.c | 30 ++++++++++++++++++++++- I should have noticed this before sending the patch: the addrconf and anycast changes are not needed. addrconf_ifdown calls rt6_disable_ip which calls rt6_sync_down_dev. The last one evicts all routes for the device, so the delete route calls done later in addrconf and anycast are superfluous.