Commit e185483e authored by Flavio Leitner's avatar Flavio Leitner Committed by David S. Miller

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: default avatarFlavio Leitner <fbl@redhat.com>
Signed-off-by: default avatarJiri Pirko <jiri@resnulli.us>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3b72c2fe
...@@ -508,6 +508,7 @@ static bool team_is_mode_set(struct team *team) ...@@ -508,6 +508,7 @@ static bool team_is_mode_set(struct team *team)
static void team_set_no_mode(struct team *team) static void team_set_no_mode(struct team *team)
{ {
team->user_carrier_enabled = false;
team->mode = &__team_no_mode; team->mode = &__team_no_mode;
} }
...@@ -1710,6 +1711,10 @@ static netdev_features_t team_fix_features(struct net_device *dev, ...@@ -1710,6 +1711,10 @@ static netdev_features_t team_fix_features(struct net_device *dev,
static int team_change_carrier(struct net_device *dev, bool new_carrier) static int team_change_carrier(struct net_device *dev, bool new_carrier)
{ {
struct team *team = netdev_priv(dev);
team->user_carrier_enabled = true;
if (new_carrier) if (new_carrier)
netif_carrier_on(dev); netif_carrier_on(dev);
else else
...@@ -2573,6 +2578,9 @@ static void __team_carrier_check(struct team *team) ...@@ -2573,6 +2578,9 @@ static void __team_carrier_check(struct team *team)
struct team_port *port; struct team_port *port;
bool team_linkup; bool team_linkup;
if (team->user_carrier_enabled)
return;
team_linkup = false; team_linkup = false;
list_for_each_entry(port, &team->port_list, list) { list_for_each_entry(port, &team->port_list, list) {
if (port->linkup) { if (port->linkup) {
......
...@@ -186,6 +186,7 @@ struct team { ...@@ -186,6 +186,7 @@ struct team {
const struct team_mode *mode; const struct team_mode *mode;
struct team_mode_ops ops; struct team_mode_ops ops;
bool user_carrier_enabled;
bool queue_override_enabled; bool queue_override_enabled;
struct list_head *qom_lists; /* array of queue override mapping lists */ struct list_head *qom_lists; /* array of queue override mapping lists */
long mode_priv[TEAM_MODE_PRIV_LONGS]; long mode_priv[TEAM_MODE_PRIV_LONGS];
......
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