Skip to content

Commit 8e60346

Browse files
Veaceslav Falicodavem330
authored andcommitted
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>
1 parent f8ff080 commit 8e60346

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

drivers/net/bonding/bond_main.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -798,7 +798,7 @@ void bond_change_active_slave(struct bonding *bond, struct slave *new_active)
798798
return;
799799

800800
if (new_active) {
801-
new_active->jiffies = jiffies;
801+
new_active->last_link_up = jiffies;
802802

803803
if (new_active->link == BOND_LINK_BACK) {
804804
if (USES_PRIMARY(bond->params.mode)) {
@@ -1444,7 +1444,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
14441444
}
14451445

14461446
if (new_slave->link != BOND_LINK_DOWN)
1447-
new_slave->jiffies = jiffies;
1447+
new_slave->last_link_up = jiffies;
14481448
pr_debug("Initial state of slave_dev is BOND_LINK_%s\n",
14491449
new_slave->link == BOND_LINK_DOWN ? "DOWN" :
14501450
(new_slave->link == BOND_LINK_UP ? "UP" : "BACK"));
@@ -1891,7 +1891,7 @@ static int bond_miimon_inspect(struct bonding *bond)
18911891
* recovered before downdelay expired
18921892
*/
18931893
slave->link = BOND_LINK_UP;
1894-
slave->jiffies = jiffies;
1894+
slave->last_link_up = jiffies;
18951895
pr_info("%s: link status up again after %d ms for interface %s\n",
18961896
bond->dev->name,
18971897
(bond->params.downdelay - slave->delay) *
@@ -1966,7 +1966,7 @@ static void bond_miimon_commit(struct bonding *bond)
19661966

19671967
case BOND_LINK_UP:
19681968
slave->link = BOND_LINK_UP;
1969-
slave->jiffies = jiffies;
1969+
slave->last_link_up = jiffies;
19701970

19711971
if (bond->params.mode == BOND_MODE_8023AD) {
19721972
/* prevent it from being the active one */
@@ -2312,7 +2312,7 @@ int bond_arp_rcv(const struct sk_buff *skb, struct bonding *bond,
23122312
bond_validate_arp(bond, slave, sip, tip);
23132313
else if (bond->curr_active_slave &&
23142314
time_after(slave_last_rx(bond, bond->curr_active_slave),
2315-
bond->curr_active_slave->jiffies))
2315+
bond->curr_active_slave->last_link_up))
23162316
bond_validate_arp(bond, slave, tip, sip);
23172317

23182318
out_unlock:
@@ -2358,9 +2358,9 @@ static void bond_loadbalance_arp_mon(struct work_struct *work)
23582358
oldcurrent = ACCESS_ONCE(bond->curr_active_slave);
23592359
/* see if any of the previous devices are up now (i.e. they have
23602360
* 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
2362-
* here because we send an arp on each slave and give a slave as
2363-
* long as it needs to get the tx/rx within the delta.
2361+
* the picture unless it is null. also, slave->last_link_up is not
2362+
* needed here because we send an arp on each slave and give a slave
2363+
* as long as it needs to get the tx/rx within the delta.
23642364
* TODO: what about up/down delay in arp mode? it wasn't here before
23652365
* so it can wait
23662366
*/
@@ -2486,7 +2486,7 @@ static int bond_ab_arp_inspect(struct bonding *bond)
24862486
* active. This avoids bouncing, as the last receive
24872487
* times need a full ARP monitor cycle to be updated.
24882488
*/
2489-
if (bond_time_in_interval(bond, slave->jiffies, 2))
2489+
if (bond_time_in_interval(bond, slave->last_link_up, 2))
24902490
continue;
24912491

24922492
/*
@@ -2687,7 +2687,7 @@ static bool bond_ab_arp_probe(struct bonding *bond)
26872687
new_slave->link = BOND_LINK_BACK;
26882688
bond_set_slave_active_flags(new_slave);
26892689
bond_arp_send_all(bond, new_slave);
2690-
new_slave->jiffies = jiffies;
2690+
new_slave->last_link_up = jiffies;
26912691
rcu_assign_pointer(bond->current_arp_slave, new_slave);
26922692
rtnl_unlock();
26932693

drivers/net/bonding/bonding.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,8 @@ struct slave {
188188
struct net_device *dev; /* first - useful for panic debug */
189189
struct bonding *bond; /* our master */
190190
int delay;
191-
unsigned long jiffies;
191+
/* all three in jiffies */
192+
unsigned long last_link_up;
192193
unsigned long last_arp_rx;
193194
unsigned long target_last_arp_rx[BOND_MAX_ARP_TARGETS];
194195
s8 link; /* one of BOND_LINK_XXXX */

0 commit comments

Comments
 (0)