Re: [PATCH bpf v2] xdp: fix hang while unregistering device bound to xdp socket

2019-06-10 Thread Ilya Maximets
On 10.06.2019 11:05, Ilya Maximets wrote: > On 08.06.2019 2:31, Jakub Kicinski wrote: >> On Fri, 7 Jun 2019 20:31:43 +0300, Ilya Maximets wrote: >>> +static int xsk_notifier(struct notifier_block *this, >>> + unsigned long msg, void *ptr) >>> +{ >>> + struct sock *sk; >>> + s

Re: [PATCH bpf v2] xdp: fix hang while unregistering device bound to xdp socket

2019-06-10 Thread Ilya Maximets
On 08.06.2019 2:31, Jakub Kicinski wrote: > On Fri, 7 Jun 2019 20:31:43 +0300, Ilya Maximets wrote: >> +static int xsk_notifier(struct notifier_block *this, >> +unsigned long msg, void *ptr) >> +{ >> +struct sock *sk; >> +struct net_device *dev = netdev_notifier_info_to

Re: [PATCH bpf v2] xdp: fix hang while unregistering device bound to xdp socket

2019-06-07 Thread Jakub Kicinski
On Fri, 7 Jun 2019 20:31:43 +0300, Ilya Maximets wrote: > +static int xsk_notifier(struct notifier_block *this, > + unsigned long msg, void *ptr) > +{ > + struct sock *sk; > + struct net_device *dev = netdev_notifier_info_to_dev(ptr); > + struct net *net = dev_net(d

[PATCH bpf v2] xdp: fix hang while unregistering device bound to xdp socket

2019-06-07 Thread Ilya Maximets
Device that bound to XDP socket will not have zero refcount until the userspace application will not close it. This leads to hang inside 'netdev_wait_allrefs()' if device unregistering requested: # ip link del p1 < hang on recvmsg on netlink socket > # ps -x | grep ip 5126 pts/0D+