]> xenbits.xen.org Git - xenclient/kernel.git/commitdiff
imported patch bonding-balance-slb-fixes2.patch bonding-balance-slb-fixes.patch
authort_jeang <devnull@localhost>
Tue, 6 Jan 2009 12:06:05 +0000 (12:06 +0000)
committert_jeang <devnull@localhost>
Tue, 6 Jan 2009 12:06:05 +0000 (12:06 +0000)
drivers/net/bonding/bond_alb.c
net/bridge/br_fdb.c
net/bridge/br_if.c

index 4dcfa2733b4e692a6640b97e9040faaa3449bbc2..4c4fc42be4984dfe6e97a9fa3dcab67b7c6c07d8 100644 (file)
@@ -1035,9 +1035,6 @@ static void alb_swap_mac_addr(struct bonding *bond, struct slave *slave1, struct
                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,
@@ -1225,7 +1222,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;
        }
 
@@ -1482,9 +1479,6 @@ void bond_alb_monitor(struct bonding *bond)
                        }
                }
 
-               if (bond->alb_info.slb_enabled)
-                       slb_send_learning_packets(bond);
-
                read_unlock(&bond->curr_slave_lock);
 
                bond_info->tx_rebalance_counter = 0;
@@ -1547,23 +1541,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.
-        */
-       write_lock_bh(&bond->lock);
+               /* caller must hold the bond lock for write since the mac addresses
+                * are compared and may be swapped.
+                */
+               write_lock_bh(&bond->lock);
 
-       res = alb_handle_addr_collision_on_attach(bond, slave);
+               res = alb_handle_addr_collision_on_attach(bond, slave);
 
-       write_unlock_bh(&bond->lock);
+               write_unlock_bh(&bond->lock);
 
-       if (res) {
-               return res;
+               if (res) {
+                       return res;
+               }
        }
 
        tlb_init_slave(slave);
@@ -1581,7 +1577,7 @@ int bond_alb_init_slave(struct bonding *bond, struct slave *slave)
 /* Caller must hold bond lock for write */
 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);
        }
 
@@ -1654,7 +1650,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;
        }
 
@@ -1712,7 +1708,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 7d51fda5bdb49dd898e2a19b3840ba51d2099fa9..32ba1a9b5c1fbdde375a49c290c9b24908038503 100644 (file)
@@ -391,10 +391,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 7c5c81cf1425655fd43b7f40658b79b6a6db1c61..74da9b1f048af05ca6868ec76db0c688dc10c685 100644 (file)
@@ -325,12 +325,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)