Commit 8c7a7726 authored by George Wilkie's avatar George Wilkie Committed by David S. Miller

team: use operstate consistently for linkup

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: f1d22a1e ("team: account for oper state")
Signed-off-by: default avatarGeorge Wilkie <gwilkie@vyatta.att-mail.com>
Acked-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c286909f
...@@ -1256,7 +1256,7 @@ static int team_port_add(struct team *team, struct net_device *port_dev, ...@@ -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); list_add_tail_rcu(&port->list, &team->port_list);
team_port_enable(team, port); team_port_enable(team, port);
__team_compute_features(team); __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); __team_options_change_check(team);
netdev_info(dev, "Port device %s added\n", portname); netdev_info(dev, "Port device %s added\n", portname);
...@@ -2915,7 +2915,7 @@ static int team_device_event(struct notifier_block *unused, ...@@ -2915,7 +2915,7 @@ static int team_device_event(struct notifier_block *unused,
switch (event) { switch (event) {
case NETDEV_UP: case NETDEV_UP:
if (netif_carrier_ok(dev)) if (netif_oper_up(dev))
team_port_change_check(port, true); team_port_change_check(port, true);
break; break;
case NETDEV_DOWN: case NETDEV_DOWN:
......
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