summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorge Wilkie <gwilkie@vyatta.att-mail.com>2019-02-20 08:19:11 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-03-19 13:11:55 +0100
commita19b996dd7a7048ee25c942692f2acde339b5205 (patch)
treee058f7b4d4ebb36b3ebd6c186c3029d1e88f8dbf
parent65cafef48c93573b45ef8d4c7b703a07cd40a4b6 (diff)
downloadlinux-stable-a19b996dd7a7048ee25c942692f2acde339b5205.tar.gz
linux-stable-a19b996dd7a7048ee25c942692f2acde339b5205.tar.bz2
linux-stable-a19b996dd7a7048ee25c942692f2acde339b5205.zip
team: use operstate consistently for linkup
[ Upstream commit 8c7a77267eec81dd81af8412f29e50c0b1082548 ] 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> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/net/team/team.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
index 86db1205a396..00632a45928f 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: