diff options
author | Debabrata Banerjee <dbanerje@akamai.com> | 2018-05-16 14:02:13 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-05-16 14:03:50 -0400 |
commit | b3c898e20b1881b0876c3e811c58b039b37dd5fd (patch) | |
tree | eae7dd71554f8e32e64337b3b62a98cd1255ebd1 | |
parent | 55df3e9754531060b07eb32a2ca5a981c0fd4b3d (diff) |
Revert "bonding: allow carrier and link status to determine link state"
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | Documentation/networking/bonding.txt | 4 | ||||
-rw-r--r-- | drivers/net/bonding/bond_main.c | 12 | ||||
-rw-r--r-- | 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 | |||
828 | MII / ETHTOOL ioctl method to determine the link state. | 828 | MII / ETHTOOL ioctl method to determine the link state. |
829 | 829 | ||
830 | A value of 1 enables the use of netif_carrier_ok(), a value of | 830 | A value of 1 enables the use of netif_carrier_ok(), a value of |
831 | 0 will use the deprecated MII / ETHTOOL ioctls. A value of 2 | 831 | 0 will use the deprecated MII / ETHTOOL ioctls. The default |
832 | will check both. The default value is 1. | 832 | value is 1. |
833 | 833 | ||
834 | xmit_hash_policy | 834 | xmit_hash_policy |
835 | 835 | ||
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, " | |||
132 | "in milliseconds"); | 132 | "in milliseconds"); |
133 | module_param(use_carrier, int, 0); | 133 | module_param(use_carrier, int, 0); |
134 | MODULE_PARM_DESC(use_carrier, "Use netif_carrier_ok (vs MII ioctls) in miimon; " | 134 | MODULE_PARM_DESC(use_carrier, "Use netif_carrier_ok (vs MII ioctls) in miimon; " |
135 | "0 for off, 1 for on (default), 2 for carrier then legacy checks"); | 135 | "0 for off, 1 for on (default)"); |
136 | module_param(mode, charp, 0); | 136 | module_param(mode, charp, 0); |
137 | MODULE_PARM_DESC(mode, "Mode of operation; 0 for balance-rr, " | 137 | MODULE_PARM_DESC(mode, "Mode of operation; 0 for balance-rr, " |
138 | "1 for active-backup, 2 for balance-xor, " | 138 | "1 for active-backup, 2 for balance-xor, " |
@@ -434,16 +434,12 @@ static int bond_check_dev_link(struct bonding *bond, | |||
434 | int (*ioctl)(struct net_device *, struct ifreq *, int); | 434 | int (*ioctl)(struct net_device *, struct ifreq *, int); |
435 | struct ifreq ifr; | 435 | struct ifreq ifr; |
436 | struct mii_ioctl_data *mii; | 436 | struct mii_ioctl_data *mii; |
437 | bool carrier = true; | ||
438 | 437 | ||
439 | if (!reporting && !netif_running(slave_dev)) | 438 | if (!reporting && !netif_running(slave_dev)) |
440 | return 0; | 439 | return 0; |
441 | 440 | ||
442 | if (bond->params.use_carrier) | 441 | if (bond->params.use_carrier) |
443 | carrier = netif_carrier_ok(slave_dev) ? BMSR_LSTATUS : 0; | 442 | return netif_carrier_ok(slave_dev) ? BMSR_LSTATUS : 0; |
444 | |||
445 | if (!carrier) | ||
446 | return carrier; | ||
447 | 443 | ||
448 | /* Try to get link status using Ethtool first. */ | 444 | /* Try to get link status using Ethtool first. */ |
449 | if (slave_dev->ethtool_ops->get_link) | 445 | if (slave_dev->ethtool_ops->get_link) |
@@ -4407,8 +4403,8 @@ static int bond_check_params(struct bond_params *params) | |||
4407 | downdelay = 0; | 4403 | downdelay = 0; |
4408 | } | 4404 | } |
4409 | 4405 | ||
4410 | if (use_carrier < 0 || use_carrier > 2) { | 4406 | if ((use_carrier != 0) && (use_carrier != 1)) { |
4411 | pr_warn("Warning: use_carrier module parameter (%d), not of valid value (0-2), so it was set to 1\n", | 4407 | pr_warn("Warning: use_carrier module parameter (%d), not of valid value (0/1), so it was set to 1\n", |
4412 | use_carrier); | 4408 | use_carrier); |
4413 | use_carrier = 1; | 4409 | use_carrier = 1; |
4414 | } | 4410 | } |
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[] = { | |||
164 | }; | 164 | }; |
165 | 165 | ||
166 | static const struct bond_opt_value bond_use_carrier_tbl[] = { | 166 | static const struct bond_opt_value bond_use_carrier_tbl[] = { |
167 | { "off", 0, 0}, | 167 | { "off", 0, 0}, |
168 | { "on", 1, BOND_VALFLAG_DEFAULT}, | 168 | { "on", 1, BOND_VALFLAG_DEFAULT}, |
169 | { "both", 2, 0}, | 169 | { NULL, -1, 0} |
170 | { NULL, -1, 0} | ||
171 | }; | 170 | }; |
172 | 171 | ||
173 | static const struct bond_opt_value bond_all_slaves_active_tbl[] = { | 172 | static const struct bond_opt_value bond_all_slaves_active_tbl[] = { |