stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Build errors in v3.10-stable-queue
@ 2015-09-26 22:20 Guenter Roeck
  2015-10-08 12:49 ` Ben Hutchings
  0 siblings, 1 reply; 4+ messages in thread
From: Guenter Roeck @ 2015-09-26 22:20 UTC (permalink / raw)
  To: stable, Greg Kroah-Hartman; +Cc: dingtianhong

drivers/net/bonding/bond_main.c: In function ‘bond_get_old_active’:
drivers/net/bonding/bond_main.c:884:33: error: macro "bond_for_each_slave" requires 3 arguments, but only 2 given
drivers/net/bonding/bond_main.c:884:2: error: ‘bond_for_each_slave’ undeclared (first use in this function)
drivers/net/bonding/bond_main.c:884:2: note: each undeclared identifier is reported only once for each function it appears in
drivers/net/bonding/bond_main.c:884:35: error: expected ‘;’ before ‘{’ token

This affects a large number of builds.

Culprit is 'bonding: correct the MAC address for "follow" fail_over_mac policy', which may need a backport.

Guenter

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Build errors in v3.10-stable-queue
  2015-09-26 22:20 Build errors in v3.10-stable-queue Guenter Roeck
@ 2015-10-08 12:49 ` Ben Hutchings
  2015-10-08 13:00   ` Willy Tarreau
  2015-10-18  0:10   ` Greg Kroah-Hartman
  0 siblings, 2 replies; 4+ messages in thread
From: Ben Hutchings @ 2015-10-08 12:49 UTC (permalink / raw)
  To: Guenter Roeck, stable, Greg Kroah-Hartman; +Cc: dingtianhong


[-- Attachment #1.1: Type: text/plain, Size: 966 bytes --]

On Sat, 2015-09-26 at 15:20 -0700, Guenter Roeck wrote:
> drivers/net/bonding/bond_main.c: In function ‘bond_get_old_active’:
> drivers/net/bonding/bond_main.c:884:33: error: macro "bond_for_each_slave" requires 3 arguments, but only 2 given
> drivers/net/bonding/bond_main.c:884:2: error: ‘bond_for_each_slave’ undeclared (first use in this function)
> drivers/net/bonding/bond_main.c:884:2: note: each undeclared identifier is reported only once for each function it appears in
> drivers/net/bonding/bond_main.c:884:35: error: expected ‘;’ before ‘{’ token
> 
> This affects a large number of builds.
> 
> Culprit is 'bonding: correct the MAC address for "follow"
> fail_over_mac policy', which may need a backport.

bond_for_each_slave() needs an int parameter for a counter.

Untested backport attached, based on what I did for 3.2.

Ben.

-- 
Ben Hutchings
Once a job is fouled up, anything done to improve it makes it worse.

[-- Attachment #1.2: bonding-correct-the-mac-address-for-follow-fail_over_mac-policy.patch --]
[-- Type: text/x-patch, Size: 2417 bytes --]

From: dingtianhong <dingtianhong@huawei.com>
Date: Thu, 16 Jul 2015 16:30:02 +0800
Subject: bonding: correct the MAC address for "follow"  fail_over_mac policy

[ Upstream commit a951bc1e6ba58f11df5ed5ddc41311e10f5fd20b ]

The "follow" fail_over_mac policy is useful for multiport devices that
either become confused or incur a performance penalty when multiple
ports are programmed with the same MAC address, but the same MAC
address still may happened by this steps for this policy:

1) echo +eth0 > /sys/class/net/bond0/bonding/slaves
   bond0 has the same mac address with eth0, it is MAC1.

2) echo +eth1 > /sys/class/net/bond0/bonding/slaves
   eth1 is backup, eth1 has MAC2.

3) ifconfig eth0 down
   eth1 became active slave, bond will swap MAC for eth0 and eth1,
   so eth1 has MAC1, and eth0 has MAC2.

4) ifconfig eth1 down
   there is no active slave, and eth1 still has MAC1, eth2 has MAC2.

5) ifconfig eth0 up
   the eth0 became active slave again, the bond set eth0 to MAC1.

Something wrong here, then if you set eth1 up, the eth0 and eth1 will have the same
MAC address, it will break this policy for ACTIVE_BACKUP mode.

This patch will fix this problem by finding the old active slave and
swap them MAC address before change active slave.

Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
Tested-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
[bwh: Backported to 3.10: bond_for_each_slave() takes an extra int paramter]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -861,6 +861,23 @@ static void bond_mc_swap(struct bonding
 	}
 }
 
