All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 0/2] bonding: bug fixes and regressions
@ 2018-05-09 23:32 Debabrata Banerjee
  2018-05-09 23:32 ` [PATCH net 1/2] bonding: do not allow rlb updates to invalid mac Debabrata Banerjee
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Debabrata Banerjee @ 2018-05-09 23:32 UTC (permalink / raw)
  To: David S . Miller, netdev, Vlad Yasevich
  Cc: Jay Vosburgh, Veaceslav Falico, Andy Gospodarek, dbanerje

Fixes to bonding driver for balance-alb mode, suitable for stable.

Debabrata Banerjee (2):
  bonding: do not allow rlb updates to invalid mac
  bonding: send learning packets for vlans on slave

 drivers/net/bonding/bond_alb.c  | 15 +++++++++------
 drivers/net/bonding/bond_main.c |  2 ++
 include/net/bonding.h           |  1 +
 3 files changed, 12 insertions(+), 6 deletions(-)

-- 
2.17.0

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

* [PATCH net 1/2] bonding: do not allow rlb updates to invalid mac
  2018-05-09 23:32 [PATCH net 0/2] bonding: bug fixes and regressions Debabrata Banerjee
@ 2018-05-09 23:32 ` Debabrata Banerjee
  2018-05-09 23:32 ` [PATCH net 2/2] bonding: send learning packets for vlans on slave Debabrata Banerjee
  2018-05-11 15:51 ` [PATCH net 0/2] bonding: bug fixes and regressions David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Debabrata Banerjee @ 2018-05-09 23:32 UTC (permalink / raw)
  To: David S . Miller, netdev, Vlad Yasevich
  Cc: Jay Vosburgh, Veaceslav Falico, Andy Gospodarek, dbanerje

Make sure multicast, broadcast, and zero mac's cannot be the output of rlb
updates, which should all be directed arps. Receive load balancing will be
collapsed if any of these happen, as the switch will broadcast.

Signed-off-by: Debabrata Banerjee <dbanerje@akamai.com>
---
 drivers/net/bonding/bond_alb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
index 1ed9529e7bd1..3f6faa657360 100644
--- a/drivers/net/bonding/bond_alb.c
+++ b/drivers/net/bonding/bond_alb.c
@@ -450,7 +450,7 @@ static void rlb_update_client(struct rlb_client_info *client_info)
 {
 	int i;
 
-	if (!client_info->slave)
+	if (!client_info->slave || !is_valid_ether_addr(client_info->mac_dst))
 		return;
 
 	for (i = 0; i < RLB_ARP_BURST_SIZE; i++) {
-- 
2.17.0

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

* [PATCH net 2/2] bonding: send learning packets for vlans on slave
  2018-05-09 23:32 [PATCH net 0/2] bonding: bug fixes and regressions Debabrata Banerjee
  2018-05-09 23:32 ` [PATCH net 1/2] bonding: do not allow rlb updates to invalid mac Debabrata Banerjee
@ 2018-05-09 23:32 ` Debabrata Banerjee
  2018-05-11 15:51 ` [PATCH net 0/2] bonding: bug fixes and regressions David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Debabrata Banerjee @ 2018-05-09 23:32 UTC (permalink / raw)
  To: David S . Miller, netdev, Vlad Yasevich
  Cc: Jay Vosburgh, Veaceslav Falico, Andy Gospodarek, dbanerje

There was a regression at some point from the intended functionality of
commit f60c3704e87d ("bonding: Fix alb mode to only use first level
vlans.")

Given the return value vlan_get_encap_level() we need to store the nest
level of the bond device, and then compare the vlan's encap level to
this. Without this, this check always fails and learning packets are
never sent.

In addition, this same commit caused a regression in the behavior of
balance_alb, which requires learning packets be sent for all interfaces
using the slave's mac in order to load balance properly. For vlan's
that have not set a user mac, we can send after checking one bit.
Otherwise we need send the set mac, albeit defeating rx load balancing
for that vlan.

Signed-off-by: Debabrata Banerjee <dbanerje@akamai.com>
---
 drivers/net/bonding/bond_alb.c  | 13 ++++++++-----
 drivers/net/bonding/bond_main.c |  2 ++
 include/net/bonding.h           |  1 +
 3 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
index 3f6faa657360..5eb0df2e5464 100644
--- a/drivers/net/bonding/bond_alb.c
+++ b/drivers/net/bonding/bond_alb.c
@@ -943,6 +943,10 @@ static void alb_send_lp_vid(struct slave *slave, u8 mac_addr[],
 	skb->priority = TC_PRIO_CONTROL;
 	skb->dev = slave->dev;
 
+	netdev_dbg(slave->bond->dev,
+		   "Send learning packet: dev %s mac %pM vlan %d\n",
+		   slave->dev->name, mac_addr, vid);
+
 	if (vid)
 		__vlan_hwaccel_put_tag(skb, vlan_proto, vid);
 
@@ -965,14 +969,13 @@ static int alb_upper_dev_walk(struct net_device *upper, void *_data)
 	u8 *mac_addr = data->mac_addr;
 	struct bond_vlan_tag *tags;
 
-	if (is_vlan_dev(upper) && vlan_get_encap_level(upper) == 0) {
-		if (strict_match &&
-		    ether_addr_equal_64bits(mac_addr,
-					    upper->dev_addr)) {
+	if (is_vlan_dev(upper) &&
+	    bond->nest_level == vlan_get_encap_level(upper) - 1) {
+		if (upper->addr_assign_type == NET_ADDR_STOLEN) {
 			alb_send_lp_vid(slave, mac_addr,
 					vlan_dev_vlan_proto(upper),
 					vlan_dev_vlan_id(upper));
-		} else if (!strict_match) {
+		} else {
 			alb_send_lp_vid(slave, upper->dev_addr,
 					vlan_dev_vlan_proto(upper),
 					vlan_dev_vlan_id(upper));
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 718e4914e3a0..1f1e97b26f95 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1738,6 +1738,8 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev,
 	if (bond_mode_uses_xmit_hash(bond))
 		bond_update_slave_arr(bond, NULL);
 
+	bond->nest_level = dev_get_nest_level(bond_dev);
+
 	netdev_info(bond_dev, "Enslaving %s as %s interface with %s link\n",
 		    slave_dev->name,
 		    bond_is_active_slave(new_slave) ? "an active" : "a backup",
diff --git a/include/net/bonding.h b/include/net/bonding.h
index f801fc940b29..b52235158836 100644
--- a/include/net/bonding.h
+++ b/include/net/bonding.h
@@ -198,6 +198,7 @@ struct bonding {
 	struct   slave __rcu *primary_slave;
 	struct   bond_up_slave __rcu *slave_arr; /* Array of usable slaves */
 	bool     force_primary;
+	u32      nest_level;
 	s32      slave_cnt; /* never change this value outside the attach/detach wrappers */
 	int     (*recv_probe)(const struct sk_buff *, struct bonding *,
 			      struct slave *);
-- 
2.17.0

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

* Re: [PATCH net 0/2] bonding: bug fixes and regressions
  2018-05-09 23:32 [PATCH net 0/2] bonding: bug fixes and regressions Debabrata Banerjee
  2018-05-09 23:32 ` [PATCH net 1/2] bonding: do not allow rlb updates to invalid mac Debabrata Banerjee
  2018-05-09 23:32 ` [PATCH net 2/2] bonding: send learning packets for vlans on slave Debabrata Banerjee
@ 2018-05-11 15:51 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2018-05-11 15:51 UTC (permalink / raw)
  To: dbanerje; +Cc: netdev, vyasevic, j.vosburgh, vfalico, andy

From: Debabrata Banerjee <dbanerje@akamai.com>
Date: Wed,  9 May 2018 19:32:09 -0400

> Fixes to bonding driver for balance-alb mode, suitable for stable.

Series applied and queued up for -stable, thanks.

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

end of thread, other threads:[~2018-05-11 15:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-09 23:32 [PATCH net 0/2] bonding: bug fixes and regressions Debabrata Banerjee
2018-05-09 23:32 ` [PATCH net 1/2] bonding: do not allow rlb updates to invalid mac Debabrata Banerjee
2018-05-09 23:32 ` [PATCH net 2/2] bonding: send learning packets for vlans on slave Debabrata Banerjee
2018-05-11 15:51 ` [PATCH net 0/2] bonding: bug fixes and regressions David Miller

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.