On 10/2/19 5:11 PM, Eric Dumazet wrote: > > > On 10/2/19 3:36 PM, Eric Dumazet wrote: >> >> >> On 10/2/19 3:33 PM, David Ahern wrote: > >>> >>> I flipped to IF_READY based on addrconf_ifdown and idev checks seeming >>> more appropriate. >>> >> > > Note that IF_READY is set in ipv6_add_dev() if all these conditions are true : > > if (netif_running(dev) && addrconf_link_ready(dev)) > ndev->if_flags |= IF_READY; > > So maybe in my setup IF_READY is set later from a notifier event ? >
ipv6_add_dev is called to initialize the ipv6 struct for the device. In most cases it is invoked when a device is registered (NETDEV_REGISTER in addrconf_notify). IF_READY was added by commit 3c21edbd1137 explicitly to delay DAD if the underlying link is not up (ie., carrier up not just admin up). Given that it seems appropriate to key off that flag in addrconf_dad_work. IF_READY is only set or reset under rtnl. It is set on NETDEV_UP (admin up) or NETDEV_CHANGE (e.g., carrier up) and reset for NETDEV_DOWN. The latter case is what the patch was trying to detect and bail on. Maybe dad was getting kicked off too early before (IF_READY not set) and now it stalls because of the early IF_READY check and nothing restarts it ...