Commit ad729bc9 authored by Andreas Born's avatar Andreas Born Committed by David S. Miller

bonding: require speed/duplex only for 802.3ad, alb and tlb

The patch c4adfc82 ("bonding: make speed, duplex setting consistent
with link state") puts the link state to down if
bond_update_speed_duplex() cannot retrieve speed and duplex settings.
Assumably the patch was written with 802.3ad mode in mind which relies
on link speed/duplex settings. For other modes like active-backup these
settings are not required. Thus, only for these other modes, this patch
reintroduces support for slaves that do not support reporting speed or
duplex such as wireless devices. This fixes the regression reported in
bug 196547 (https://bugzilla.kernel.org/show_bug.cgi?id=196547).

Fixes: c4adfc82 ("bonding: make speed, duplex setting consistent
with link state")
Signed-off-by: default avatarAndreas Born <futur.andy@googlemail.com>
Acked-by: default avatarMahesh Bandewar <maheshb@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e71cb9e0
...@@ -1569,7 +1569,8 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) ...@@ -1569,7 +1569,8 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
new_slave->delay = 0; new_slave->delay = 0;
new_slave->link_failure_count = 0; new_slave->link_failure_count = 0;
if (bond_update_speed_duplex(new_slave)) if (bond_update_speed_duplex(new_slave) &&
bond_needs_speed_duplex(bond))
new_slave->link = BOND_LINK_DOWN; new_slave->link = BOND_LINK_DOWN;
new_slave->last_rx = jiffies - new_slave->last_rx = jiffies -
...@@ -2140,7 +2141,8 @@ static void bond_miimon_commit(struct bonding *bond) ...@@ -2140,7 +2141,8 @@ static void bond_miimon_commit(struct bonding *bond)
continue; continue;
case BOND_LINK_UP: case BOND_LINK_UP:
if (bond_update_speed_duplex(slave)) { if (bond_update_speed_duplex(slave) &&
bond_needs_speed_duplex(bond)) {
slave->link = BOND_LINK_DOWN; slave->link = BOND_LINK_DOWN;
netdev_warn(bond->dev, netdev_warn(bond->dev,
"failed to get link speed/duplex for %s\n", "failed to get link speed/duplex for %s\n",
......
...@@ -277,6 +277,11 @@ static inline bool bond_is_lb(const struct bonding *bond) ...@@ -277,6 +277,11 @@ static inline bool bond_is_lb(const struct bonding *bond)
BOND_MODE(bond) == BOND_MODE_ALB; BOND_MODE(bond) == BOND_MODE_ALB;
} }
static inline bool bond_needs_speed_duplex(const struct bonding *bond)
{
return BOND_MODE(bond) == BOND_MODE_8023AD || bond_is_lb(bond);
}
static inline bool bond_is_nondyn_tlb(const struct bonding *bond) static inline bool bond_is_nondyn_tlb(const struct bonding *bond)
{ {
return (BOND_MODE(bond) == BOND_MODE_TLB) && return (BOND_MODE(bond) == BOND_MODE_TLB) &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment