From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752234AbdLGWLz (ORCPT ); Thu, 7 Dec 2017 17:11:55 -0500 Received: from mail-it0-f68.google.com ([209.85.214.68]:40077 "EHLO mail-it0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750895AbdLGWLx (ORCPT ); Thu, 7 Dec 2017 17:11:53 -0500 X-Google-Smtp-Source: AGs4zMZrflA82aqCEwengNy/a4NOHjjxjY47WTcp8WwuvGUILMKQ+uwGBilWRd1xMLNMJek+Gqt+xw== Message-ID: <1512684709.25033.18.camel@gmail.com> Subject: Re: [PATCH net-next V3] tun: add eBPF based queue selection method From: Eric Dumazet To: Jason Wang , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: mst@redhat.com, willemdebruijn.kernel@gmail.com, tom@herbertland.com, aconole@redhat.com, wexu@redhat.com Date: Thu, 07 Dec 2017 14:11:49 -0800 In-Reply-To: <1512379883-11887-1-git-send-email-jasowang@redhat.com> References: <1512379883-11887-1-git-send-email-jasowang@redhat.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.6-1+deb9u1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2017-12-04 at 17:31 +0800, Jason Wang wrote: > This patch introduces an eBPF based queue selection method. With > this, > the policy could be offloaded to userspace completely through a new > ioctl TUNSETSTEERINGEBPF. Sorry for the delay, I see this patch was merged already. ... >  static void tun_free_netdev(struct net_device *dev) >  { >   struct tun_struct *tun = netdev_priv(dev); > @@ -1996,6 +2068,9 @@ static void tun_free_netdev(struct net_device > *dev) >   free_percpu(tun->pcpu_stats); >   tun_flow_uninit(tun); >   security_tun_dev_free_security(tun->security); > + rtnl_lock(); > + __tun_set_steering_ebpf(tun, NULL); > + rtnl_unlock(); >  } I am pretty sure tun_free_netdev() (aka ->priv_destructor()) can be called under RTNL (say from register_netdevice()) So this will dead lock badly ?