Commit 675b8044e17cc6528363e8b0322be0243621cd9b

Authored by Jiri Pirko
Committed by David S. Miller
1 parent c3969d80a3

team: ab: set active port option as changed when port is leaving

In case port is leaving the team, set the option "activeport" as changed
so the change can be properly propagated to userspace

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>

Showing 1 changed file with 12 additions and 1 deletions Side-by-side Diff

drivers/net/team/team_mode_activebackup.c
... ... @@ -19,6 +19,7 @@
19 19  
20 20 struct ab_priv {
21 21 struct team_port __rcu *active_port;
  22 + struct team_option_inst_info *ap_opt_inst_info;
22 23 };
23 24  
24 25 static struct ab_priv *ab_priv(struct team *team)
25 26  
26 27  
... ... @@ -54,10 +55,19 @@
54 55  
55 56 static void ab_port_leave(struct team *team, struct team_port *port)
56 57 {
57   - if (ab_priv(team)->active_port == port)
  58 + if (ab_priv(team)->active_port == port) {
58 59 RCU_INIT_POINTER(ab_priv(team)->active_port, NULL);
  60 + team_option_inst_set_change(ab_priv(team)->ap_opt_inst_info);
  61 + }
59 62 }
60 63  
  64 +static int ab_active_port_init(struct team *team,
  65 + struct team_option_inst_info *info)
  66 +{
  67 + ab_priv(team)->ap_opt_inst_info = info;
  68 + return 0;
  69 +}
  70 +
61 71 static int ab_active_port_get(struct team *team, struct team_gsetter_ctx *ctx)
62 72 {
63 73 struct team_port *active_port;
... ... @@ -88,6 +98,7 @@
88 98 {
89 99 .name = "activeport",
90 100 .type = TEAM_OPTION_TYPE_U32,
  101 + .init = ab_active_port_init,
91 102 .getter = ab_active_port_get,
92 103 .setter = ab_active_port_set,
93 104 },