All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Jiri Pirko <jpirko@redhat.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net,
	shemminger@linux-foundation.org, fubar@us.ibm.com
Subject: Re: [patch net-next-2.6 1/4] net: extend netlink interface to handle generic slave management
Date: Fri, 11 Feb 2011 16:48:19 +0100	[thread overview]
Message-ID: <4D555A43.5000005@trash.net> (raw)
In-Reply-To: <20110211152125.GA2763@psychotron.brq.redhat.com>

On 11.02.2011 16:21, Jiri Pirko wrote:
> Drivers like bridge and bonding uses their own way to manipulate with
> underlink devices. This is an attempt to introduce common interface using
> netlink.

Thanks for working on this, this has been on my TODO list for a
long time.

> --- a/include/linux/if_link.h
> +++ b/include/linux/if_link.h
> @@ -136,6 +136,9 @@ enum {
>  	IFLA_PORT_SELF,
>  	IFLA_AF_SPEC,
>  	IFLA_GROUP,		/* Group the device belongs to */
> +	IFLA_SLAVE_LIST,
> +	IFLA_SLAVE_ADD,
> +	IFLA_SLAVE_DEL,

I don't like this very much though, the attributes usually contain
data, not commands. We already have NEWLINK, DELLINK etc. on the
top level, the combinations of NEWLINK/NLM_F_CREAT and SLAVE_DEL
or DELLINK and SLAVE_ADD and so on simply don't make sense.

We usually also try to keep the interface symetrical in both
directions (a NEWLINK message from the kernel is identical to a
NEWLINK message from userspace, a DELLINK message as well besides
containing additional information), so using different attributes
for dumping slaves than for adding them seems wrong. If we can
dump all slaves in one message, it should also be possible to
enslave multiple devices using the same message.

What I originally had planned to support enslaving devices is to
make use of the IFLA_MASTER attribute. The IFLA_MASTER attribute
would contain the bond or bridge ifindex and the IFLA_IFNAME
attribute or ifindex would specify the slave device. All operations
would be performed on the slave device as usual, if the IFLA_MASTER
attribute is present we'd additionally call a master specific
callback for enslaving or releasing slave devices. Besides allowing
to keep messages symetrical, an additional benefit is that it would
be possible to create and enslave a device in a single step.



  parent reply	other threads:[~2011-02-11 15:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-11 15:21 [patch net-next-2.6 1/4] net: extend netlink interface to handle generic slave management Jiri Pirko
2011-02-11 15:22 ` [patch iproute2 2/4] implement slave management operations Jiri Pirko
2011-02-11 15:27   ` Jiri Pirko
2011-02-11 15:22 ` [patch net-next-2.6 3/4] bond: " Jiri Pirko
2011-02-11 17:19   ` Jay Vosburgh
2011-02-11 17:51     ` Jiri Pirko
2011-02-12 13:16   ` Nicolas de Pesloüan
2011-02-12 13:20     ` Jiri Pirko
2011-02-11 15:23 ` [patch net-next-2.6 4/4] bridge: " Jiri Pirko
2011-02-28 22:17   ` Stephen Hemminger
2011-02-28 22:45     ` Stephen Hemminger
2011-03-01  6:19       ` Jiri Pirko
2011-02-11 15:48 ` Patrick McHardy [this message]
2011-02-11 17:40   ` [patch net-next-2.6 1/4] net: extend netlink interface to handle generic slave management Jiri Pirko

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=4D555A43.5000005@trash.net \
    --to=kaber@trash.net \
    --cc=davem@davemloft.net \
    --cc=fubar@us.ibm.com \
    --cc=jpirko@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.