+static struct slave *bond_get_old_active(struct bonding *bond,
+					 struct slave *new_active)
+{
+	struct slave *slave;
+	int i;
+
+	bond_for_each_slave(bond, slave, i) {
+		if (slave == new_active)
+			continue;
+
+		if (ether_addr_equal(bond->dev->dev_addr, slave->dev->dev_addr))
+			return slave;
+	}
+
+	return NULL;
+}
+
 /*
  * bond_do_fail_over_mac
  *
@@ -898,6 +915,9 @@ static void bond_do_fail_over_mac(struct
 		write_unlock_bh(&bond->curr_slave_lock);
 		read_unlock(&bond->lock);
 
+		if (!old_active)
+			old_active = bond_get_old_active(bond, new_active);
+
 		if (old_active) {
 			memcpy(tmp_mac, new_active->dev->dev_addr, ETH_ALEN);
 			memcpy(saddr.sa_data, old_active->dev->dev_addr,

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Build errors in v3.10-stable-queue
  2015-10-08 12:49 ` Ben Hutchings
@ 2015-10-08 13:00   ` Willy Tarreau
  2015-10-18  0:10   ` Greg Kroah-Hartman
  1 sibling, 0 replies; 4+ messages in thread
From: Willy Tarreau @ 2015-10-08 13:00 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: Guenter Roeck, stable, Greg Kroah-Hartman, dingtianhong

On Thu, Oct 08, 2015 at 01:49:32PM +0100, Ben Hutchings wrote:
> On Sat, 2015-09-26 at 15:20 -0700, Guenter Roeck wrote:
> > drivers/net/bonding/bond_main.c: In function ???bond_get_old_active???:
> > drivers/net/bonding/bond_main.c:884:33: error: macro "bond_for_each_slave" requires 3 arguments, but only 2 given
> > drivers/net/bonding/bond_main.c:884:2: error: ???bond_for_each_slave??? undeclared (first use in this function)
> > drivers/net/bonding/bond_main.c:884:2: note: each undeclared identifier is reported only once for each function it appears in
> > drivers/net/bonding/bond_main.c:884:35: error: expected ???;??? before ???{??? token
> > 
> > This affects a large number of builds.
> > 
> > Culprit is 'bonding: correct the MAC address for "follow"
> > fail_over_mac policy', which may need a backport.
> 
> bond_for_each_slave() needs an int parameter for a counter.
> 
> Untested backport attached, based on what I did for 3.2.

I agree with the fix, it's similar to what I proposed (except that
you actually did the patch of course).

Willy


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Build errors in v3.10-stable-queue
  2015-10-08 12:49 ` Ben Hutchings
  2015-10-08 13:00   ` Willy Tarreau
@ 2015-10-18  0:10   ` Greg Kroah-Hartman
  1 sibling, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2015-10-18  0:10 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: Guenter Roeck, stable, dingtianhong

On Thu, Oct 08, 2015 at 01:49:32PM +0100, Ben Hutchings wrote:
> On Sat, 2015-09-26 at 15:20 -0700, Guenter Roeck wrote:
> > drivers/net/bonding/bond_main.c: In function ‘bond_get_old_active’:
> > drivers/net/bonding/bond_main.c:884:33: error: macro "bond_for_each_slave" requires 3 arguments, but only 2 given
> > drivers/net/bonding/bond_main.c:884:2: error: ‘bond_for_each_slave’ undeclared (first use in this function)
> > drivers/net/bonding/bond_main.c:884:2: note: each undeclared identifier is reported only once for each function it appears in
> > drivers/net/bonding/bond_main.c:884:35: error: expected ‘;’ before ‘{’ token
> > 
> > This affects a large number of builds.
> > 
> > Culprit is 'bonding: correct the MAC address for "follow"
> > fail_over_mac policy', which may need a backport.
> 
> bond_for_each_slave() needs an int parameter for a counter.
> 
> Untested backport attached, based on what I did for 3.2.

Thanks, now applied.

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-10-18  0:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-26 22:20 Build errors in v3.10-stable-queue Guenter Roeck
2015-10-08 12:49 ` Ben Hutchings
2015-10-08 13:00   ` Willy Tarreau
2015-10-18  0:10   ` Greg Kroah-Hartman

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