netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jay Vosburgh <fubar@us.ibm.com>
To: =?ISO-8859-1?Q?Nicolas_de_Peslo=FCan?= <nicolas.2p.debian@gmail.com>
Cc: Jiri Bohac <jbohac@suse.cz>,
	"bonding-devel@lists.sourceforge.net"
	<bonding-devel@lists.sourceforge.net>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: Bonding on bond
Date: Thu, 20 Jan 2011 11:53:13 -0800	[thread overview]
Message-ID: <4202.1295553193@death> (raw)
In-Reply-To: <4D385F0B.1010000@gmail.com>

Nicolas de Pesloüan 	<nicolas.2p.debian@gmail.com> wrote:

>Le 20/01/2011 16:31, Jiri Bohac a écrit :
>> On Wed, Jan 19, 2011 at 09:33:19PM +0100, Nicolas de Pesloüan wrote:
>>> Even if it is possible to test for slave and for master with a
>>> single condition (IFF_BONDING), I suggest to split the tests and the
>>> error messages, to give end user the best possible diagnostic.
>>
>> OK, why not. The below patch still uses IFF_BONDING to detect a
>> master is being enslaved, because IFF_MASTER is also used by the
>> eql driver. No idea if it works / someone ever uses it with
>> bonding, but it might collide.
>
>Thanks Jiri.
>
>> bonding: prohibit enslaving of bonding masters
>>
>> Nested bonding is not supported and will result in strange problems, e.g.:
>> - netif_receive_skb() will not properly change skb->dev to point to the
>>    uppoer-most bonding master
>> - arp monitor will not work (dev->last_rx is only updated by hardware drivers)
>> - accidentally enslaving a bonding master to itself will cause an infinite
>>    recursion in the TX path

	Did you test these?  I'm curious about the ARP monitor
assertion, because last_rx is updated by bonding itself now (in
skb_bond_should_drop), not in the device drivers.

	I'm in agreement that, by and large, nesting of bonds is
pointless.  However, I suspect that there are users out in the world who
are happily doing so, and this patch may shut them down.

	I've not tested with nesting in a while; I know it used to work
(at least for limited cases, typically an active-backup bond with a pair
of balance-xor or balance-rr or sometimes 802.3ad enslaved to it), but
has never really been a deliberate feature.  Is nesting now utterly
broken, as suggested by the list of problems above?

>> This patch prevents this by prohibiting a bonding master from being further enslaved.
>>
>> Signed-off-by: Jiri Bohac<jbohac@suse.cz>
>
>Reviewed-by: Nicolas de Pesloüan <nicolas.2p.debian@free.fr>

	If nesting really doesn't work and is going to be disabled, then
at a minimum it should also have an update to the documentation
explaining this.

	-J

>> diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
>> index b1025b8..b117dd8 100644
>> --- a/drivers/net/bonding/bond_main.c
>> +++ b/drivers/net/bonding/bond_main.c
>> @@ -1453,6 +1453,12 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
>>   		return -EBUSY;
>>   	}
>>
>> +	/* cannot enslave a master */
>> +	if (slave_dev->priv_flags&  IFF_BONDING) {
>> +		pr_debug("Error, cannot enslave a bonding master\n");
>> +		return -EBUSY;
>> +	}
>> +
>>   	/* vlan challenged mutual exclusion */
>>   	/* no need to lock since we're protected by rtnl_lock */
>>   	if (slave_dev->features&  NETIF_F_VLAN_CHALLENGED) {
>>

---
	-Jay Vosburgh, IBM Linux Technology Center, fubar@us.ibm.com

  reply	other threads:[~2011-01-20 19:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-19 20:33 Bonding on bond Nicolas de Pesloüan
2011-01-20 15:31 ` Jiri Bohac
2011-01-20 16:12   ` Nicolas de Pesloüan
2011-01-20 19:53     ` Jay Vosburgh [this message]
2011-01-22 22:57       ` Nicolas de Pesloüan
2011-01-29  0:38         ` Jay Vosburgh
2011-02-02 10:19           ` Nicolas de Pesloüan

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=4202.1295553193@death \
    --to=fubar@us.ibm.com \
    --cc=bonding-devel@lists.sourceforge.net \
    --cc=jbohac@suse.cz \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.2p.debian@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;
as well as URLs for NNTP newsgroup(s).