I'll have a look at this.. Maybe it will work, I'll have to try it and test it to see if there are any gotchas that are not obvious.
d On Wed, Oct 10, 2018 at 7:51 PM Ferruh Yigit <ferruh.yi...@intel.com> wrote: > >> Very simply, what about prevent kni_net_release() send callback to > >> userspace? > > > > No, because how is the DPDK application going to know when the user > > does 'ip link set down dev <kniX>'? It's important for the DPDK > > application to know when the KNI interface is marked down. > > I mean kni_net_release() called because of unregister_netdev(), > > it is possible to set a flag in kni_dev_remove(), before unregister_netdev(), > and in kni_net_release() don't call kni_net_process_request() if flag is set. > > Looks like it can work and only a few lines of code, what do you think? > > > > >> This is already not working and removing it resolves the issues you > >> mentioned. > > > > Huh? How is it not working? Of course it works. > > The kni_net_release() called because of unregister_netdev() is not working, as > you explained in userspace the thread handles request already terminated, even > if not in kernel side response not received and timed off because of lock... > > > > >> Sample application calls rte_eth_dev_stop() after release itself, so > >> behavior > >> will be same. > > > > Huh? > > in kni sample app, in kni_free_kni() rte_eth_dev_stop() is called after > rte_kni_release(). > So if you prevent kni_net_release() called because of unregister_netdev() to > send callback it won't be problem because of existing rte_eth_dev_stop() >