Commit 3a0d6c5a authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller

team: implement lower state change propagation

Let netdev notifier listeners know about link-up and port-enable state
changes.
Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7d259505
...@@ -91,10 +91,24 @@ void team_modeop_port_change_dev_addr(struct team *team, ...@@ -91,10 +91,24 @@ void team_modeop_port_change_dev_addr(struct team *team,
} }
EXPORT_SYMBOL(team_modeop_port_change_dev_addr); EXPORT_SYMBOL(team_modeop_port_change_dev_addr);
static void team_lower_state_changed(struct team_port *port)
{
struct netdev_lag_lower_state_info info;
info.link_up = port->linkup;
info.tx_enabled = team_port_enabled(port);
netdev_lower_state_changed(port->dev, &info);
}
static void team_refresh_port_linkup(struct team_port *port) static void team_refresh_port_linkup(struct team_port *port)
{ {
port->linkup = port->user.linkup_enabled ? port->user.linkup : bool new_linkup = port->user.linkup_enabled ? port->user.linkup :
port->state.linkup; port->state.linkup;
if (port->linkup != new_linkup) {
port->linkup = new_linkup;
team_lower_state_changed(port);
}
} }
...@@ -932,6 +946,7 @@ static void team_port_enable(struct team *team, ...@@ -932,6 +946,7 @@ static void team_port_enable(struct team *team,
team->ops.port_enabled(team, port); team->ops.port_enabled(team, port);
team_notify_peers(team); team_notify_peers(team);
team_mcast_rejoin(team); team_mcast_rejoin(team);
team_lower_state_changed(port);
} }
static void __reconstruct_port_hlist(struct team *team, int rm_index) static void __reconstruct_port_hlist(struct team *team, int rm_index)
...@@ -963,6 +978,7 @@ static void team_port_disable(struct team *team, ...@@ -963,6 +978,7 @@ static void team_port_disable(struct team *team,
team_adjust_ops(team); team_adjust_ops(team);
team_notify_peers(team); team_notify_peers(team);
team_mcast_rejoin(team); team_mcast_rejoin(team);
team_lower_state_changed(port);
} }
#define TEAM_VLAN_FEATURES (NETIF_F_ALL_CSUM | NETIF_F_SG | \ #define TEAM_VLAN_FEATURES (NETIF_F_ALL_CSUM | NETIF_F_SG | \
......
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