team: add port_[enabled/disabled] mode callbacks
Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
f88725ffb0
commit
4bccfd17e1
@ -714,6 +714,8 @@ static void team_port_enable(struct team *team,
|
|||||||
port->index = team->en_port_count++;
|
port->index = team->en_port_count++;
|
||||||
hlist_add_head_rcu(&port->hlist,
|
hlist_add_head_rcu(&port->hlist,
|
||||||
team_port_index_hash(team, port->index));
|
team_port_index_hash(team, port->index));
|
||||||
|
if (team->ops.port_enabled)
|
||||||
|
team->ops.port_enabled(team, port);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __reconstruct_port_hlist(struct team *team, int rm_index)
|
static void __reconstruct_port_hlist(struct team *team, int rm_index)
|
||||||
@ -737,6 +739,8 @@ static void team_port_disable(struct team *team,
|
|||||||
|
|
||||||
if (!team_port_enabled(port))
|
if (!team_port_enabled(port))
|
||||||
return;
|
return;
|
||||||
|
if (team->ops.port_disabled)
|
||||||
|
team->ops.port_disabled(team, port);
|
||||||
hlist_del_rcu(&port->hlist);
|
hlist_del_rcu(&port->hlist);
|
||||||
__reconstruct_port_hlist(team, rm_index);
|
__reconstruct_port_hlist(team, rm_index);
|
||||||
team->en_port_count--;
|
team->en_port_count--;
|
||||||
|
@ -74,6 +74,8 @@ struct team_mode_ops {
|
|||||||
int (*port_enter)(struct team *team, struct team_port *port);
|
int (*port_enter)(struct team *team, struct team_port *port);
|
||||||
void (*port_leave)(struct team *team, struct team_port *port);
|
void (*port_leave)(struct team *team, struct team_port *port);
|
||||||
void (*port_change_mac)(struct team *team, struct team_port *port);
|
void (*port_change_mac)(struct team *team, struct team_port *port);
|
||||||
|
void (*port_enabled)(struct team *team, struct team_port *port);
|
||||||
|
void (*port_disabled)(struct team *team, struct team_port *port);
|
||||||
};
|
};
|
||||||
|
|
||||||
enum team_option_type {
|
enum team_option_type {
|
||||||
|
Loading…
Reference in New Issue
Block a user