]>
Commit | Line | Data |
---|---|---|
08ef39ec GKH |
1 | From ad729bc9acfb7c47112964b4877ef5404578ed13 Mon Sep 17 00:00:00 2001 |
2 | From: Andreas Born <futur.andy@googlemail.com> | |
3 | Date: Thu, 10 Aug 2017 06:41:44 +0200 | |
4 | Subject: bonding: require speed/duplex only for 802.3ad, alb and tlb | |
5 | ||
6 | From: Andreas Born <futur.andy@googlemail.com> | |
7 | ||
8 | commit ad729bc9acfb7c47112964b4877ef5404578ed13 upstream. | |
9 | ||
10 | The patch c4adfc822bf5 ("bonding: make speed, duplex setting consistent | |
11 | with link state") puts the link state to down if | |
12 | bond_update_speed_duplex() cannot retrieve speed and duplex settings. | |
13 | Assumably the patch was written with 802.3ad mode in mind which relies | |
14 | on link speed/duplex settings. For other modes like active-backup these | |
15 | settings are not required. Thus, only for these other modes, this patch | |
16 | reintroduces support for slaves that do not support reporting speed or | |
17 | duplex such as wireless devices. This fixes the regression reported in | |
18 | bug 196547 (https://bugzilla.kernel.org/show_bug.cgi?id=196547). | |
19 | ||
20 | Fixes: c4adfc822bf5 ("bonding: make speed, duplex setting consistent | |
21 | with link state") | |
22 | Signed-off-by: Andreas Born <futur.andy@googlemail.com> | |
23 | Acked-by: Mahesh Bandewar <maheshb@google.com> | |
24 | Signed-off-by: David S. Miller <davem@davemloft.net> | |
25 | Cc: Nate Clark <nate@neworld.us> | |
26 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
27 | ||
28 | --- | |
29 | drivers/net/bonding/bond_main.c | 6 ++++-- | |
30 | include/net/bonding.h | 5 +++++ | |
31 | 2 files changed, 9 insertions(+), 2 deletions(-) | |
32 | ||
33 | --- a/drivers/net/bonding/bond_main.c | |
34 | +++ b/drivers/net/bonding/bond_main.c | |
35 | @@ -1531,7 +1531,8 @@ int bond_enslave(struct net_device *bond | |
36 | new_slave->delay = 0; | |
37 | new_slave->link_failure_count = 0; | |
38 | ||
39 | - if (bond_update_speed_duplex(new_slave)) | |
40 | + if (bond_update_speed_duplex(new_slave) && | |
41 | + bond_needs_speed_duplex(bond)) | |
42 | new_slave->link = BOND_LINK_DOWN; | |
43 | ||
44 | new_slave->last_rx = jiffies - | |
45 | @@ -2136,7 +2137,8 @@ static void bond_miimon_commit(struct bo | |
46 | continue; | |
47 | ||
48 | case BOND_LINK_UP: | |
49 | - if (bond_update_speed_duplex(slave)) { | |
50 | + if (bond_update_speed_duplex(slave) && | |
51 | + bond_needs_speed_duplex(bond)) { | |
52 | slave->link = BOND_LINK_DOWN; | |
53 | netdev_warn(bond->dev, | |
54 | "failed to get link speed/duplex for %s\n", | |
55 | --- a/include/net/bonding.h | |
56 | +++ b/include/net/bonding.h | |
57 | @@ -277,6 +277,11 @@ static inline bool bond_is_lb(const stru | |
58 | BOND_MODE(bond) == BOND_MODE_ALB; | |
59 | } | |
60 | ||
61 | +static inline bool bond_needs_speed_duplex(const struct bonding *bond) | |
62 | +{ | |
63 | + return BOND_MODE(bond) == BOND_MODE_8023AD || bond_is_lb(bond); | |
64 | +} | |
65 | + | |
66 | static inline bool bond_is_nondyn_tlb(const struct bonding *bond) | |
67 | { | |
68 | return (BOND_MODE(bond) == BOND_MODE_TLB) && |