aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJiri Pirko <jiri@resnulli.us>2013-02-01 03:17:26 -0500
committerDavid S. Miller <davem@davemloft.net>2013-02-04 14:55:45 -0500
commit675b8044e17cc6528363e8b0322be0243621cd9b (patch)
tree4389c6c8835eabb477f34e1035136a9fd6757091 /drivers
parentc3969d80a396bffd7f80ff57987b15793be67926 (diff)
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/team/team_mode_activebackup.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/net/team/team_mode_activebackup.c b/drivers/net/team/team_mode_activebackup.c
index 6262b4defd93..40fd3381b693 100644
--- a/drivers/net/team/team_mode_activebackup.c
+++ b/drivers/net/team/team_mode_activebackup.c
@@ -19,6 +19,7 @@
19 19
20struct ab_priv { 20struct ab_priv {
21 struct team_port __rcu *active_port; 21 struct team_port __rcu *active_port;
22 struct team_option_inst_info *ap_opt_inst_info;
22}; 23};
23 24
24static struct ab_priv *ab_priv(struct team *team) 25static struct ab_priv *ab_priv(struct team *team)
@@ -54,8 +55,17 @@ drop:
54 55
55static void ab_port_leave(struct team *team, struct team_port *port) 56static 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 RCU_INIT_POINTER(ab_priv(team)->active_port, NULL); 59 RCU_INIT_POINTER(ab_priv(team)->active_port, NULL);
60 team_option_inst_set_change(ab_priv(team)->ap_opt_inst_info);
61 }
62}
63
64static 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;
59} 69}
60 70
61static int ab_active_port_get(struct team *team, struct team_gsetter_ctx *ctx) 71static int ab_active_port_get(struct team *team, struct team_gsetter_ctx *ctx)
@@ -88,6 +98,7 @@ static const struct team_option ab_options[] = {
88 { 98 {
89 .name = "activeport", 99 .name = "activeport",
90 .type = TEAM_OPTION_TYPE_U32, 100 .type = TEAM_OPTION_TYPE_U32,
101 .init = ab_active_port_init,
91 .getter = ab_active_port_get, 102 .getter = ab_active_port_get,
92 .setter = ab_active_port_set, 103 .setter = ab_active_port_set,
93 }, 104 },