From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
To: Cong Wang <xiyou.wangcong@gmail.com>
Cc: David Miller <davem@davemloft.net>,
Linux Kernel Network Developers <netdev@vger.kernel.org>,
Hongjun Li <hongjun.li@6wind.com>
Subject: Re: [PATCH net] ip[6]: don't register inet[6]dev when dev is down
Date: Fri, 7 Jul 2017 14:39:08 +0200 [thread overview]
Message-ID: <dc593730-11ff-5fee-b3c4-ce6ebeb2926f@6wind.com> (raw)
In-Reply-To: <CAM_iQpXMR6RmJX52=7qrGVKopvGCiabS2sUOCf2Dvjhe4wLAzA@mail.gmail.com>
Le 06/07/2017 à 20:16, Cong Wang a écrit :
> On Thu, Jul 6, 2017 at 5:08 AM, Nicolas Dichtel
> <nicolas.dichtel@6wind.com> wrote:
>> Le 06/07/2017 à 00:43, Cong Wang a écrit :
>>> On Wed, Jul 5, 2017 at 8:57 AM, Nicolas Dichtel
>>> <nicolas.dichtel@6wind.com> wrote:
>>>> When a device changes from one netns to another, it's first unregistered,
>>>> then the netns reference is updated and the dev is registered in the new
>>>> netns. Thus, when a slave moves to another netns, it is first
>>>> unregistered. This triggers a NETDEV_UNREGISTER event which is caught by
>>>> the bonding driver. The driver calls bond_release(), which calls
>>>> dev_set_mtu() and thus triggers NETDEV_CHANGEMTU (the device is still in
>>>> the old netns).
>>>
>>> I think in this special case it is meaningless to send
>>> NETDEV_CHANGEMTU, because the device is dying within
>>> its old netns, who still cares about its mtu change?
>>>
>>> Something like the attached patch...
>> Yes, your patch seems good and I hesitated with something like this.
>> But I don't see a valid case where the inet[6]dev must be created on a down
>> interface. I think the patch is valid, even with your patch.
>
> Your patch is more risky because it affects normal CHANGEMTU path,
> I am not sure if it is correct to not to add idev when it is down either.
Why would it be needed to add this idev on a down interface?
If idev wasn't there I don't see why changing the mtu would justify to create
this idev.
>
> This is a very unusual path, we don't have to take the risk.
I still think that this approach is better for two reasons:
- we don't know if another path like this exists (need an audit) and it would
be easy to add one again by side effect in the future;
- the patch is easy to backport in older kernel.
Regards,
Nicolas
next prev parent reply other threads:[~2017-07-07 12:39 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-05 15:57 [PATCH net] ip[6]: don't register inet[6]dev when dev is down Nicolas Dichtel
2017-07-05 22:43 ` Cong Wang
2017-07-06 12:08 ` Nicolas Dichtel
2017-07-06 18:16 ` Cong Wang
2017-07-07 12:39 ` Nicolas Dichtel [this message]
2017-07-08 18:56 ` Cong Wang
2017-07-10 8:20 ` Nicolas Dichtel
2017-07-08 10:02 ` David Miller
2017-07-08 18:44 ` Cong Wang
2017-07-10 8:19 ` Nicolas Dichtel
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=dc593730-11ff-5fee-b3c4-ce6ebeb2926f@6wind.com \
--to=nicolas.dichtel@6wind.com \
--cc=davem@davemloft.net \
--cc=hongjun.li@6wind.com \
--cc=netdev@vger.kernel.org \
--cc=xiyou.wangcong@gmail.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