diff mbox series

[net] team: use operstate consistently for linkup

Message ID 20190219155715.769-1-gwilkie@vyatta.att-mail.com
State Changes Requested
Delegated to: David Miller
Headers show
Series [net] team: use operstate consistently for linkup | expand

Commit Message

George Wilkie Feb. 19, 2019, 3:57 p.m. UTC
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(-)

Comments

David Miller Feb. 19, 2019, 10:18 p.m. UTC | #1
From: George Wilkie <gwilkie@vyatta.att-mail.com>
Date: Tue, 19 Feb 2019 15:57:15 +0000

> Fixes: f1d22a1e0595 ("team: account for oper state")
> 
> Signed-off-by: George Wilkie <gwilkie@vyatta.att-mail.com>

Please do not put an empty line between Fixes: and other tags, all tags
are equal and should be grouped together.
George Wilkie Feb. 20, 2019, 8:21 a.m. UTC | #2
On Tue, Feb 19, 2019 at 02:18:30PM -0800, David Miller wrote:
> From: George Wilkie <gwilkie@vyatta.att-mail.com>
> Date: Tue, 19 Feb 2019 15:57:15 +0000
> 
> > Fixes: f1d22a1e0595 ("team: account for oper state")
> > 
> > Signed-off-by: George Wilkie <gwilkie@vyatta.att-mail.com>
> 
> Please do not put an empty line between Fixes: and other tags, all tags
> are equal and should be grouped together.
> 

Fixed in v2. Thanks.
diff mbox series

Patch

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: