netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 net 0/6] net/core, bonding: dev_uc_sync fixes, bonding update
@ 2013-05-31 21:57 Jay Vosburgh
  2013-05-31 21:57 ` [PATCH v2 net 1/6] net/core: __hw_addr_create_ex does not initialize sync_cnt Jay Vosburgh
                   ` (7 more replies)
  0 siblings, 8 replies; 12+ messages in thread
From: Jay Vosburgh @ 2013-05-31 21:57 UTC (permalink / raw)
  To: netdev; +Cc: David Miller

	This patch set includes 6 patches: four fixes to the dev_mc_sync /
dev_mc_unsync system; and two patches to bonding, one to utilize the sync
/ unsync functions, and another minor fix.

	A brief description of each patch:

	1. uninitialized variable in __hw_addr_create_ex

	2. __hw_addr_unsync_one does not work because "from" addresses
		aren't marked as "synced."

	3. __hw_addr_sync_one as called by __hw_addr_sync_multiple will
		not remove references properly

	4. dev_mc_sync_multiple doesn't call the _multiple helper function

	5. Convert bonding to use dev_{mc,uc}_sync / unsync

	6. Disallow changes of bonding MAC if fail_over_mac is set to
		"follow".

V2: 

	Rebased to net

	Patch 5 is changed: fixed a logic error in bond_set_rx_mode.

	-J

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

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

* [PATCH v2 net 1/6] net/core: __hw_addr_create_ex does not initialize sync_cnt
  2013-05-31 21:57 [PATCH v2 net 0/6] net/core, bonding: dev_uc_sync fixes, bonding update Jay Vosburgh
@ 2013-05-31 21:57 ` Jay Vosburgh
  2013-05-31 21:57 ` [PATCH v2 net 2/6] net/core: __hw_addr_unsync_one "from" address not marked synced Jay Vosburgh
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: Jay Vosburgh @ 2013-05-31 21:57 UTC (permalink / raw)
  To: netdev; +Cc: David Miller, Vlad Yasevich

	The sync_cnt field is not being initialized, which can result
in arbitrary values in the field.  Fixed by initializing it to zero.

Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Cc: Vlad Yasevich <vyasevic@redhat.com> 

---
 net/core/dev_addr_lists.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/net/core/dev_addr_lists.c b/net/core/dev_addr_lists.c
index c013f38..1f919d9 100644
--- a/net/core/dev_addr_lists.c
+++ b/net/core/dev_addr_lists.c
@@ -39,6 +39,7 @@ static int __hw_addr_create_ex(struct netdev_hw_addr_list *list,
 	ha->refcount = 1;
 	ha->global_use = global;
 	ha->synced = sync;
+	ha->sync_cnt = 0;
 	list_add_tail_rcu(&ha->list, &list->list);
 	list->count++;
 
-- 
1.7.1

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

* [PATCH v2 net 2/6] net/core: __hw_addr_unsync_one "from" address not marked synced
  2013-05-31 21:57 [PATCH v2 net 0/6] net/core, bonding: dev_uc_sync fixes, bonding update Jay Vosburgh
  2013-05-31 21:57 ` [PATCH v2 net 1/6] net/core: __hw_addr_create_ex does not initialize sync_cnt Jay Vosburgh
@ 2013-05-31 21:57 ` Jay Vosburgh
  2013-05-31 21:57 ` [PATCH v2 net 3/6] net/core: __hw_addr_sync_one / _multiple broken Jay Vosburgh
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: Jay Vosburgh @ 2013-05-31 21:57 UTC (permalink / raw)
  To: netdev; +Cc: David Miller, Vlad Yasevich

	When an address is added to a subordinate interface (the "to"
list), the address entry in the "from" list is not marked "synced" as
the entry added to the "to" list is.

	When performing the unsync operation (e.g., dev_mc_unsync),
__hw_addr_unsync_one calls __hw_addr_del_entry with the "synced"
parameter set to true for the case when the address reference is being
released from the "from" list.  This causes a test inside to fail,
with the result being that the reference count on the "from" address
is not properly decremeted and the address on the "from" list will
never be freed.

	Correct this by having __hw_addr_unsync_one call the
__hw_addr_del_entry function with the "sync" flag set to false for the
"remove from the from list" case.

Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Cc: Vlad Yasevich <vyasevic@redhat.com>

---
 net/core/dev_addr_lists.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/net/core/dev_addr_lists.c b/net/core/dev_addr_lists.c
index 1f919d9..c858e81 100644
--- a/net/core/dev_addr_lists.c
+++ b/net/core/dev_addr_lists.c
@@ -160,7 +160,8 @@ static void __hw_addr_unsync_one(struct netdev_hw_addr_list *to_list,
 	if (err)
 		return;
 	ha->sync_cnt--;
-	__hw_addr_del_entry(from_list, ha, false, true);
+	/* address on from list is not marked synced */
+	__hw_addr_del_entry(from_list, ha, false, false);
 }
 
 static int __hw_addr_sync_multiple(struct netdev_hw_addr_list *to_list,
-- 
1.7.1

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

* [PATCH v2 net 3/6] net/core: __hw_addr_sync_one / _multiple broken
  2013-05-31 21:57 [PATCH v2 net 0/6] net/core, bonding: dev_uc_sync fixes, bonding update Jay Vosburgh
  2013-05-31 21:57 ` [PATCH v2 net 1/6] net/core: __hw_addr_create_ex does not initialize sync_cnt Jay Vosburgh
  2013-05-31 21:57 ` [PATCH v2 net 2/6] net/core: __hw_addr_unsync_one "from" address not marked synced Jay Vosburgh
@ 2013-05-31 21:57 ` Jay Vosburgh
  2013-05-31 21:57 ` [PATCH v2 net 4/6] net/core: dev_mc_sync_multiple calls wrong helper Jay Vosburgh
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: Jay Vosburgh @ 2013-05-31 21:57 UTC (permalink / raw)
  To: netdev; +Cc: David Miller, Vlad Yasevich

	Currently, __hw_addr_sync_one is called in a loop by
__hw_addr_sync_multiple to sync each of a "from" device's hw addresses
to a "to" device.  __hw_addr_sync_one calls __hw_addr_add_ex to attempt
to add each address.  __hw_addr_add_ex is called with global=false, and
sync=true.

	__hw_addr_add_ex checks to see if the new address matches an
address already on the list.  If so, it tests global and sync.  In this
case, sync=true, and it then checks if the address is already synced,
and if so, returns 0.

	This 0 return causes __hw_addr_sync_one to increment the sync_cnt
and refcount for the "from" list's address entry, even though the address
is already synced and has a reference and sync_cnt.  This will cause
the sync_cnt and refcount to increment without bound every time an
addresses is added to the "from" device and synced to the "to" device.

	The fix here has two parts:

	First, when __hw_addr_add_ex finds the address already exists
and is synced, return -EEXIST instead of 0.

	Second, __hw_addr_sync_one checks the error return for -EEXIST,
and if so, it (a) does not add a refcount/sync_cnt, and (b) returns 0
itself so that __hw_addr_sync_multiple will not return an error.

Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Cc: Vlad Yasevich <vyasevic@redhat.com>

---
 net/core/dev_addr_lists.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/net/core/dev_addr_lists.c b/net/core/dev_addr_lists.c
index c858e81..8e2c2ef 100644
--- a/net/core/dev_addr_lists.c
+++ b/net/core/dev_addr_lists.c
@@ -67,7 +67,7 @@ static int __hw_addr_add_ex(struct netdev_hw_addr_list *list,
 			}
 			if (sync) {
 				if (ha->synced)
-					return 0;
+					return -EEXIST;
 				else
 					ha->synced = true;
 			}
@@ -140,10 +140,13 @@ static int __hw_addr_sync_one(struct netdev_hw_addr_list *to_list,
 
 	err = __hw_addr_add_ex(to_list, ha->addr, addr_len, ha->type,
 			       false, true);
-	if (err)
+	if (err && err != -EEXIST)
 		return err;
-	ha->sync_cnt++;
-	ha->refcount++;
+
+	if (!err) {
+		ha->sync_cnt++;
+		ha->refcount++;
+	}
 
 	return 0;
 }
-- 
1.7.1

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

* [PATCH v2 net 4/6] net/core: dev_mc_sync_multiple calls wrong helper
  2013-05-31 21:57 [PATCH v2 net 0/6] net/core, bonding: dev_uc_sync fixes, bonding update Jay Vosburgh
                   ` (2 preceding siblings ...)
  2013-05-31 21:57 ` [PATCH v2 net 3/6] net/core: __hw_addr_sync_one / _multiple broken Jay Vosburgh
@ 2013-05-31 21:57 ` Jay Vosburgh
  2013-05-31 21:57 ` [PATCH v2 net 5/6] bonding: Convert hw addr handling to sync/unsync, support ucast addresses Jay Vosburgh
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: Jay Vosburgh @ 2013-05-31 21:57 UTC (permalink / raw)
  To: netdev; +Cc: David Miller, Vlad Yasevich

	The dev_mc_sync_multiple function is currently calling
__hw_addr_sync, and not __hw_addr_sync_multiple.  This will result in
addresses only being synced to the first device from the set.

	Corrected by calling the _multiple variant.

Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Cc: Vlad Yasevich <vyasevic@redhat.com>

---
 net/core/dev_addr_lists.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/core/dev_addr_lists.c b/net/core/dev_addr_lists.c
index 8e2c2ef..6cda4e2 100644
--- a/net/core/dev_addr_lists.c
+++ b/net/core/dev_addr_lists.c
@@ -801,7 +801,7 @@ int dev_mc_sync_multiple(struct net_device *to, struct net_device *from)
 		return -EINVAL;
 
 	netif_addr_lock_nested(to);
-	err = __hw_addr_sync(&to->mc, &from->mc, to->addr_len);
+	err = __hw_addr_sync_multiple(&to->mc, &from->mc, to->addr_len);
 	if (!err)
 		__dev_set_rx_mode(to);
 	netif_addr_unlock(to);
-- 
1.7.1

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

* [PATCH v2 net 5/6] bonding: Convert hw addr handling to sync/unsync, support ucast addresses
  2013-05-31 21:57 [PATCH v2 net 0/6] net/core, bonding: dev_uc_sync fixes, bonding update Jay Vosburgh
                   ` (3 preceding siblings ...)
  2013-05-31 21:57 ` [PATCH v2 net 4/6] net/core: dev_mc_sync_multiple calls wrong helper Jay Vosburgh
@ 2013-05-31 21:57 ` Jay Vosburgh
  2013-06-07 22:06   ` David Miller
  2013-05-31 21:57 ` [PATCH v2 net 6/6] bonding: disallow change of MAC if fail_over_mac enabled Jay Vosburgh
                   ` (2 subsequent siblings)
  7 siblings, 1 reply; 12+ messages in thread
From: Jay Vosburgh @ 2013-05-31 21:57 UTC (permalink / raw)
  To: netdev; +Cc: David Miller, Vlad Yasevich

	This patch converts bonding to use the dev_uc/mc_sync and
dev_uc/mc_sync_multiple functions for updating the hardware addresses
of bonding slaves.

	The existing functions to add or remove addresses are removed,
and their functionality is replaced with calls to dev_mc_sync or
dev_mc_sync_multiple, depending upon the bonding mode.

	Calls to dev_uc_sync and dev_uc_sync_multiple are also added,
so that unicast addresses added to a bond will be properly synced with
its slaves.

	Various functions are renamed to better reflect the new
situation, and relevant comments are updated.

Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Cc: Vlad Yasevich <vyasevic@redhat.com>

---
V2: fixed logic error in bond_set_rx_mode

 drivers/net/bonding/bond_main.c |  168 ++++++++++-----------------------------
 drivers/net/bonding/bonding.h   |    1 -
 2 files changed, 43 insertions(+), 126 deletions(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index f4489d6..4953f66 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -706,45 +706,6 @@ static int bond_set_allmulti(struct bonding *bond, int inc)
 	return err;
 }
 
-/*
- * Add a Multicast address to slaves
- * according to mode
- */
-static void bond_mc_add(struct bonding *bond, void *addr)
-{
-	if (USES_PRIMARY(bond->params.mode)) {
-		/* write lock already acquired */
-		if (bond->curr_active_slave)
-			dev_mc_add(bond->curr_active_slave->dev, addr);
-	} else {
-		struct slave *slave;
-		int i;
-
-		bond_for_each_slave(bond, slave, i)
-			dev_mc_add(slave->dev, addr);
-	}
-}
-
-/*
- * Remove a multicast address from slave
- * according to mode
- */
-static void bond_mc_del(struct bonding *bond, void *addr)
-{
-	if (USES_PRIMARY(bond->params.mode)) {
-		/* write lock already acquired */
-		if (bond->curr_active_slave)
-			dev_mc_del(bond->curr_active_slave->dev, addr);
-	} else {
-		struct slave *slave;
-		int i;
-		bond_for_each_slave(bond, slave, i) {
-			dev_mc_del(slave->dev, addr);
-		}
-	}
-}
-
-
 static void __bond_resend_igmp_join_requests(struct net_device *dev)
 {
 	struct in_device *in_dev;
@@ -803,17 +764,15 @@ static void bond_resend_igmp_join_requests_delayed(struct work_struct *work)
 	bond_resend_igmp_join_requests(bond);
 }
 
-/*
- * flush all members of flush->mc_list from device dev->mc_list
+/* Flush bond's hardware addresses from slave
  */
-static void bond_mc_list_flush(struct net_device *bond_dev,
+static void bond_hw_addr_flush(struct net_device *bond_dev,
 			       struct net_device *slave_dev)
 {
 	struct bonding *bond = netdev_priv(bond_dev);
-	struct netdev_hw_addr *ha;
 
-	netdev_for_each_mc_addr(ha, bond_dev)
-		dev_mc_del(slave_dev, ha->addr);
+	dev_uc_unsync(slave_dev, bond_dev);
+	dev_mc_unsync(slave_dev, bond_dev);
 
 	if (bond->params.mode == BOND_MODE_8023AD) {
 		/* del lacpdu mc addr from mc list */
@@ -825,22 +784,14 @@ static void bond_mc_list_flush(struct net_device *bond_dev,
 
 /*--------------------------- Active slave change ---------------------------*/
 
-/*
- * Update the mc list and multicast-related flags for the new and
- * old active slaves (if any) according to the multicast mode, and
- * promiscuous flags unconditionally.
+/* Update the hardware address list and promisc/allmulti for the new and
+ * old active slaves (if any).  Modes that are !USES_PRIMARY keep all
+ * slaves up date at all times; only the USES_PRIMARY modes need to call
+ * this function to swap these settings during a failover.
  */
-static void bond_mc_swap(struct bonding *bond, struct slave *new_active,
-			 struct slave *old_active)
+static void bond_hw_addr_swap(struct bonding *bond, struct slave *new_active,
+			      struct slave *old_active)
 {
-	struct netdev_hw_addr *ha;
-
-	if (!USES_PRIMARY(bond->params.mode))
-		/* nothing to do -  mc list is already up-to-date on
-		 * all slaves
-		 */
-		return;
-
 	if (old_active) {
 		if (bond->dev->flags & IFF_PROMISC)
 			dev_set_promiscuity(old_active->dev, -1);
@@ -848,10 +799,7 @@ static void bond_mc_swap(struct bonding *bond, struct slave *new_active,
 		if (bond->dev->flags & IFF_ALLMULTI)
 			dev_set_allmulti(old_active->dev, -1);
 
-		netif_addr_lock_bh(bond->dev);
-		netdev_for_each_mc_addr(ha, bond->dev)
-			dev_mc_del(old_active->dev, ha->addr);
-		netif_addr_unlock_bh(bond->dev);
+		bond_hw_addr_flush(bond->dev, old_active->dev);
 	}
 
 	if (new_active) {
@@ -863,8 +811,8 @@ static void bond_mc_swap(struct bonding *bond, struct slave *new_active,
 			dev_set_allmulti(new_active->dev, 1);
 
 		netif_addr_lock_bh(bond->dev);
-		netdev_for_each_mc_addr(ha, bond->dev)
-			dev_mc_add(new_active->dev, ha->addr);
+		dev_uc_sync(new_active->dev, bond->dev);
+		dev_mc_sync(new_active->dev, bond->dev);
 		netif_addr_unlock_bh(bond->dev);
 	}
 }
@@ -1083,7 +1031,7 @@ void bond_change_active_slave(struct bonding *bond, struct slave *new_active)
 	}
 
 	if (USES_PRIMARY(bond->params.mode))
-		bond_mc_swap(bond, new_active, old_active);
+		bond_hw_addr_swap(bond, new_active, old_active);
 
 	if (bond_is_lb(bond)) {
 		bond_alb_handle_active_change(bond, new_active);
@@ -1526,7 +1474,6 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
 	struct bonding *bond = netdev_priv(bond_dev);
 	const struct net_device_ops *slave_ops = slave_dev->netdev_ops;
 	struct slave *new_slave = NULL;
-	struct netdev_hw_addr *ha;
 	struct sockaddr addr;
 	int link_reporting;
 	int res = 0;
@@ -1706,10 +1653,8 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
 			goto err_close;
 	}
 
-	/* If the mode USES_PRIMARY, then the new slave gets the
-	 * master's promisc (and mc) settings only if it becomes the
-	 * curr_active_slave, and that is taken care of later when calling
-	 * bond_change_active()
+	/* If the mode USES_PRIMARY, then the following is handled by
+	 * bond_change_active_slave().
 	 */
 	if (!USES_PRIMARY(bond->params.mode)) {
 		/* set promiscuity level to new slave */
@@ -1727,9 +1672,10 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
 		}
 
 		netif_addr_lock_bh(bond_dev);
-		/* upload master's mc_list to new slave */
-		netdev_for_each_mc_addr(ha, bond_dev)
-			dev_mc_add(slave_dev, ha->addr);
+
+		dev_mc_sync_multiple(slave_dev, bond_dev);
+		dev_uc_sync_multiple(slave_dev, bond_dev);
+
 		netif_addr_unlock_bh(bond_dev);
 	}
 
@@ -1908,11 +1854,9 @@ err_dest_symlinks:
 	bond_destroy_slave_symlinks(bond_dev, slave_dev);
 
 err_detach:
-	if (!USES_PRIMARY(bond->params.mode)) {
-		netif_addr_lock_bh(bond_dev);
-		bond_mc_list_flush(bond_dev, slave_dev);
-		netif_addr_unlock_bh(bond_dev);
-	}
+	if (!USES_PRIMARY(bond->params.mode))
+		bond_hw_addr_flush(bond_dev, slave_dev);
+
 	bond_del_vlans_from_slave(bond, slave_dev);
 	write_lock_bh(&bond->lock);
 	bond_detach_slave(bond, new_slave);
@@ -2107,9 +2051,8 @@ static int __bond_release_one(struct net_device *bond_dev,
 
 	bond_del_vlans_from_slave(bond, slave_dev);
 
-	/* If the mode USES_PRIMARY, then we should only remove its
-	 * promisc and mc settings if it was the curr_active_slave, but that was
-	 * already taken care of above when we detached the slave
+	/* If the mode USES_PRIMARY, then this cases was handled above by
+	 * bond_change_active_slave(..., NULL)
 	 */
 	if (!USES_PRIMARY(bond->params.mode)) {
 		/* unset promiscuity level from slave */
@@ -2120,10 +2063,7 @@ static int __bond_release_one(struct net_device *bond_dev,
 		if (bond_dev->flags & IFF_ALLMULTI)
 			dev_set_allmulti(slave_dev, -1);
 
-		/* flush master's mc_list from slave */
-		netif_addr_lock_bh(bond_dev);
-		bond_mc_list_flush(bond_dev, slave_dev);
-		netif_addr_unlock_bh(bond_dev);
+		bond_hw_addr_flush(bond_dev, slave_dev);
 	}
 
 	bond_upper_dev_unlink(bond_dev, slave_dev);
@@ -3660,19 +3600,6 @@ static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd
 	return res;
 }
 
-static bool bond_addr_in_mc_list(unsigned char *addr,
-				 struct netdev_hw_addr_list *list,
-				 int addrlen)
-{
-	struct netdev_hw_addr *ha;
-
-	netdev_hw_addr_list_for_each(ha, list)
-		if (!memcmp(ha->addr, addr, addrlen))
-			return true;
-
-	return false;
-}
-
 static void bond_change_rx_flags(struct net_device *bond_dev, int change)
 {
 	struct bonding *bond = netdev_priv(bond_dev);
@@ -3686,35 +3613,29 @@ static void bond_change_rx_flags(struct net_device *bond_dev, int change)
 				  bond_dev->flags & IFF_ALLMULTI ? 1 : -1);
 }
 
-static void bond_set_multicast_list(struct net_device *bond_dev)
+static void bond_set_rx_mode(struct net_device *bond_dev)
 {
 	struct bonding *bond = netdev_priv(bond_dev);
-	struct netdev_hw_addr *ha;
-	bool found;
+	struct slave *slave;
+	int i;
 
 	read_lock(&bond->lock);
 
-	/* looking for addresses to add to slaves' mc list */
-	netdev_for_each_mc_addr(ha, bond_dev) {
-		found = bond_addr_in_mc_list(ha->addr, &bond->mc_list,
-					     bond_dev->addr_len);
-		if (!found)
-			bond_mc_add(bond, ha->addr);
-	}
-
-	/* looking for addresses to delete from slaves' list */
-	netdev_hw_addr_list_for_each(ha, &bond->mc_list) {
-		found = bond_addr_in_mc_list(ha->addr, &bond_dev->mc,
-					     bond_dev->addr_len);
-		if (!found)
-			bond_mc_del(bond, ha->addr);
+	if (USES_PRIMARY(bond->params.mode)) {
+		read_lock(&bond->curr_slave_lock);
+		slave = bond->curr_active_slave;
+		if (slave) {
+			dev_uc_sync(slave->dev, bond_dev);
+			dev_mc_sync(slave->dev, bond_dev);
+		}
+		read_unlock(&bond->curr_slave_lock);
+	} else {
+		bond_for_each_slave(bond, slave, i) {
+			dev_uc_sync_multiple(slave->dev, bond_dev);
+			dev_mc_sync_multiple(slave->dev, bond_dev);
+		}
 	}
 
-	/* save master's multicast list */
-	__hw_addr_flush(&bond->mc_list);
-	__hw_addr_add_multiple(&bond->mc_list, &bond_dev->mc,
-			       bond_dev->addr_len, NETDEV_HW_ADDR_T_MULTICAST);
-
 	read_unlock(&bond->lock);
 }
 
@@ -4321,7 +4242,7 @@ static const struct net_device_ops bond_netdev_ops = {
 	.ndo_get_stats64	= bond_get_stats,
 	.ndo_do_ioctl		= bond_do_ioctl,
 	.ndo_change_rx_flags	= bond_change_rx_flags,
-	.ndo_set_rx_mode	= bond_set_multicast_list,
+	.ndo_set_rx_mode	= bond_set_rx_mode,
 	.ndo_change_mtu		= bond_change_mtu,
 	.ndo_set_mac_address	= bond_set_mac_address,
 	.ndo_neigh_setup	= bond_neigh_setup,
@@ -4426,8 +4347,6 @@ static void bond_uninit(struct net_device *bond_dev)
 
 	bond_debug_unregister(bond);
 
-	__hw_addr_flush(&bond->mc_list);
-
 	list_for_each_entry_safe(vlan, tmp, &bond->vlan_list, vlan_list) {
 		list_del(&vlan->vlan_list);
 		kfree(vlan);
@@ -4838,7 +4757,6 @@ static int bond_init(struct net_device *bond_dev)
 		bond->dev_addr_from_first = true;
 	}
 
-	__hw_addr_init(&bond->mc_list);
 	return 0;
 }
 
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
index 2baec24..b38609b 100644
--- a/drivers/net/bonding/bonding.h
+++ b/drivers/net/bonding/bonding.h
@@ -231,7 +231,6 @@ struct bonding {
 	char     proc_file_name[IFNAMSIZ];
 #endif /* CONFIG_PROC_FS */
 	struct   list_head bond_list;
-	struct   netdev_hw_addr_list mc_list;
 	int      (*xmit_hash_policy)(struct sk_buff *, int);
 	u16      rr_tx_counter;
 	struct   ad_bond_info ad_info;
-- 
1.7.1

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

* [PATCH v2 net 6/6] bonding: disallow change of MAC if fail_over_mac enabled
  2013-05-31 21:57 [PATCH v2 net 0/6] net/core, bonding: dev_uc_sync fixes, bonding update Jay Vosburgh
                   ` (4 preceding siblings ...)
  2013-05-31 21:57 ` [PATCH v2 net 5/6] bonding: Convert hw addr handling to sync/unsync, support ucast addresses Jay Vosburgh
@ 2013-05-31 21:57 ` Jay Vosburgh
  2013-06-07 22:06   ` David Miller
  2013-05-31 23:58 ` [PATCH v2 net 0/6] net/core, bonding: dev_uc_sync fixes, bonding update David Miller
  2013-06-01 17:00 ` Or Gerlitz
  7 siblings, 1 reply; 12+ messages in thread
From: Jay Vosburgh @ 2013-05-31 21:57 UTC (permalink / raw)
  To: netdev; +Cc: David Miller

	Currently, if fail_over_mac is set to active, then attempts to
change the MAC of the bond itself silently fail.  However, if fail_over_mac
is set to follow, changes are permitted.

	Permitting the bond's MAC to change with fail_over_mac=follow
will disrupt the follow functionality, which normally controls the
assignment of MAC address to the bond and its slaves, and can cause
multiple ports to be assigned the same MAC address. which will interfere
with the functioning of the device (where the device here is a
virtualization-aware card for s390, qeth).

Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
---
 drivers/net/bonding/bond_main.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 4953f66..bc1246f 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -3780,11 +3780,10 @@ static int bond_set_mac_address(struct net_device *bond_dev, void *addr)
 	pr_debug("bond=%p, name=%s\n",
 		 bond, bond_dev ? bond_dev->name : "None");
 
-	/*
-	 * If fail_over_mac is set to active, do nothing and return
-	 * success.  Returning an error causes ifenslave to fail.
+	/* If fail_over_mac is enabled, do nothing and return success.
+	 * Returning an error causes ifenslave to fail.
 	 */
-	if (bond->params.fail_over_mac == BOND_FOM_ACTIVE)
+	if (bond->params.fail_over_mac)
 		return 0;
 
 	if (!is_valid_ether_addr(sa->sa_data))
-- 
1.7.1

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

* Re: [PATCH v2 net 0/6] net/core, bonding: dev_uc_sync fixes, bonding update
  2013-05-31 21:57 [PATCH v2 net 0/6] net/core, bonding: dev_uc_sync fixes, bonding update Jay Vosburgh
                   ` (5 preceding siblings ...)
  2013-05-31 21:57 ` [PATCH v2 net 6/6] bonding: disallow change of MAC if fail_over_mac enabled Jay Vosburgh
@ 2013-05-31 23:58 ` David Miller
  2013-06-01 17:00 ` Or Gerlitz
  7 siblings, 0 replies; 12+ messages in thread
From: David Miller @ 2013-05-31 23:58 UTC (permalink / raw)
  To: fubar; +Cc: netdev

From: Jay Vosburgh <fubar@us.ibm.com>
Date: Fri, 31 May 2013 14:57:25 -0700

> 	This patch set includes 6 patches: four fixes to the dev_mc_sync /
> dev_mc_unsync system; and two patches to bonding, one to utilize the sync
> / unsync functions, and another minor fix.

I've merged patches #1 to #4 to 'net' and added the tested-by and reviewed-by
tags that the previous series obtained, since these patches are unchanged
in v2.

I'll apply v5 and v6 when I next merge net into net-next.

Thanks.

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

* Re: [PATCH v2 net 0/6] net/core, bonding: dev_uc_sync fixes, bonding update
  2013-05-31 21:57 [PATCH v2 net 0/6] net/core, bonding: dev_uc_sync fixes, bonding update Jay Vosburgh
                   ` (6 preceding siblings ...)
  2013-05-31 23:58 ` [PATCH v2 net 0/6] net/core, bonding: dev_uc_sync fixes, bonding update David Miller
@ 2013-06-01 17:00 ` Or Gerlitz
  2013-06-01 19:04   ` Shawn Bohrer
  7 siblings, 1 reply; 12+ messages in thread
From: Or Gerlitz @ 2013-06-01 17:00 UTC (permalink / raw)
  To: Jay Vosburgh; +Cc: netdev, David Miller

On Sat, Jun 1, 2013 at 12:57 AM, Jay Vosburgh <fubar@us.ibm.com> wrote:
> This patch set includes 6 patches: four fixes to the dev_mc_sync /  dev_mc_unsync
>system; and two patches to bonding, one to utilize the sync / unsync functions

does anything here needs to go into -stable, or it was all introduced
in 3.10-rc1?

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

* Re: [PATCH v2 net 0/6] net/core, bonding: dev_uc_sync fixes, bonding update
  2013-06-01 17:00 ` Or Gerlitz
@ 2013-06-01 19:04   ` Shawn Bohrer
  0 siblings, 0 replies; 12+ messages in thread
From: Shawn Bohrer @ 2013-06-01 19:04 UTC (permalink / raw)
  To: Or Gerlitz; +Cc: Jay Vosburgh, netdev, David Miller

On Sat, Jun 01, 2013 at 08:00:04PM +0300, Or Gerlitz wrote:
> On Sat, Jun 1, 2013 at 12:57 AM, Jay Vosburgh <fubar@us.ibm.com> wrote:
> > This patch set includes 6 patches: four fixes to the dev_mc_sync /  dev_mc_unsync
> >system; and two patches to bonding, one to utilize the sync / unsync functions
> 
> does anything here needs to go into -stable, or it was all introduced
> in 3.10-rc1?

The commit that broke things for me was introduced in 3.10-rc1:

$ git describe --contains 4cd729b04285b7330edaf5a7080aa795d6d15ff3
v3.10-rc1~66^2~128^2~1

--
Shawn

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

* Re: [PATCH v2 net 5/6] bonding: Convert hw addr handling to sync/unsync, support ucast addresses
  2013-05-31 21:57 ` [PATCH v2 net 5/6] bonding: Convert hw addr handling to sync/unsync, support ucast addresses Jay Vosburgh
@ 2013-06-07 22:06   ` David Miller
  0 siblings, 0 replies; 12+ messages in thread
From: David Miller @ 2013-06-07 22:06 UTC (permalink / raw)
  To: fubar; +Cc: netdev, vyasevic

From: Jay Vosburgh <fubar@us.ibm.com>
Date: Fri, 31 May 2013 14:57:30 -0700

> 	This patch converts bonding to use the dev_uc/mc_sync and
> dev_uc/mc_sync_multiple functions for updating the hardware addresses
> of bonding slaves.
> 
> 	The existing functions to add or remove addresses are removed,
> and their functionality is replaced with calls to dev_mc_sync or
> dev_mc_sync_multiple, depending upon the bonding mode.
> 
> 	Calls to dev_uc_sync and dev_uc_sync_multiple are also added,
> so that unicast addresses added to a bond will be properly synced with
> its slaves.
> 
> 	Various functions are renamed to better reflect the new
> situation, and relevant comments are updated.
> 
> Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>

Applied to net-next.

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

* Re: [PATCH v2 net 6/6] bonding: disallow change of MAC if fail_over_mac enabled
  2013-05-31 21:57 ` [PATCH v2 net 6/6] bonding: disallow change of MAC if fail_over_mac enabled Jay Vosburgh
@ 2013-06-07 22:06   ` David Miller
  0 siblings, 0 replies; 12+ messages in thread
From: David Miller @ 2013-06-07 22:06 UTC (permalink / raw)
  To: fubar; +Cc: netdev

From: Jay Vosburgh <fubar@us.ibm.com>
Date: Fri, 31 May 2013 14:57:31 -0700

> 	Currently, if fail_over_mac is set to active, then attempts to
> change the MAC of the bond itself silently fail.  However, if fail_over_mac
> is set to follow, changes are permitted.
> 
> 	Permitting the bond's MAC to change with fail_over_mac=follow
> will disrupt the follow functionality, which normally controls the
> assignment of MAC address to the bond and its slaves, and can cause
> multiple ports to be assigned the same MAC address. which will interfere
> with the functioning of the device (where the device here is a
> virtualization-aware card for s390, qeth).
> 
> Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>

Applied to net-next.

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

end of thread, other threads:[~2013-06-07 22:06 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-31 21:57 [PATCH v2 net 0/6] net/core, bonding: dev_uc_sync fixes, bonding update Jay Vosburgh
2013-05-31 21:57 ` [PATCH v2 net 1/6] net/core: __hw_addr_create_ex does not initialize sync_cnt Jay Vosburgh
2013-05-31 21:57 ` [PATCH v2 net 2/6] net/core: __hw_addr_unsync_one "from" address not marked synced Jay Vosburgh
2013-05-31 21:57 ` [PATCH v2 net 3/6] net/core: __hw_addr_sync_one / _multiple broken Jay Vosburgh
2013-05-31 21:57 ` [PATCH v2 net 4/6] net/core: dev_mc_sync_multiple calls wrong helper Jay Vosburgh
2013-05-31 21:57 ` [PATCH v2 net 5/6] bonding: Convert hw addr handling to sync/unsync, support ucast addresses Jay Vosburgh
2013-06-07 22:06   ` David Miller
2013-05-31 21:57 ` [PATCH v2 net 6/6] bonding: disallow change of MAC if fail_over_mac enabled Jay Vosburgh
2013-06-07 22:06   ` David Miller
2013-05-31 23:58 ` [PATCH v2 net 0/6] net/core, bonding: dev_uc_sync fixes, bonding update David Miller
2013-06-01 17:00 ` Or Gerlitz
2013-06-01 19:04   ` Shawn Bohrer

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