Skip to contentSkip to conversation

bonding: commit link status change after propose

PATCH In review Cong Wang 3 participants 3 messages Jul 25, 2017 – Jul 26, 2017

Subsystems (3)
lore
Share & tools
lore

Cong Wang

author
#0 lore raw

PATCH 1/1 bonding: commit link status change after propose

Commit de77ecd4ef02 ("bonding: improve link-status update in mii-monitoring") moves link status commitment into bond_mii_monitor(), but it still relies on the return value of bond_miimon_inspect() as the hint. We need to return non-zero as long as we propose a link status change.

Fixes de77ecd4ef02 ("bonding: improve link-status update in mii-monitoring")
Cc Mahesh Bandewar <[email protected]>
---
 drivers/net/bonding/bond_main.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/bonding/bond_main.c +2 -0
index 181839d6fbea..9bee6c1c70cc 100644
@@ -2050,6 +2050,7 @@ static int bond_miimon_inspect(struct bonding *bond)
 				continue;
 
 			bond_propose_link_state(slave, BOND_LINK_FAIL);
+			commit++;
 			slave->delay = bond->params.downdelay;
 			if (slave->delay) {
 				netdev_info(bond->dev, "link status down for %sinterface %s, disabling it in %d ms\n",
@@ -2088,6 +2089,7 @@ static int bond_miimon_inspect(struct bonding *bond)
 				continue;
 
 			bond_propose_link_state(slave, BOND_LINK_BACK);
+			commit++;
 			slave->delay = bond->params.updelay;
 
 			if (slave->delay) {
Signature · 1 line
2.13.0
#1 lore raw
Quoted 10 lines · Cong Wang

Commit de77ecd4ef02 ("bonding: improve link-status update in mii-monitoring") moves link status commitment into bond_mii_monitor(), but it still relies on the return value of bond_miimon_inspect() as the hint. We need to return non-zero as long as we propose a link status change.

Fixes de77ecd4ef02 ("bonding: improve link-status update in mii-monitoring")
Cc Mahesh Bandewar <[email protected]>
Quoted 27 lines
---
 drivers/net/bonding/bond_main.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/bonding/bond_main.c +2 -1
index 181839d6fbea..9bee6c1c70cc 100644
@@ -2050,6 +2050,7 @@ static int bond_miimon_inspect(struct bonding *bond)
                                continue;
 
                        bond_propose_link_state(slave, BOND_LINK_FAIL);
+                       commit++;
                        slave->delay = bond->params.downdelay;
                        if (slave->delay) {
                                netdev_info(bond->dev, "link status down for %sinterface %s, disabling it in %d ms\n",
@@ -2088,6 +2089,7 @@ static int bond_miimon_inspect(struct bonding *bond)
                                continue;
 
                        bond_propose_link_state(slave, BOND_LINK_BACK);
+                       commit++;
                        slave->delay = bond->params.updelay;
 
                        if (slave->delay) {
--

2.13.0

maintainer
#2 lore raw
In reply to Cong Wang

From: Cong Wang <[email protected]>
Date: Tue, 25 Jul 2017 09:44:25 -0700

Quoted 10 lines

Commit de77ecd4ef02 ("bonding: improve link-status update in mii-monitoring") moves link status commitment into bond_mii_monitor(), but it still relies on the return value of bond_miimon_inspect() as the hint. We need to return non-zero as long as we propose a link status change.

Fixes de77ecd4ef02 ("bonding: improve link-status update in mii-monitoring")
Cc Mahesh Bandewar <[email protected]>

Applied and queued up for -stable.