From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jakub Sitnicki Subject: Re: [RFC net-next] ipv4: Don't promote secondaries when flushing addresses Date: Thu, 7 Jun 2018 14:17:50 +0200 Message-ID: <20180607141750.434f6201@beetle> References: <20180607101301.30439-1-jkbs@redhat.com> <20180607110029.vt6tqwlqmuotwpxf@unicorn.suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org To: Michal Kubecek Return-path: Received: from mail-wm0-f66.google.com ([74.125.82.66]:34855 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753076AbeFGMRz (ORCPT ); Thu, 7 Jun 2018 08:17:55 -0400 Received: by mail-wm0-f66.google.com with SMTP id j15-v6so18772393wme.0 for ; Thu, 07 Jun 2018 05:17:54 -0700 (PDT) In-Reply-To: <20180607110029.vt6tqwlqmuotwpxf@unicorn.suse.cz> Sender: netdev-owner@vger.kernel.org List-ID: On Thu, 7 Jun 2018 13:00:29 +0200 Michal Kubecek wrote: > On Thu, Jun 07, 2018 at 12:13:01PM +0200, Jakub Sitnicki wrote: > > Promoting secondary addresses on address removal makes flushing all > > addresses from a device with 1000's of them slow. This is because we > > cannot take down the secondary addresses when we are removing the > > primary one, which would make it faster. > > > > However, the userspace, when performing a flush, will in the end remove > > all the addresses regardless of secondary address promotion taking > > place. Unfortunately the kernel currently cannot distinguish between a > > single address removal and a flush of all addresses. > > > > To help with this case introduce a IFA_F_FLUSH flag that can be used by > > userspace to signal that a removal operation is being done because of a > > flush. When the flag is set, don't bother with secondary address > > promotion as we expect that secondary addresses will be removed soon as > > well. > > Unless you intend to use the flag to allow deleting a specific address > with its secondaries (overriding promote_secondaries), maybe it would > be more practical to go even further and delete all addresses on the > interface if IFA_F_FLUSH is set so that userspace could delete all > addresses with one request. Thanks for input, Michal. The intend as I understand it is to make flushing all the addresses fast(er). Let me see if I can rework it according to your suggestion. It does make more sense to do it like that to me too. Thanks, Jakub