netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: Eric Dumazet <eric.dumazet@gmail.com>,
	davem@davemloft.net, jakub.kicinski@netronome.com
Cc: netdev@vger.kernel.org, rajendra.dendukuri@broadcom.com
Subject: Re: [PATCH net v2] ipv6: Handle race in addrconf_dad_work
Date: Wed, 2 Oct 2019 17:37:52 -0600	[thread overview]
Message-ID: <1c93ce72-7a57-8b47-4074-df9e12eadaea@gmail.com> (raw)
In-Reply-To: <68b04493-1792-e6b9-e248-365f889d0964@gmail.com>

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 ...

  reply	other threads:[~2019-10-02 23:38 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-01  3:28 [PATCH net v2] ipv6: Handle race in addrconf_dad_work David Ahern
2019-10-01 18:18 ` Eric Dumazet
2019-10-02 21:08   ` Eric Dumazet
2019-10-02 21:23     ` Eric Dumazet
2019-10-02 22:13       ` David Ahern
2019-10-02 22:21         ` Eric Dumazet
2019-10-02 22:33           ` David Ahern
2019-10-02 22:36             ` Eric Dumazet
2019-10-02 23:11               ` Eric Dumazet
2019-10-02 23:37                 ` David Ahern [this message]
2019-10-03  0:10               ` David Ahern
2019-10-03  0:36                 ` Eric Dumazet
2019-10-03  2:42                   ` David Ahern
2019-10-03 15:50       ` David Ahern
2019-10-03 16:32         ` Eric Dumazet
2019-10-03 17:19           ` Eric Dumazet
2019-10-03 19:29             ` David Ahern
2019-10-02  1:45 ` David Miller
2019-10-06 11:46 ` [ipv6] 58a3c210a3: ltp.ping601.fail kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1c93ce72-7a57-8b47-4074-df9e12eadaea@gmail.com \
    --to=dsahern@gmail.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=jakub.kicinski@netronome.com \
    --cc=netdev@vger.kernel.org \
    --cc=rajendra.dendukuri@broadcom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).