netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Phil Sutter <phil@nwl.cc>
To: David Ahern <dsahern@gmail.com>
Cc: David Miller <davem@davemloft.net>, netdev@vger.kernel.org
Subject: Re: [net-next PATCH] net: rtnetlink: Enslave device before bringing it up
Date: Wed, 29 May 2019 19:21:58 +0200	[thread overview]
Message-ID: <20190529172158.GE31548@orbyte.nwl.cc> (raw)
In-Reply-To: <e684c23a-93cc-d424-e217-e6ac2a371029@gmail.com>

On Wed, May 29, 2019 at 09:41:07AM -0600, David Ahern wrote:
> On 5/29/19 7:51 AM, Phil Sutter wrote:
> > Unlike with bridges, one can't add an interface to a bond and set it up
> > at the same time:
> > 
> > | # ip link set dummy0 down
> > | # ip link set dummy0 master bond0 up
> > | Error: Device can not be enslaved while up.
> > 
> > Of all drivers with ndo_add_slave callback, bond and team decline if
> > IFF_UP flag is set, vrf cycles the interface (i.e., sets it down and
> > immediately up again) and the others just don't care.
> > 
> > Support the common notion of setting the interface up after enslaving it
> > by sorting the operations accordingly.
> > 
> > Signed-off-by: Phil Sutter <phil@nwl.cc>
> > ---
> >  net/core/rtnetlink.c | 14 +++++++-------
> >  1 file changed, 7 insertions(+), 7 deletions(-)
> > 
> 
> I agree with the intent - enslave before up.
> 
> Not sure how likely this is, but it does break the case:
> ip li set dummy0 master bond0 down

That's right. I could allow for that by ordering the enslave and state
change dynamically, but doubt it's worth the effort. Instead of the
above I'd rather expect 'ip l s d0 nomaster down' to be a more common
use-case (which is not affected by my patch).

Thanks, Phil

  reply	other threads:[~2019-05-29 17:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-29 13:51 [net-next PATCH] net: rtnetlink: Enslave device before bringing it up Phil Sutter
2019-05-29 15:41 ` David Ahern
2019-05-29 17:21   ` Phil Sutter [this message]
2019-05-31 21:26 ` David Miller
2019-06-02 10:33   ` Phil Sutter

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=20190529172158.GE31548@orbyte.nwl.cc \
    --to=phil@nwl.cc \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --cc=netdev@vger.kernel.org \
    /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).