diff options
author | Veaceslav Falico <vfalico@redhat.com> | 2014-02-18 01:48:46 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-02-18 16:47:15 -0500 |
commit | 8e603460fa388c89f08e359366ec9398971cf49c (patch) | |
tree | d6cc17b128b5930f9e965b4cded6d7af95fe925a /drivers/net/bonding | |
parent | f8ff080dacecc5d0ce3579941b664bac3a4405c2 (diff) |
bonding: trivial: rename slave->jiffies to ->last_link_up
slave->jiffies is updated every time the slave becomes active, which, for
bonding, means that its link is 'up'.
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>
Diffstat (limited to 'drivers/net/bonding')
-rw-r--r-- | drivers/net/bonding/bond_main.c | 20 | ||||
-rw-r--r-- | drivers/net/bonding/bonding.h | 3 |
2 files changed, 12 insertions, 11 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 14e023de09d6..f6d56d911a86 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -798,7 +798,7 @@ void bond_change_active_slave(struct bonding *bond, struct slave *new_active) | |||
798 | return; | 798 | return; |
799 | 799 | ||
800 | if (new_active) { | 800 | if (new_active) { |
801 | new_active->jiffies = jiffies; | 801 | new_active->last_link_up = jiffies; |
802 | 802 | ||
803 | if (new_active->link == BOND_LINK_BACK) { | 803 | if (new_active->link == BOND_LINK_BACK) { |
804 | if (USES_PRIMARY(bond->params.mode)) { | 804 | if (USES_PRIMARY(bond->params.mode)) { |
@@ -1444,7 +1444,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) | |||
1444 | } | 1444 | } |
1445 | 1445 | ||
1446 | if (new_slave->link != BOND_LINK_DOWN) | 1446 | if (new_slave->link != BOND_LINK_DOWN) |
1447 | new_slave->jiffies = jiffies; | 1447 | new_slave->last_link_up = jiffies; |
1448 | pr_debug("Initial state of slave_dev is BOND_LINK_%s\n", | 1448 | pr_debug("Initial state of slave_dev is BOND_LINK_%s\n", |
1449 | new_slave->link == BOND_LINK_DOWN ? "DOWN" : | 1449 | new_slave->link == BOND_LINK_DOWN ? "DOWN" : |
1450 | (new_slave->link == BOND_LINK_UP ? "UP" : "BACK")); | 1450 | (new_slave->link == BOND_LINK_UP ? "UP" : "BACK")); |
@@ -1891,7 +1891,7 @@ static int bond_miimon_inspect(struct bonding *bond) | |||
1891 | * recovered before downdelay expired | 1891 | * recovered before downdelay expired |
1892 | */ | 1892 | */ |
1893 | slave->link = BOND_LINK_UP; | 1893 | slave->link = BOND_LINK_UP; |
1894 | slave->jiffies = jiffies; | 1894 | slave->last_link_up = jiffies; |
1895 | pr_info("%s: link status up again after %d ms for interface %s\n", | 1895 | pr_info("%s: link status up again after %d ms for interface %s\n", |
1896 | bond->dev->name, | 1896 | bond->dev->name, |
1897 | (bond->params.downdelay - slave->delay) * | 1897 | (bond->params.downdelay - slave->delay) * |
@@ -1966,7 +1966,7 @@ static void bond_miimon_commit(struct bonding *bond) | |||
1966 | 1966 | ||
1967 | case BOND_LINK_UP: | 1967 | case BOND_LINK_UP: |
1968 | slave->link = BOND_LINK_UP; | 1968 | slave->link = BOND_LINK_UP; |
1969 | slave->jiffies = jiffies; | 1969 | slave->last_link_up = jiffies; |
1970 | 1970 | ||
1971 | if (bond->params.mode == BOND_MODE_8023AD) { | 1971 | if (bond->params.mode == BOND_MODE_8023AD) { |
1972 | /* prevent it from being the active one */ | 1972 | /* prevent it from being the active one */ |
@@ -2312,7 +2312,7 @@ int bond_arp_rcv(const struct sk_buff *skb, struct bonding *bond, | |||
2312 | bond_validate_arp(bond, slave, sip, tip); | 2312 | bond_validate_arp(bond, slave, sip, tip); |
2313 | else if (bond->curr_active_slave && | 2313 | else if (bond->curr_active_slave && |
2314 | time_after(slave_last_rx(bond, bond->curr_active_slave), | 2314 | time_after(slave_last_rx(bond, bond->curr_active_slave), |
2315 | bond->curr_active_slave->jiffies)) | 2315 | bond->curr_active_slave->last_link_up)) |
2316 | bond_validate_arp(bond, slave, tip, sip); | 2316 | bond_validate_arp(bond, slave, tip, sip); |
2317 | 2317 | ||
2318 | out_unlock: | 2318 | out_unlock: |
@@ -2358,9 +2358,9 @@ static void bond_loadbalance_arp_mon(struct work_struct *work) | |||
2358 | oldcurrent = ACCESS_ONCE(bond->curr_active_slave); | 2358 | oldcurrent = ACCESS_ONCE(bond->curr_active_slave); |
2359 | /* see if any of the previous devices are up now (i.e. they have | 2359 | /* see if any of the previous devices are up now (i.e. they have |
2360 | * xmt and rcv traffic). the curr_active_slave does not come into | 2360 | * xmt and rcv traffic). the curr_active_slave does not come into |
2361 | * the picture unless it is null. also, slave->jiffies is not needed | 2361 | * the picture unless it is null. also, slave->last_link_up is not |
2362 | * here because we send an arp on each slave and give a slave as | 2362 | * needed here because we send an arp on each slave and give a slave |
2363 | * long as it needs to get the tx/rx within the delta. | 2363 | * as long as it needs to get the tx/rx within the delta. |
2364 | * TODO: what about up/down delay in arp mode? it wasn't here before | 2364 | * TODO: what about up/down delay in arp mode? it wasn't here before |
2365 | * so it can wait | 2365 | * so it can wait |
2366 | */ | 2366 | */ |
@@ -2486,7 +2486,7 @@ static int bond_ab_arp_inspect(struct bonding *bond) | |||
2486 | * active. This avoids bouncing, as the last receive | 2486 | * active. This avoids bouncing, as the last receive |
2487 | * times need a full ARP monitor cycle to be updated. | 2487 | * times need a full ARP monitor cycle to be updated. |
2488 | */ | 2488 | */ |
2489 | if (bond_time_in_interval(bond, slave->jiffies, 2)) | 2489 | if (bond_time_in_interval(bond, slave->last_link_up, 2)) |
2490 | continue; | 2490 | continue; |
2491 | 2491 | ||
2492 | /* | 2492 | /* |
@@ -2687,7 +2687,7 @@ static bool bond_ab_arp_probe(struct bonding *bond) | |||
2687 | new_slave->link = BOND_LINK_BACK; | 2687 | new_slave->link = BOND_LINK_BACK; |
2688 | bond_set_slave_active_flags(new_slave); | 2688 | bond_set_slave_active_flags(new_slave); |
2689 | bond_arp_send_all(bond, new_slave); | 2689 | bond_arp_send_all(bond, new_slave); |
2690 | new_slave->jiffies = jiffies; | 2690 | new_slave->last_link_up = jiffies; |
2691 | rcu_assign_pointer(bond->current_arp_slave, new_slave); | 2691 | rcu_assign_pointer(bond->current_arp_slave, new_slave); |
2692 | rtnl_unlock(); | 2692 | rtnl_unlock(); |
2693 | 2693 | ||
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h index ae20c5a9d00d..36db702d32e7 100644 --- a/drivers/net/bonding/bonding.h +++ b/drivers/net/bonding/bonding.h | |||
@@ -188,7 +188,8 @@ struct slave { | |||
188 | struct net_device *dev; /* first - useful for panic debug */ | 188 | struct net_device *dev; /* first - useful for panic debug */ |
189 | struct bonding *bond; /* our master */ | 189 | struct bonding *bond; /* our master */ |
190 | int delay; | 190 | int delay; |
191 | unsigned long jiffies; | 191 | /* all three in jiffies */ |
192 | unsigned long last_link_up; | ||
192 | unsigned long last_arp_rx; | 193 | unsigned long last_arp_rx; |
193 | unsigned long target_last_arp_rx[BOND_MAX_ARP_TARGETS]; | 194 | unsigned long target_last_arp_rx[BOND_MAX_ARP_TARGETS]; |
194 | s8 link; /* one of BOND_LINK_XXXX */ | 195 | s8 link; /* one of BOND_LINK_XXXX */ |