|
@@ -798,7 +798,7 @@ void bond_change_active_slave(struct bonding *bond, struct slave *new_active)
|
|
|
return;
|
|
|
|
|
|
if (new_active) {
|
|
|
- new_active->jiffies = jiffies;
|
|
|
+ new_active->last_link_up = jiffies;
|
|
|
|
|
|
if (new_active->link == BOND_LINK_BACK) {
|
|
|
if (USES_PRIMARY(bond->params.mode)) {
|
|
@@ -1115,9 +1115,6 @@ static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb)
|
|
|
slave = bond_slave_get_rcu(skb->dev);
|
|
|
bond = slave->bond;
|
|
|
|
|
|
- if (bond->params.arp_interval)
|
|
|
- slave->dev->last_rx = jiffies;
|
|
|
-
|
|
|
recv_probe = ACCESS_ONCE(bond->recv_probe);
|
|
|
if (recv_probe) {
|
|
|
ret = recv_probe(skb, bond, slave);
|
|
@@ -1400,10 +1397,10 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
|
|
|
|
|
|
bond_update_speed_duplex(new_slave);
|
|
|
|
|
|
- new_slave->last_arp_rx = jiffies -
|
|
|
+ new_slave->last_rx = jiffies -
|
|
|
(msecs_to_jiffies(bond->params.arp_interval) + 1);
|
|
|
for (i = 0; i < BOND_MAX_ARP_TARGETS; i++)
|
|
|
- new_slave->target_last_arp_rx[i] = new_slave->last_arp_rx;
|
|
|
+ new_slave->target_last_arp_rx[i] = new_slave->last_rx;
|
|
|
|
|
|
if (bond->params.miimon && !bond->params.use_carrier) {
|
|
|
link_reporting = bond_check_dev_link(bond, slave_dev, 1);
|
|
@@ -1447,7 +1444,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
|
|
|
}
|
|
|
|
|
|
if (new_slave->link != BOND_LINK_DOWN)
|
|
|
- new_slave->jiffies = jiffies;
|
|
|
+ new_slave->last_link_up = 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"));
|
|
@@ -1894,7 +1891,7 @@ static int bond_miimon_inspect(struct bonding *bond)
|
|
|
* recovered before downdelay expired
|
|
|
*/
|
|
|
slave->link = BOND_LINK_UP;
|
|
|
- slave->jiffies = jiffies;
|
|
|
+ slave->last_link_up = jiffies;
|
|
|
pr_info("%s: link status up again after %d ms for interface %s\n",
|
|
|
bond->dev->name,
|
|
|
(bond->params.downdelay - slave->delay) *
|
|
@@ -1969,7 +1966,7 @@ static void bond_miimon_commit(struct bonding *bond)
|
|
|
|
|
|
case BOND_LINK_UP:
|
|
|
slave->link = BOND_LINK_UP;
|
|
|
- slave->jiffies = jiffies;
|
|
|
+ slave->last_link_up = jiffies;
|
|
|
|
|
|
if (bond->params.mode == BOND_MODE_8023AD) {
|
|
|
/* prevent it from being the active one */
|
|
@@ -2245,7 +2242,7 @@ static void bond_validate_arp(struct bonding *bond, struct slave *slave, __be32
|
|
|
pr_debug("bva: sip %pI4 not found in targets\n", &sip);
|
|
|
return;
|
|
|
}
|
|
|
- slave->last_arp_rx = jiffies;
|
|
|
+ slave->last_rx = jiffies;
|
|
|
slave->target_last_arp_rx[i] = jiffies;
|
|
|
}
|
|
|
|
|
@@ -2255,15 +2252,16 @@ int bond_arp_rcv(const struct sk_buff *skb, struct bonding *bond,
|
|
|
struct arphdr *arp = (struct arphdr *)skb->data;
|
|
|
unsigned char *arp_ptr;
|
|
|
__be32 sip, tip;
|
|
|
- int alen;
|
|
|
+ int alen, is_arp = skb->protocol == __cpu_to_be16(ETH_P_ARP);
|
|
|
|
|
|
- if (skb->protocol != __cpu_to_be16(ETH_P_ARP))
|
|
|
+ if (!slave_do_arp_validate(bond, slave)) {
|
|
|
+ if ((slave_do_arp_validate_only(bond, slave) && is_arp) ||
|
|
|
+ !slave_do_arp_validate_only(bond, slave))
|
|
|
+ slave->last_rx = jiffies;
|
|
|
return RX_HANDLER_ANOTHER;
|
|
|
-
|
|
|
- read_lock(&bond->lock);
|
|
|
-
|
|
|
- if (!slave_do_arp_validate(bond, slave))
|
|
|
- goto out_unlock;
|
|
|
+ } else if (!is_arp) {
|
|
|
+ return RX_HANDLER_ANOTHER;
|
|
|
+ }
|
|
|
|
|
|
alen = arp_hdr_len(bond->dev);
|
|
|
|
|
@@ -2314,11 +2312,10 @@ int bond_arp_rcv(const struct sk_buff *skb, struct bonding *bond,
|
|
|
bond_validate_arp(bond, slave, sip, tip);
|
|
|
else if (bond->curr_active_slave &&
|
|
|
time_after(slave_last_rx(bond, bond->curr_active_slave),
|
|
|
- bond->curr_active_slave->jiffies))
|
|
|
+ bond->curr_active_slave->last_link_up))
|
|
|
bond_validate_arp(bond, slave, tip, sip);
|
|
|
|
|
|
out_unlock:
|
|
|
- read_unlock(&bond->lock);
|
|
|
if (arp != (struct arphdr *)skb->data)
|
|
|
kfree(arp);
|
|
|
return RX_HANDLER_ANOTHER;
|
|
@@ -2361,9 +2358,9 @@ static void bond_loadbalance_arp_mon(struct work_struct *work)
|
|
|
oldcurrent = ACCESS_ONCE(bond->curr_active_slave);
|
|
|
/* see if any of the previous devices are up now (i.e. they have
|
|
|
* xmt and rcv traffic). the curr_active_slave does not come into
|
|
|
- * the picture unless it is null. also, slave->jiffies is not needed
|
|
|
- * here because we send an arp on each slave and give a slave as
|
|
|
- * long as it needs to get the tx/rx within the delta.
|
|
|
+ * the picture unless it is null. also, slave->last_link_up is not
|
|
|
+ * needed here because we send an arp on each slave and give a slave
|
|
|
+ * as long as it needs to get the tx/rx within the delta.
|
|
|
* TODO: what about up/down delay in arp mode? it wasn't here before
|
|
|
* so it can wait
|
|
|
*/
|
|
@@ -2372,7 +2369,7 @@ static void bond_loadbalance_arp_mon(struct work_struct *work)
|
|
|
|
|
|
if (slave->link != BOND_LINK_UP) {
|
|
|
if (bond_time_in_interval(bond, trans_start, 1) &&
|
|
|
- bond_time_in_interval(bond, slave->dev->last_rx, 1)) {
|
|
|
+ bond_time_in_interval(bond, slave->last_rx, 1)) {
|
|
|
|
|
|
slave->link = BOND_LINK_UP;
|
|
|
slave_state_changed = 1;
|
|
@@ -2401,7 +2398,7 @@ static void bond_loadbalance_arp_mon(struct work_struct *work)
|
|
|
* if we don't know our ip yet
|
|
|
*/
|
|
|
if (!bond_time_in_interval(bond, trans_start, 2) ||
|
|
|
- !bond_time_in_interval(bond, slave->dev->last_rx, 2)) {
|
|
|
+ !bond_time_in_interval(bond, slave->last_rx, 2)) {
|
|
|
|
|
|
slave->link = BOND_LINK_DOWN;
|
|
|
slave_state_changed = 1;
|
|
@@ -2489,7 +2486,7 @@ static int bond_ab_arp_inspect(struct bonding *bond)
|
|
|
* active. This avoids bouncing, as the last receive
|
|
|
* times need a full ARP monitor cycle to be updated.
|
|
|
*/
|
|
|
- if (bond_time_in_interval(bond, slave->jiffies, 2))
|
|
|
+ if (bond_time_in_interval(bond, slave->last_link_up, 2))
|
|
|
continue;
|
|
|
|
|
|
/*
|
|
@@ -2690,7 +2687,7 @@ static bool bond_ab_arp_probe(struct bonding *bond)
|
|
|
new_slave->link = BOND_LINK_BACK;
|
|
|
bond_set_slave_active_flags(new_slave);
|
|
|
bond_arp_send_all(bond, new_slave);
|
|
|
- new_slave->jiffies = jiffies;
|
|
|
+ new_slave->last_link_up = jiffies;
|
|
|
rcu_assign_pointer(bond->current_arp_slave, new_slave);
|
|
|
rtnl_unlock();
|
|
|
|
|
@@ -3060,8 +3057,7 @@ static int bond_open(struct net_device *bond_dev)
|
|
|
|
|
|
if (bond->params.arp_interval) { /* arp interval, in milliseconds. */
|
|
|
queue_delayed_work(bond->wq, &bond->arp_work, 0);
|
|
|
- if (bond->params.arp_validate)
|
|
|
- bond->recv_probe = bond_arp_rcv;
|
|
|
+ bond->recv_probe = bond_arp_rcv;
|
|
|
}
|
|
|
|
|
|
if (bond->params.mode == BOND_MODE_8023AD) {
|
|
@@ -4186,10 +4182,6 @@ static int bond_check_params(struct bond_params *params)
|
|
|
}
|
|
|
|
|
|
if (arp_validate) {
|
|
|
- if (bond_mode != BOND_MODE_ACTIVEBACKUP) {
|
|
|
- pr_err("arp_validate only supported in active-backup mode\n");
|
|
|
- return -EINVAL;
|
|
|
- }
|
|
|
if (!arp_interval) {
|
|
|
pr_err("arp_validate requires arp_interval\n");
|
|
|
return -EINVAL;
|