Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 314524
b: refs/heads/master
c: 6dab015
h: refs/heads/master
v: v3
  • Loading branch information
Jiri Pirko authored and David S. Miller committed Jun 20, 2012
1 parent e1ff58e commit 601accd
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f643776e4d1906ceff59f18315d6aba8e85db343
refs/heads/master: 6dab015cf8c9d2fabb13d0332998bc440e9c6555
8 changes: 6 additions & 2 deletions trunk/drivers/net/team/team_mode_activebackup.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,12 @@ static void ab_port_leave(struct team *team, struct team_port *port)

static int ab_active_port_get(struct team *team, struct team_gsetter_ctx *ctx)
{
if (ab_priv(team)->active_port)
ctx->data.u32_val = ab_priv(team)->active_port->dev->ifindex;
struct team_port *active_port;

active_port = rcu_dereference_protected(ab_priv(team)->active_port,
lockdep_is_held(&team->lock));
if (active_port)
ctx->data.u32_val = active_port->dev->ifindex;
else
ctx->data.u32_val = 0;
return 0;
Expand Down
14 changes: 10 additions & 4 deletions trunk/drivers/net/team/team_mode_loadbalance.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ static void lb_tx_hash_to_port_mapping_null_port(struct team *team,
struct lb_port_mapping *pm;

pm = &lb_priv->ex->tx_hash_to_port_mapping[i];
if (pm->port == port) {
rcu_assign_pointer(pm->port, NULL);
if (rcu_access_pointer(pm->port) == port) {
RCU_INIT_POINTER(pm->port, NULL);
team_option_inst_set_change(pm->opt_inst_info);
changed = true;
}
Expand Down Expand Up @@ -274,6 +274,7 @@ static int lb_bpf_func_set(struct team *team, struct team_gsetter_ctx *ctx)
{
struct lb_priv *lb_priv = get_lb_priv(team);
struct sk_filter *fp = NULL;
struct sk_filter *orig_fp;
struct sock_fprog *fprog = NULL;
int err;

Expand All @@ -292,7 +293,9 @@ static int lb_bpf_func_set(struct team *team, struct team_gsetter_ctx *ctx)
if (lb_priv->ex->orig_fprog) {
/* Clear old filter data */
__fprog_destroy(lb_priv->ex->orig_fprog);
sk_unattached_filter_destroy(lb_priv->fp);
orig_fp = rcu_dereference_protected(lb_priv->fp,
lockdep_is_held(&team->lock));
sk_unattached_filter_destroy(orig_fp);
}

rcu_assign_pointer(lb_priv->fp, fp);
Expand All @@ -303,9 +306,12 @@ static int lb_bpf_func_set(struct team *team, struct team_gsetter_ctx *ctx)
static int lb_tx_method_get(struct team *team, struct team_gsetter_ctx *ctx)
{
struct lb_priv *lb_priv = get_lb_priv(team);
lb_select_tx_port_func_t *func;
char *name;

name = lb_select_tx_port_get_name(lb_priv->select_tx_port_func);
func = rcu_dereference_protected(lb_priv->select_tx_port_func,
lockdep_is_held(&team->lock));
name = lb_select_tx_port_get_name(func);
BUG_ON(!name);
ctx->data.str_val = name;
return 0;
Expand Down

0 comments on commit 601accd

Please sign in to comment.