Re: unregister_netdevice: waiting for eth0 to become free. Usage count = 1

2017-08-13 Thread David Ahern
On 8/12/17 1:42 PM, Wei Wang wrote: > Hi Ido, > >>> - if ((rt->dst.dev == dev || !dev) && >>> + if ((rt->dst.dev == dev || !dev || >>> + rt->rt6i_idev->dev == dev) && >> >> Can you please explain why this line is needed? While host routes aren't >> removed from the FIB by

Re: unregister_netdevice: waiting for eth0 to become free. Usage count = 1

2017-08-11 Thread David Ahern
On 8/11/17 6:25 PM, Wei Wang wrote: > By "a patch to fix that" do you mean after your patch, for every rt6, > rt6->rt6i_idev will be the same as rt6->dst.dev? FIB entries should have them the same device with my patch. The copies done (ip6_rt_cache_alloc and ip6_rt_pcpu_alloc) will have to set

Re: unregister_netdevice: waiting for eth0 to become free. Usage count = 1

2017-08-11 Thread David Ahern
On 8/11/17 6:10 PM, Wei Wang wrote: > I think we have a potential fix for this issue. > Martin and I found that when addrconf_dst_alloc() creates a rt6, it is > possible that rt6->dst.dev points to loopback device while > rt6->rt6i_idev->dev points to a real device. > When the real device goes

Re: unregister_netdevice: waiting for eth0 to become free. Usage count = 1

2017-08-13 Thread David Ahern
On 8/13/17 2:56 PM, Wei Wang wrote: >> Looking at my patch to move host routes from loopback to device with the >> address, I have this: >> >> @@ -2789,7 +2808,8 @@ static int fib6_ifdown(struct rt6_info *rt, void *arg) >> const struct arg_dev_net *adn = arg; >> const struct