bonding: make alb_send_learning_packets() use upper dev list
Currently, if there are vlans on top of bond, alb_send_learning_packets() will never send LPs from the bond itself (i.e. untagged), which might leave untagged clients unupdated. Also, the 'circular vlan' logic (i.e. update only MAX_LP_BURST vlans at a time, and save the last vlan for the next update) is really suboptimal - in case of lots of vlans it will take a lot of time to update every vlan. It is also never called in any hot path and sends only a few small packets - thus the optimization by itself is useless. So remove the whole current_alb_vlan/MAX_LP_BURST logic from alb_send_learning_packets(). Instead, we'll first send a packet untagged and then traverse the upper dev list, sending a tagged packet for each vlan found. Also, remove the MAX_LP_BURST define - we already don't need it. CC: Jay Vosburgh <fubar@us.ibm.com> CC: Andy Gospodarek <andy@greyhouse.net> Signed-off-by: Veaceslav Falico <vfalico@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Родитель
7aa6498123
Коммит
5bf94b839a
|
@ -1013,27 +1013,20 @@ static void alb_send_lp_vid(struct slave *slave, u8 mac_addr[],
|
||||||
static void alb_send_learning_packets(struct slave *slave, u8 mac_addr[])
|
static void alb_send_learning_packets(struct slave *slave, u8 mac_addr[])
|
||||||
{
|
{
|
||||||
struct bonding *bond = bond_get_bond_by_slave(slave);
|
struct bonding *bond = bond_get_bond_by_slave(slave);
|
||||||
u16 vlan_id;
|
struct net_device *upper;
|
||||||
int i;
|
struct list_head *iter;
|
||||||
|
|
||||||
for (i = 0; i < MAX_LP_BURST; i++) {
|
/* send untagged */
|
||||||
vlan_id = 0;
|
alb_send_lp_vid(slave, mac_addr, 0);
|
||||||
|
|
||||||
if (bond_vlan_used(bond)) {
|
/* loop through vlans and send one packet for each */
|
||||||
struct vlan_entry *vlan;
|
rcu_read_lock();
|
||||||
|
netdev_for_each_upper_dev_rcu(bond->dev, upper, iter) {
|
||||||
vlan = bond_next_vlan(bond,
|
if (upper->priv_flags & IFF_802_1Q_VLAN)
|
||||||
bond->alb_info.current_alb_vlan);
|
alb_send_lp_vid(slave, mac_addr,
|
||||||
|
vlan_dev_vlan_id(upper));
|
||||||
bond->alb_info.current_alb_vlan = vlan;
|
|
||||||
if (!vlan)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
vlan_id = vlan->vlan_id;
|
|
||||||
}
|
|
||||||
|
|
||||||
alb_send_lp_vid(slave, mac_addr, vlan_id);
|
|
||||||
}
|
}
|
||||||
|
rcu_read_unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
static int alb_set_slave_mac_addr(struct slave *slave, u8 addr[])
|
static int alb_set_slave_mac_addr(struct slave *slave, u8 addr[])
|
||||||
|
|
|
@ -53,7 +53,6 @@ struct slave;
|
||||||
|
|
||||||
|
|
||||||
#define TLB_NULL_INDEX 0xffffffff
|
#define TLB_NULL_INDEX 0xffffffff
|
||||||
#define MAX_LP_BURST 3
|
|
||||||
|
|
||||||
/* rlb defs */
|
/* rlb defs */
|
||||||
#define RLB_HASH_TABLE_SIZE 256
|
#define RLB_HASH_TABLE_SIZE 256
|
||||||
|
|
Загрузка…
Ссылка в новой задаче