From: Steven Smith Date: Thu, 28 May 2009 10:54:19 +0000 (+0100) Subject: patch bonding-balance-slb-fixes2.patch X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=735e3b9835d2dc661f19a14881ae92c24469fd47;p=people%2Fssmith%2Fnc2-2.6.27.bak%2F.git patch bonding-balance-slb-fixes2.patch --- diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c index 12bb79ef..59f7ea08 100644 --- a/drivers/net/bonding/bond_alb.c +++ b/drivers/net/bonding/bond_alb.c @@ -1059,9 +1059,6 @@ static void alb_fasten_mac_swap(struct bonding *bond, struct slave *slave1, disabled_slave = slave2; } - if (bond->alb_info.slb_enabled) - slb_send_learning_packets(bond); - if (bond->alb_info.rlb_enabled && slaves_state_differ) { /* A disabled slave was assigned an active mac addr */ rlb_teach_disabled_mac_on_primary(bond, @@ -1251,7 +1248,7 @@ static int alb_set_mac_address(struct bonding *bond, void *addr) int res; int i; - if (bond->alb_info.rlb_enabled) { + if (bond->alb_info.rlb_enabled || bond->alb_info.slb_enabled) { return 0; } @@ -1512,9 +1509,6 @@ void bond_alb_monitor(struct work_struct *work) } } - if (bond->alb_info.slb_enabled) - slb_send_learning_packets(bond); - read_unlock(&bond->curr_slave_lock); bond_info->tx_rebalance_counter = 0; @@ -1578,23 +1572,25 @@ int bond_alb_init_slave(struct bonding *bond, struct slave *slave) { int res; - res = alb_set_slave_mac_addr(slave, slave->perm_hwaddr, - bond->alb_info.rlb_enabled); - if (res) { - return res; - } + if (!bond->alb_info.slb_enabled) { + res = alb_set_slave_mac_addr(slave, slave->perm_hwaddr, + bond->alb_info.rlb_enabled); + if (res) { + return res; + } - /* caller must hold the bond lock for write since the mac addresses - * are compared and may be swapped. - */ - read_lock(&bond->lock); + /* caller must hold the bond lock for write since the mac addresses + * are compared and may be swapped. + */ + read_lock(&bond->lock); - res = alb_handle_addr_collision_on_attach(bond, slave); + res = alb_handle_addr_collision_on_attach(bond, slave); - read_unlock(&bond->lock); + read_unlock(&bond->lock); - if (res) { - return res; + if (res) { + return res; + } } tlb_init_slave(slave); @@ -1617,7 +1613,7 @@ int bond_alb_init_slave(struct bonding *bond, struct slave *slave) */ void bond_alb_deinit_slave(struct bonding *bond, struct slave *slave) { - if (bond->slave_cnt > 1) { + if (bond->alb_info.slb_enabled && bond->slave_cnt > 1) { alb_change_hw_addr_on_detach(bond, slave); } @@ -1695,7 +1691,7 @@ void bond_alb_handle_active_change(struct bonding *bond, struct slave *new_slave swap_slave = bond->curr_active_slave; bond->curr_active_slave = new_slave; - if (!new_slave || (bond->slave_cnt == 0)) { + if (!new_slave || (bond->slave_cnt == 0) || bond->alb_info.slb_enabled) { return; } @@ -1779,7 +1775,7 @@ int bond_alb_set_mac_address(struct net_device *bond_dev, void *addr) * Otherwise we'll need to pass the new address to it and handle * duplications. */ - if (!bond->curr_active_slave) { + if (!bond->curr_active_slave || bond->alb_info.slb_enabled) { return 0; } diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c index 1b02896e..06b8608c 100644 --- a/net/bridge/br_fdb.c +++ b/net/bridge/br_fdb.c @@ -442,10 +442,6 @@ int br_fdb_update(struct net_bridge *br, struct net_bridge_port *source, /* attempt to update an entry for a local interface */ if (unlikely(fdb->is_local)) { return 0; - if (net_ratelimit()) - printk(KERN_WARNING "%s: received packet with " - " own address as source address\n", - source->dev->name); } else { /* fastpath: update of existing entry */ fdb->dst = source; diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c index f969ee8e..f530c5b5 100644 --- a/net/bridge/br_if.c +++ b/net/bridge/br_if.c @@ -311,12 +311,17 @@ static struct sk_buff *create_switch_learning_packet(struct net_device *dev, uns struct learning_pkt pkt; int size = sizeof(struct learning_pkt); char *data; + int len; const unsigned char dest_hw[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; memset(&pkt, 0, size); memcpy(pkt.mac_dst, dest_hw, ETH_ALEN); memcpy(pkt.mac_src, src_hw, ETH_ALEN); pkt.type = __constant_htons(ETH_P_LOOP); + len = sprintf(&pkt.padding[0], "Citrix XenServer Failover"); + len++; /* NULL */ + memcpy(&pkt.padding[len], src_hw, ETH_ALEN); len += ETH_ALEN; + memcpy(&pkt.padding[len], dev->dev_addr, ETH_ALEN); len += ETH_ALEN; skb = dev_alloc_skb(size); if (!skb)