From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Abeni Subject: Re: [RFC PATCH v3 01/10] udp: implement complete book-keeping for encap_needed Date: Fri, 02 Nov 2018 14:30:52 +0100 Message-ID: <889289db760143421dd097bf0ea1c5e6a15f1df7.camel@redhat.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: Network Development , David Miller , Willem de Bruijn , steffen.klassert@secunet.com, Subash Abhinov Kasiviswanathan To: Willem de Bruijn Return-path: Received: from mx1.redhat.com ([209.132.183.28]:36924 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726231AbeKBWiE (ORCPT ); Fri, 2 Nov 2018 18:38:04 -0400 In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: Hi, On Thu, 2018-11-01 at 16:59 -0400, Willem de Bruijn wrote: > On Tue, Oct 30, 2018 at 1:28 PM Paolo Abeni wrote: > > > > The *encap_needed static keys are enabled by UDP tunnels > > and several UDP encapsulations type, but they are never > > turned off. This can cause unneeded overall performance > > degradation for systems where such features are used > > transiently. > > > > This patch introduces complete book-keeping for such keys, > > decreasing the usage at socket destruction time, if needed, > > and avoiding that the same socket could increase the key > > usage multiple times. > > > > rfc v2 - rfc v3: > > - use udp_tunnel_encap_enable() in setsockopt() > > > > Signed-off-by: Paolo Abeni > > @@ -2447,7 +2452,7 @@ int udp_lib_setsockopt(struct sock *sk, int level, int optname, > > /* FALLTHROUGH */ > > case UDP_ENCAP_L2TPINUDP: > > up->encap_type = val; > > - udp_encap_enable(); > > + udp_tunnel_encap_enable(sk->sk_socket); > > this now also needs lock_sock? Yep, you are right. I'll add it in the next iteration. Thanks, Paolo