Skip to content

Commit 89dd2e7

Browse files
committed
Merge branch 'bonding-bug-fixes-and-regressions'
Debabrata Banerjee says: ==================== bonding: bug fixes and regressions Fixes to bonding driver for balance-alb mode, suitable for stable. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents ca3943c + 21706ee commit 89dd2e7

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

drivers/net/bonding/bond_alb.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ static void rlb_update_client(struct rlb_client_info *client_info)
450450
{
451451
int i;
452452

453-
if (!client_info->slave)
453+
if (!client_info->slave || !is_valid_ether_addr(client_info->mac_dst))
454454
return;
455455

456456
for (i = 0; i < RLB_ARP_BURST_SIZE; i++) {
@@ -943,6 +943,10 @@ static void alb_send_lp_vid(struct slave *slave, u8 mac_addr[],
943943
skb->priority = TC_PRIO_CONTROL;
944944
skb->dev = slave->dev;
945945

946+
netdev_dbg(slave->bond->dev,
947+
"Send learning packet: dev %s mac %pM vlan %d\n",
948+
slave->dev->name, mac_addr, vid);
949+
946950
if (vid)
947951
__vlan_hwaccel_put_tag(skb, vlan_proto, vid);
948952

@@ -965,14 +969,13 @@ static int alb_upper_dev_walk(struct net_device *upper, void *_data)
965969
u8 *mac_addr = data->mac_addr;
966970
struct bond_vlan_tag *tags;
967971

968-
if (is_vlan_dev(upper) && vlan_get_encap_level(upper) == 0) {
969-
if (strict_match &&
970-
ether_addr_equal_64bits(mac_addr,
971-
upper->dev_addr)) {
972+
if (is_vlan_dev(upper) &&
973+
bond->nest_level == vlan_get_encap_level(upper) - 1) {
974+
if (upper->addr_assign_type == NET_ADDR_STOLEN) {
972975
alb_send_lp_vid(slave, mac_addr,
973976
vlan_dev_vlan_proto(upper),
974977
vlan_dev_vlan_id(upper));
975-
} else if (!strict_match) {
978+
} else {
976979
alb_send_lp_vid(slave, upper->dev_addr,
977980
vlan_dev_vlan_proto(upper),
978981
vlan_dev_vlan_id(upper));

drivers/net/bonding/bond_main.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1738,6 +1738,8 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev,
17381738
if (bond_mode_uses_xmit_hash(bond))
17391739
bond_update_slave_arr(bond, NULL);
17401740

1741+
bond->nest_level = dev_get_nest_level(bond_dev);
1742+
17411743
netdev_info(bond_dev, "Enslaving %s as %s interface with %s link\n",
17421744
slave_dev->name,
17431745
bond_is_active_slave(new_slave) ? "an active" : "a backup",

include/net/bonding.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ struct bonding {
198198
struct slave __rcu *primary_slave;
199199
struct bond_up_slave __rcu *slave_arr; /* Array of usable slaves */
200200
bool force_primary;
201+
u32 nest_level;
201202
s32 slave_cnt; /* never change this value outside the attach/detach wrappers */
202203
int (*recv_probe)(const struct sk_buff *, struct bonding *,
203204
struct slave *);

0 commit comments

Comments
 (0)