* [PATCH net v2] team: use operstate consistently for linkup
@ 2019-02-20 8:19 George Wilkie
2019-02-20 8:36 ` Jiri Pirko
2019-02-22 19:41 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: George Wilkie @ 2019-02-20 8:19 UTC (permalink / raw)
To: Jiri Pirko, David S. Miller; +Cc: netdev
When a port is added to a team, its initial state is derived
from netif_carrier_ok rather than netif_oper_up.
If it is carrier up but operationally down at the time of being
added, the port state.linkup will be set prematurely.
port state.linkup should be set consistently using
netif_oper_up rather than netif_carrier_ok.
Fixes: f1d22a1e0595 ("team: account for oper state")
Signed-off-by: George Wilkie <gwilkie@vyatta.att-mail.com>
---
drivers/net/team/team.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
index 958f1cf67282..6ce3f666d142 100644
--- a/drivers/net/team/team.c
+++ b/drivers/net/team/team.c
@@ -1256,7 +1256,7 @@ static int team_port_add(struct team *team, struct net_device *port_dev,
list_add_tail_rcu(&port->list, &team->port_list);
team_port_enable(team, port);
__team_compute_features(team);
- __team_port_change_port_added(port, !!netif_carrier_ok(port_dev));
+ __team_port_change_port_added(port, !!netif_oper_up(port_dev));
__team_options_change_check(team);
netdev_info(dev, "Port device %s added\n", portname);
@@ -2915,7 +2915,7 @@ static int team_device_event(struct notifier_block *unused,
switch (event) {
case NETDEV_UP:
- if (netif_carrier_ok(dev))
+ if (netif_oper_up(dev))
team_port_change_check(port, true);
break;
case NETDEV_DOWN:
--
2.11.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net v2] team: use operstate consistently for linkup
2019-02-20 8:19 [PATCH net v2] team: use operstate consistently for linkup George Wilkie
@ 2019-02-20 8:36 ` Jiri Pirko
2019-02-22 19:41 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Jiri Pirko @ 2019-02-20 8:36 UTC (permalink / raw)
To: George Wilkie; +Cc: David S. Miller, netdev
Wed, Feb 20, 2019 at 09:19:11AM CET, gwilkie@vyatta.att-mail.com wrote:
>When a port is added to a team, its initial state is derived
>from netif_carrier_ok rather than netif_oper_up.
>If it is carrier up but operationally down at the time of being
>added, the port state.linkup will be set prematurely.
>port state.linkup should be set consistently using
>netif_oper_up rather than netif_carrier_ok.
>
>Fixes: f1d22a1e0595 ("team: account for oper state")
>Signed-off-by: George Wilkie <gwilkie@vyatta.att-mail.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net v2] team: use operstate consistently for linkup
2019-02-20 8:19 [PATCH net v2] team: use operstate consistently for linkup George Wilkie
2019-02-20 8:36 ` Jiri Pirko
@ 2019-02-22 19:41 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2019-02-22 19:41 UTC (permalink / raw)
To: gwilkie; +Cc: jiri, netdev
From: George Wilkie <gwilkie@vyatta.att-mail.com>
Date: Wed, 20 Feb 2019 08:19:11 +0000
> When a port is added to a team, its initial state is derived
> from netif_carrier_ok rather than netif_oper_up.
> If it is carrier up but operationally down at the time of being
> added, the port state.linkup will be set prematurely.
> port state.linkup should be set consistently using
> netif_oper_up rather than netif_carrier_ok.
>
> Fixes: f1d22a1e0595 ("team: account for oper state")
> Signed-off-by: George Wilkie <gwilkie@vyatta.att-mail.com>
Applied and queued up for -stable.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-02-22 19:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-20 8:19 [PATCH net v2] team: use operstate consistently for linkup George Wilkie
2019-02-20 8:36 ` Jiri Pirko
2019-02-22 19:41 ` 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).