]> xenbits.xensource.com Git - people/ssmith/nc2-2.6.27.git/commitdiff
patch bonding-balance-slb-fixes2.patch
authorSteven Smith <ssmith@weybridge.uk.xensource.com>
Tue, 30 Jun 2009 11:55:47 +0000 (12:55 +0100)
committerSteven Smith <ssmith@weybridge.uk.xensource.com>
Tue, 30 Jun 2009 11:55:47 +0000 (12:55 +0100)
drivers/net/bonding/bond_alb.c
net/bridge/br_fdb.c
net/bridge/br_if.c

index 12bb79ef971dd564c7318a04118125fd30b62012..59f7ea08de9987edac7af8aa4b68a3816cea755e 100644 (file)
@@ -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;
        }
 
index 1b02896e4ac1a3146d0ec9136497bcaa45e95d58..06b8608c0153f5fb37b738462e9b026f864b083a 100644 (file)
@@ -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;
index f969ee8e949c20bfe823ad0b375c3ce951695c4a..f530c5b5380081851a47000ac3b908ce01db1d47 100644 (file)
@@ -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)