提交 675b8044 编写于 作者: J Jiri Pirko 提交者: David S. Miller

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: NJiri Pirko <jiri@resnulli.us>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 c3969d80
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
struct ab_priv { struct ab_priv {
struct team_port __rcu *active_port; struct team_port __rcu *active_port;
struct team_option_inst_info *ap_opt_inst_info;
}; };
static struct ab_priv *ab_priv(struct team *team) static struct ab_priv *ab_priv(struct team *team)
...@@ -54,8 +55,17 @@ static bool ab_transmit(struct team *team, struct sk_buff *skb) ...@@ -54,8 +55,17 @@ static bool ab_transmit(struct team *team, struct sk_buff *skb)
static void ab_port_leave(struct team *team, struct team_port *port) static void ab_port_leave(struct team *team, struct team_port *port)
{ {
if (ab_priv(team)->active_port == port) if (ab_priv(team)->active_port == port) {
RCU_INIT_POINTER(ab_priv(team)->active_port, NULL); RCU_INIT_POINTER(ab_priv(team)->active_port, NULL);
team_option_inst_set_change(ab_priv(team)->ap_opt_inst_info);
}
}
static int ab_active_port_init(struct team *team,
struct team_option_inst_info *info)
{
ab_priv(team)->ap_opt_inst_info = info;
return 0;
} }
static int ab_active_port_get(struct team *team, struct team_gsetter_ctx *ctx) static 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,6 +98,7 @@ static const struct team_option ab_options[] = {
{ {
.name = "activeport", .name = "activeport",
.type = TEAM_OPTION_TYPE_U32, .type = TEAM_OPTION_TYPE_U32,
.init = ab_active_port_init,
.getter = ab_active_port_get, .getter = ab_active_port_get,
.setter = ab_active_port_set, .setter = ab_active_port_set,
}, },
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册