Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 323159
b: refs/heads/master
c: 0b121fd
h: refs/heads/master
i:
  323157: e723a73
  323155: 6ade144
  323151: 77eaab5
v: v3
  • Loading branch information
Jiri Pirko authored and David S. Miller committed Sep 22, 2012
1 parent 4c05437 commit d619a9b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ab43ed8b7490cb387782423ecf74aeee7237e591
refs/heads/master: 0b121fd28d071c766dddab743031ba6cfe9be68e
32 changes: 24 additions & 8 deletions trunk/drivers/net/team/team.c
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,7 @@ static struct netpoll_info *team_netpoll_info(struct team *team)
}
#endif

static void __team_port_change_check(struct team_port *port, bool linkup);
static void __team_port_change_port_added(struct team_port *port, bool linkup);

static int team_port_add(struct team *team, struct net_device *port_dev)
{
Expand Down Expand Up @@ -948,7 +948,7 @@ static int team_port_add(struct team *team, struct net_device *port_dev)
team_port_enable(team, port);
list_add_tail_rcu(&port->list, &team->port_list);
__team_compute_features(team);
__team_port_change_check(port, !!netif_carrier_ok(port_dev));
__team_port_change_port_added(port, !!netif_carrier_ok(port_dev));
__team_options_change_check(team);

netdev_info(dev, "Port device %s added\n", portname);
Expand Down Expand Up @@ -983,6 +983,8 @@ static int team_port_add(struct team *team, struct net_device *port_dev)
return err;
}

static void __team_port_change_port_removed(struct team_port *port);

static int team_port_del(struct team *team, struct net_device *port_dev)
{
struct net_device *dev = team->dev;
Expand All @@ -999,8 +1001,7 @@ static int team_port_del(struct team *team, struct net_device *port_dev)
__team_option_inst_mark_removed_port(team, port);
__team_options_change_check(team);
__team_option_inst_del_port(team, port);
port->removed = true;
__team_port_change_check(port, false);
__team_port_change_port_removed(port);
team_port_disable(team, port);
list_del_rcu(&port->list);
netdev_rx_handler_unregister(port_dev);
Expand Down Expand Up @@ -2251,13 +2252,11 @@ static void __team_options_change_check(struct team *team)
}

/* rtnl lock is held */
static void __team_port_change_check(struct team_port *port, bool linkup)

static void __team_port_change_send(struct team_port *port, bool linkup)
{
int err;

if (!port->removed && port->state.linkup == linkup)
return;

port->changed = true;
port->state.linkup = linkup;
team_refresh_port_linkup(port);
Expand All @@ -2282,6 +2281,23 @@ static void __team_port_change_check(struct team_port *port, bool linkup)

}

static void __team_port_change_check(struct team_port *port, bool linkup)
{
if (port->state.linkup != linkup)
__team_port_change_send(port, linkup);
}

static void __team_port_change_port_added(struct team_port *port, bool linkup)
{
__team_port_change_send(port, linkup);
}

static void __team_port_change_port_removed(struct team_port *port)
{
port->removed = true;
__team_port_change_send(port, false);
}

static void team_port_change_check(struct team_port *port, bool linkup)
{
struct team *team = port->team;
Expand Down

0 comments on commit d619a9b

Please sign in to comment.