Skip to content

Commit 4bccfd1

Browse files
Jiri Pirkodavem330
authored andcommitted
team: add port_[enabled/disabled] mode callbacks
Signed-off-by: Jiri Pirko <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent f88725f commit 4bccfd1

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

drivers/net/team/team.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,8 @@ static void team_port_enable(struct team *team,
714714
port->index = team->en_port_count++;
715715
hlist_add_head_rcu(&port->hlist,
716716
team_port_index_hash(team, port->index));
717+
if (team->ops.port_enabled)
718+
team->ops.port_enabled(team, port);
717719
}
718720

719721
static void __reconstruct_port_hlist(struct team *team, int rm_index)
@@ -737,6 +739,8 @@ static void team_port_disable(struct team *team,
737739

738740
if (!team_port_enabled(port))
739741
return;
742+
if (team->ops.port_disabled)
743+
team->ops.port_disabled(team, port);
740744
hlist_del_rcu(&port->hlist);
741745
__reconstruct_port_hlist(team, rm_index);
742746
team->en_port_count--;

include/linux/if_team.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ struct team_mode_ops {
7474
int (*port_enter)(struct team *team, struct team_port *port);
7575
void (*port_leave)(struct team *team, struct team_port *port);
7676
void (*port_change_mac)(struct team *team, struct team_port *port);
77+
void (*port_enabled)(struct team *team, struct team_port *port);
78+
void (*port_disabled)(struct team *team, struct team_port *port);
7779
};
7880

7981
enum team_option_type {

0 commit comments

Comments
 (0)