From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eyal Birger Subject: Re: xfrm, ip tunnel: non released device reference upon device unregistration Date: Mon, 12 Feb 2018 13:54:39 +0200 Message-ID: <20180212135439.52bd5746@jimi> References: <20180204132118.6fef9bf0@jimi> <20180206125624.GE15427@breakpoint.cc> <20180206130937.blxbrhmkpe3kt6lh@gauss3.secunet.de> <20180206131509.GA14261@breakpoint.cc> <20180206211946.217783da@jimi> <20180211154648.GA24719@breakpoint.cc> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Steffen Klassert , netdev@vger.kernel.org, herbert@gondor.apana.org.au, davem@davemloft.net, shmulik@metanetworks.com To: Florian Westphal Return-path: Received: from mail-wr0-f169.google.com ([209.85.128.169]:39100 "EHLO mail-wr0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933898AbeBLLyp (ORCPT ); Mon, 12 Feb 2018 06:54:45 -0500 Received: by mail-wr0-f169.google.com with SMTP id w77so396223wrc.6 for ; Mon, 12 Feb 2018 03:54:45 -0800 (PST) In-Reply-To: <20180211154648.GA24719@breakpoint.cc> Sender: netdev-owner@vger.kernel.org List-ID: On Sun, 11 Feb 2018 16:46:48 +0100 Florian Westphal wrote: > Eyal Birger wrote: > > Sorry for taking so long to respond. > > > On Tue, 6 Feb 2018 14:15:09 +0100 > > Florian Westphal wrote: > > > > > Steffen Klassert wrote: > > > > I gave the patch a quick try, but still I get this: > > > > > > > > unregister_netdevice: waiting for dummy1 to become free. Usage > > > > count = 2 > > > > > > Was that with Eyals setup or the bridge one I posted? > > > > > > If it was Eyals setup, its possible the patch missed hookup > > > to whatever tunnel infra is used (the setup I used has ipip > > > tunnel, everything is ipv4). > > > > > > > Thanks! > > > > Indeed the setup I'm testing uses ip6_tunnel. > > I have tested a fix in the spirit of the patch and it looks valid > > for ip6_tunnel as well. > > > > It looks though that this change would need to be added to any > > tunnel device using dst_cache (vxlan, geneve, gre, ...). > > Yes. Meanwhile I tested your patch and it works for me too. > As your patch is shorter and ipv4/ipv6 seem to take care of refcount > put just fine I think your patch is the right way to go. > > The xfrm_dst size incrase isn't much of a big deal, there is ample of > padding at the end so it will still be allocated from same slab. > > We could reduce num_pols and num_xfrms to u8, which creates a 16 bit > hole, then store the cpu number instead of a list pointer. > > This would limit growth to 16 instead of 24. > > But, as I said, i do not think its a big deal. > > > I'm wondering - non-xfrm dsts are already correctly invalidated, > > so do you think it makes sense to invalidate caches for devices that > > have no xfrm dsts? or maybe I didn't understand the suggestion? > > See above, I think your patch is the way to go. Ok, thanks. Will submit a formal patch. Eyal.