* [PATCH net-next] Revert "bonding: allow carrier and link status to determine link state"
@ 2018-05-16 18:02 Debabrata Banerjee
2018-05-16 18:04 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Debabrata Banerjee @ 2018-05-16 18:02 UTC (permalink / raw)
To: David S . Miller, netdev, Jay Vosburgh
Cc: Veaceslav Falico, Andy Gospodarek, dbanerje
This reverts commit 1386c36b30388f46a95100924bfcae75160db715.
We don't want to encourage drivers to not report carrier status
correctly, therefore remove this commit.
Signed-off-by: Debabrata Banerjee <dbanerje@akamai.com>
---
Documentation/networking/bonding.txt | 4 ++--
drivers/net/bonding/bond_main.c | 12 ++++--------
drivers/net/bonding/bond_options.c | 7 +++----
3 files changed, 9 insertions(+), 14 deletions(-)
diff --git a/Documentation/networking/bonding.txt b/Documentation/networking/bonding.txt
index 86d07fbb592d..c13214d073a4 100644
--- a/Documentation/networking/bonding.txt
+++ b/Documentation/networking/bonding.txt
@@ -828,8 +828,8 @@ use_carrier
MII / ETHTOOL ioctl method to determine the link state.
A value of 1 enables the use of netif_carrier_ok(), a value of
- 0 will use the deprecated MII / ETHTOOL ioctls. A value of 2
- will check both. The default value is 1.
+ 0 will use the deprecated MII / ETHTOOL ioctls. The default
+ value is 1.
xmit_hash_policy
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index e4c253dc7dfb..a4cd7f6bfd4d 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -132,7 +132,7 @@ MODULE_PARM_DESC(downdelay, "Delay before considering link down, "
"in milliseconds");
module_param(use_carrier, int, 0);
MODULE_PARM_DESC(use_carrier, "Use netif_carrier_ok (vs MII ioctls) in miimon; "
- "0 for off, 1 for on (default), 2 for carrier then legacy checks");
+ "0 for off, 1 for on (default)");
module_param(mode, charp, 0);
MODULE_PARM_DESC(mode, "Mode of operation; 0 for balance-rr, "
"1 for active-backup, 2 for balance-xor, "
@@ -434,16 +434,12 @@ static int bond_check_dev_link(struct bonding *bond,
int (*ioctl)(struct net_device *, struct ifreq *, int);
struct ifreq ifr;
struct mii_ioctl_data *mii;
- bool carrier = true;
if (!reporting && !netif_running(slave_dev))
return 0;
if (bond->params.use_carrier)
- carrier = netif_carrier_ok(slave_dev) ? BMSR_LSTATUS : 0;
-
- if (!carrier)
- return carrier;
+ return netif_carrier_ok(slave_dev) ? BMSR_LSTATUS : 0;
/* Try to get link status using Ethtool first. */
if (slave_dev->ethtool_ops->get_link)
@@ -4407,8 +4403,8 @@ static int bond_check_params(struct bond_params *params)
downdelay = 0;
}
- if (use_carrier < 0 || use_carrier > 2) {
- pr_warn("Warning: use_carrier module parameter (%d), not of valid value (0-2), so it was set to 1\n",
+ if ((use_carrier != 0) && (use_carrier != 1)) {
+ pr_warn("Warning: use_carrier module parameter (%d), not of valid value (0/1), so it was set to 1\n",
use_carrier);
use_carrier = 1;
}
diff --git a/drivers/net/bonding/bond_options.c b/drivers/net/bonding/bond_options.c
index dba6cef05134..8a945c9341d6 100644
--- a/drivers/net/bonding/bond_options.c
+++ b/drivers/net/bonding/bond_options.c
@@ -164,10 +164,9 @@ static const struct bond_opt_value bond_primary_reselect_tbl[] = {
};
static const struct bond_opt_value bond_use_carrier_tbl[] = {
- { "off", 0, 0},
- { "on", 1, BOND_VALFLAG_DEFAULT},
- { "both", 2, 0},
- { NULL, -1, 0}
+ { "off", 0, 0},
+ { "on", 1, BOND_VALFLAG_DEFAULT},
+ { NULL, -1, 0}
};
static const struct bond_opt_value bond_all_slaves_active_tbl[] = {
--
2.17.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] Revert "bonding: allow carrier and link status to determine link state"
2018-05-16 18:02 [PATCH net-next] Revert "bonding: allow carrier and link status to determine link state" Debabrata Banerjee
@ 2018-05-16 18:04 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-05-16 18:04 UTC (permalink / raw)
To: dbanerje; +Cc: netdev, j.vosburgh, vfalico, andy
From: Debabrata Banerjee <dbanerje@akamai.com>
Date: Wed, 16 May 2018 14:02:13 -0400
> This reverts commit 1386c36b30388f46a95100924bfcae75160db715.
>
> We don't want to encourage drivers to not report carrier status
> correctly, therefore remove this commit.
>
> Signed-off-by: Debabrata Banerjee <dbanerje@akamai.com>
Applied, thanks for following up so quickly.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-05-16 18:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-16 18:02 [PATCH net-next] Revert "bonding: allow carrier and link status to determine link state" Debabrata Banerjee
2018-05-16 18:04 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).