Thread (8 messages) 8 messages, 4 authors, 2017-12-08

Re: [PATCH net-next V3] tun: add eBPF based queue selection method

flat view

From: Jason Wang <hidden>
Date: 2017-12-08 02:25:32
Also in: lkml


On 2017年12月08日 06:11, Eric Dumazet wrote:
On Mon, 2017-12-04 at 17:31 +0800, Jason Wang wrote:
quoted
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.

...
quoted
  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 ?
Unfortunately yes. Will switch to use spinlock (tun->lock) to synchronize here.

Thanks
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help