diff options
author | Flavio Leitner <fbl@redhat.com> | 2013-02-05 04:30:55 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-02-06 15:48:09 -0500 |
commit | e185483e6b84c127d0b1c890b6b703701ae52d35 (patch) | |
tree | 199255216263143c2ee1fd24030611c531621988 /drivers/net/team | |
parent | 3b72c2fe0c6bbec42ed7f899931daef227b80322 (diff) |
team: allow userspace to take control over carrier
Some modes don't require any special carrier handling so
in these cases, the kernel can control the carrier as for
any other interface. However, some other modes, e.g. lacp,
requires more than just that, so userspace needs to control
the carrier itself.
The daemon today is ready to control it, but the kernel
still can change it based on events.
This fix so that either kernel or userspace is controlling
the carrier.
Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/team')
-rw-r--r-- | drivers/net/team/team.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c index 694ccf6d71a3..05c5efe84591 100644 --- a/drivers/net/team/team.c +++ b/drivers/net/team/team.c | |||
@@ -508,6 +508,7 @@ static bool team_is_mode_set(struct team *team) | |||
508 | 508 | ||
509 | static void team_set_no_mode(struct team *team) | 509 | static void team_set_no_mode(struct team *team) |
510 | { | 510 | { |
511 | team->user_carrier_enabled = false; | ||
511 | team->mode = &__team_no_mode; | 512 | team->mode = &__team_no_mode; |
512 | } | 513 | } |
513 | 514 | ||
@@ -1710,6 +1711,10 @@ static netdev_features_t team_fix_features(struct net_device *dev, | |||
1710 | 1711 | ||
1711 | static int team_change_carrier(struct net_device *dev, bool new_carrier) | 1712 | static int team_change_carrier(struct net_device *dev, bool new_carrier) |
1712 | { | 1713 | { |
1714 | struct team *team = netdev_priv(dev); | ||
1715 | |||
1716 | team->user_carrier_enabled = true; | ||
1717 | |||
1713 | if (new_carrier) | 1718 | if (new_carrier) |
1714 | netif_carrier_on(dev); | 1719 | netif_carrier_on(dev); |
1715 | else | 1720 | else |
@@ -2573,6 +2578,9 @@ static void __team_carrier_check(struct team *team) | |||
2573 | struct team_port *port; | 2578 | struct team_port *port; |
2574 | bool team_linkup; | 2579 | bool team_linkup; |
2575 | 2580 | ||
2581 | if (team->user_carrier_enabled) | ||
2582 | return; | ||
2583 | |||
2576 | team_linkup = false; | 2584 | team_linkup = false; |
2577 | list_for_each_entry(port, &team->port_list, list) { | 2585 | list_for_each_entry(port, &team->port_list, list) { |
2578 | if (port->linkup) { | 2586 | if (port->linkup) { |