mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
net_sched: remove BH blocking in eight actions
Followup of f45b45cbfa ("Merge branch
'net_sched-act-extend-rcu-use-in-dump-methods'")
We never grab tcf_lock from BH context in these modules:
act_connmark
act_csum
act_ct
act_ctinfo
act_mpls
act_nat
act_pedit
act_skbedit
No longer block BH when acquiring tcf_lock from init functions.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250827125349.3505302-2-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
2584ed250a
commit
3133d5c15c
@@ -169,10 +169,10 @@ static int tcf_connmark_init(struct net *net, struct nlattr *nla,
|
|||||||
|
|
||||||
nparms->action = parm->action;
|
nparms->action = parm->action;
|
||||||
|
|
||||||
spin_lock_bh(&ci->tcf_lock);
|
spin_lock(&ci->tcf_lock);
|
||||||
goto_ch = tcf_action_set_ctrlact(*a, parm->action, goto_ch);
|
goto_ch = tcf_action_set_ctrlact(*a, parm->action, goto_ch);
|
||||||
oparms = rcu_replace_pointer(ci->parms, nparms, lockdep_is_held(&ci->tcf_lock));
|
oparms = rcu_replace_pointer(ci->parms, nparms, lockdep_is_held(&ci->tcf_lock));
|
||||||
spin_unlock_bh(&ci->tcf_lock);
|
spin_unlock(&ci->tcf_lock);
|
||||||
|
|
||||||
if (goto_ch)
|
if (goto_ch)
|
||||||
tcf_chain_put_by_act(goto_ch);
|
tcf_chain_put_by_act(goto_ch);
|
||||||
|
|||||||
@@ -101,11 +101,11 @@ static int tcf_csum_init(struct net *net, struct nlattr *nla,
|
|||||||
params_new->update_flags = parm->update_flags;
|
params_new->update_flags = parm->update_flags;
|
||||||
params_new->action = parm->action;
|
params_new->action = parm->action;
|
||||||
|
|
||||||
spin_lock_bh(&p->tcf_lock);
|
spin_lock(&p->tcf_lock);
|
||||||
goto_ch = tcf_action_set_ctrlact(*a, parm->action, goto_ch);
|
goto_ch = tcf_action_set_ctrlact(*a, parm->action, goto_ch);
|
||||||
params_new = rcu_replace_pointer(p->params, params_new,
|
params_new = rcu_replace_pointer(p->params, params_new,
|
||||||
lockdep_is_held(&p->tcf_lock));
|
lockdep_is_held(&p->tcf_lock));
|
||||||
spin_unlock_bh(&p->tcf_lock);
|
spin_unlock(&p->tcf_lock);
|
||||||
|
|
||||||
if (goto_ch)
|
if (goto_ch)
|
||||||
tcf_chain_put_by_act(goto_ch);
|
tcf_chain_put_by_act(goto_ch);
|
||||||
|
|||||||
@@ -1410,11 +1410,11 @@ static int tcf_ct_init(struct net *net, struct nlattr *nla,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
params->action = parm->action;
|
params->action = parm->action;
|
||||||
spin_lock_bh(&c->tcf_lock);
|
spin_lock(&c->tcf_lock);
|
||||||
goto_ch = tcf_action_set_ctrlact(*a, parm->action, goto_ch);
|
goto_ch = tcf_action_set_ctrlact(*a, parm->action, goto_ch);
|
||||||
params = rcu_replace_pointer(c->params, params,
|
params = rcu_replace_pointer(c->params, params,
|
||||||
lockdep_is_held(&c->tcf_lock));
|
lockdep_is_held(&c->tcf_lock));
|
||||||
spin_unlock_bh(&c->tcf_lock);
|
spin_unlock(&c->tcf_lock);
|
||||||
|
|
||||||
if (goto_ch)
|
if (goto_ch)
|
||||||
tcf_chain_put_by_act(goto_ch);
|
tcf_chain_put_by_act(goto_ch);
|
||||||
|
|||||||
@@ -258,11 +258,11 @@ static int tcf_ctinfo_init(struct net *net, struct nlattr *nla,
|
|||||||
|
|
||||||
cp_new->action = actparm->action;
|
cp_new->action = actparm->action;
|
||||||
|
|
||||||
spin_lock_bh(&ci->tcf_lock);
|
spin_lock(&ci->tcf_lock);
|
||||||
goto_ch = tcf_action_set_ctrlact(*a, actparm->action, goto_ch);
|
goto_ch = tcf_action_set_ctrlact(*a, actparm->action, goto_ch);
|
||||||
cp_new = rcu_replace_pointer(ci->params, cp_new,
|
cp_new = rcu_replace_pointer(ci->params, cp_new,
|
||||||
lockdep_is_held(&ci->tcf_lock));
|
lockdep_is_held(&ci->tcf_lock));
|
||||||
spin_unlock_bh(&ci->tcf_lock);
|
spin_unlock(&ci->tcf_lock);
|
||||||
|
|
||||||
if (goto_ch)
|
if (goto_ch)
|
||||||
tcf_chain_put_by_act(goto_ch);
|
tcf_chain_put_by_act(goto_ch);
|
||||||
|
|||||||
@@ -296,10 +296,10 @@ static int tcf_mpls_init(struct net *net, struct nlattr *nla,
|
|||||||
htons(ETH_P_MPLS_UC));
|
htons(ETH_P_MPLS_UC));
|
||||||
p->action = parm->action;
|
p->action = parm->action;
|
||||||
|
|
||||||
spin_lock_bh(&m->tcf_lock);
|
spin_lock(&m->tcf_lock);
|
||||||
goto_ch = tcf_action_set_ctrlact(*a, parm->action, goto_ch);
|
goto_ch = tcf_action_set_ctrlact(*a, parm->action, goto_ch);
|
||||||
p = rcu_replace_pointer(m->mpls_p, p, lockdep_is_held(&m->tcf_lock));
|
p = rcu_replace_pointer(m->mpls_p, p, lockdep_is_held(&m->tcf_lock));
|
||||||
spin_unlock_bh(&m->tcf_lock);
|
spin_unlock(&m->tcf_lock);
|
||||||
|
|
||||||
if (goto_ch)
|
if (goto_ch)
|
||||||
tcf_chain_put_by_act(goto_ch);
|
tcf_chain_put_by_act(goto_ch);
|
||||||
|
|||||||
@@ -95,10 +95,10 @@ static int tcf_nat_init(struct net *net, struct nlattr *nla, struct nlattr *est,
|
|||||||
|
|
||||||
p = to_tcf_nat(*a);
|
p = to_tcf_nat(*a);
|
||||||
|
|
||||||
spin_lock_bh(&p->tcf_lock);
|
spin_lock(&p->tcf_lock);
|
||||||
goto_ch = tcf_action_set_ctrlact(*a, parm->action, goto_ch);
|
goto_ch = tcf_action_set_ctrlact(*a, parm->action, goto_ch);
|
||||||
oparm = rcu_replace_pointer(p->parms, nparm, lockdep_is_held(&p->tcf_lock));
|
oparm = rcu_replace_pointer(p->parms, nparm, lockdep_is_held(&p->tcf_lock));
|
||||||
spin_unlock_bh(&p->tcf_lock);
|
spin_unlock(&p->tcf_lock);
|
||||||
|
|
||||||
if (goto_ch)
|
if (goto_ch)
|
||||||
tcf_chain_put_by_act(goto_ch);
|
tcf_chain_put_by_act(goto_ch);
|
||||||
|
|||||||
@@ -280,10 +280,10 @@ static int tcf_pedit_init(struct net *net, struct nlattr *nla,
|
|||||||
|
|
||||||
p = to_pedit(*a);
|
p = to_pedit(*a);
|
||||||
nparms->action = parm->action;
|
nparms->action = parm->action;
|
||||||
spin_lock_bh(&p->tcf_lock);
|
spin_lock(&p->tcf_lock);
|
||||||
goto_ch = tcf_action_set_ctrlact(*a, parm->action, goto_ch);
|
goto_ch = tcf_action_set_ctrlact(*a, parm->action, goto_ch);
|
||||||
oparms = rcu_replace_pointer(p->parms, nparms, 1);
|
oparms = rcu_replace_pointer(p->parms, nparms, 1);
|
||||||
spin_unlock_bh(&p->tcf_lock);
|
spin_unlock(&p->tcf_lock);
|
||||||
|
|
||||||
if (oparms)
|
if (oparms)
|
||||||
call_rcu(&oparms->rcu, tcf_pedit_cleanup_rcu);
|
call_rcu(&oparms->rcu, tcf_pedit_cleanup_rcu);
|
||||||
|
|||||||
@@ -261,11 +261,11 @@ static int tcf_skbedit_init(struct net *net, struct nlattr *nla,
|
|||||||
params_new->mask = *mask;
|
params_new->mask = *mask;
|
||||||
|
|
||||||
params_new->action = parm->action;
|
params_new->action = parm->action;
|
||||||
spin_lock_bh(&d->tcf_lock);
|
spin_lock(&d->tcf_lock);
|
||||||
goto_ch = tcf_action_set_ctrlact(*a, parm->action, goto_ch);
|
goto_ch = tcf_action_set_ctrlact(*a, parm->action, goto_ch);
|
||||||
params_new = rcu_replace_pointer(d->params, params_new,
|
params_new = rcu_replace_pointer(d->params, params_new,
|
||||||
lockdep_is_held(&d->tcf_lock));
|
lockdep_is_held(&d->tcf_lock));
|
||||||
spin_unlock_bh(&d->tcf_lock);
|
spin_unlock(&d->tcf_lock);
|
||||||
if (params_new)
|
if (params_new)
|
||||||
kfree_rcu(params_new, rcu);
|
kfree_rcu(params_new, rcu);
|
||||||
if (goto_ch)
|
if (goto_ch)
|
||||||
|
|||||||
Reference in New Issue
Block a user