提交 f31c7937 编写于 作者: M Michal Kubeček 提交者: David S. Miller

bonding: start slaves with link down for ARP monitor

Initialize slave device link state as down if ARP monitor is
active and net_carrier_ok() returns zero. Also shift initial
value of its last_arp_tx so that it doesn't immediately cause
fake detection of "up" state.

When ARP monitoring is used, initializing the slave device with
up link state can cause ARP monitor to detect link failure
before the device is really up (with igb driver, this can take
more than two seconds).
Signed-off-by: NMichal Kubecek <mkubecek@suse.cz>
Signed-off-by: NJay Vosburgh <fubar@us.ibm.com>
Signed-off-by: NFlavio Leitner <fbl@redhat.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 bf1ac5ca
...@@ -1726,7 +1726,8 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) ...@@ -1726,7 +1726,8 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
read_lock(&bond->lock); read_lock(&bond->lock);
new_slave->last_arp_rx = jiffies; new_slave->last_arp_rx = jiffies -
(msecs_to_jiffies(bond->params.arp_interval) + 1);
if (bond->params.miimon && !bond->params.use_carrier) { if (bond->params.miimon && !bond->params.use_carrier) {
link_reporting = bond_check_dev_link(bond, slave_dev, 1); link_reporting = bond_check_dev_link(bond, slave_dev, 1);
...@@ -1751,21 +1752,29 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) ...@@ -1751,21 +1752,29 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
} }
/* check for initial state */ /* check for initial state */
if (!bond->params.miimon || if (bond->params.miimon) {
(bond_check_dev_link(bond, slave_dev, 0) == BMSR_LSTATUS)) { if (bond_check_dev_link(bond, slave_dev, 0) == BMSR_LSTATUS) {
if (bond->params.updelay) { if (bond->params.updelay) {
pr_debug("Initial state of slave_dev is BOND_LINK_BACK\n");
new_slave->link = BOND_LINK_BACK; new_slave->link = BOND_LINK_BACK;
new_slave->delay = bond->params.updelay; new_slave->delay = bond->params.updelay;
} else { } else {
pr_debug("Initial state of slave_dev is BOND_LINK_UP\n");
new_slave->link = BOND_LINK_UP; new_slave->link = BOND_LINK_UP;
} }
new_slave->jiffies = jiffies;
} else { } else {
pr_debug("Initial state of slave_dev is BOND_LINK_DOWN\n");
new_slave->link = BOND_LINK_DOWN; new_slave->link = BOND_LINK_DOWN;
} }
} else if (bond->params.arp_interval) {
new_slave->link = (netif_carrier_ok(slave_dev) ?
BOND_LINK_UP : BOND_LINK_DOWN);
} else {
new_slave->link = BOND_LINK_UP;
}
if (new_slave->link != BOND_LINK_DOWN)
new_slave->jiffies = jiffies;
pr_debug("Initial state of slave_dev is BOND_LINK_%s\n",
new_slave->link == BOND_LINK_DOWN ? "DOWN" :
(new_slave->link == BOND_LINK_UP ? "UP" : "BACK"));
bond_update_speed_duplex(new_slave); bond_update_speed_duplex(new_slave);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册