Commit b15e7a6e authored by Vlad Buslov's avatar Vlad Buslov Committed by David S. Miller

net: sched: don't take rtnl lock during flow_action setup

Refactor tc_setup_flow_action() function not to use rtnl lock and remove
'rtnl_held' argument that is no longer needed.
Signed-off-by: default avatarVlad Buslov <vladbu@mellanox.com>
Acked-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 107f2d50
...@@ -509,7 +509,7 @@ tcf_match_indev(struct sk_buff *skb, int ifindex) ...@@ -509,7 +509,7 @@ tcf_match_indev(struct sk_buff *skb, int ifindex)
} }
int tc_setup_flow_action(struct flow_action *flow_action, int tc_setup_flow_action(struct flow_action *flow_action,
const struct tcf_exts *exts, bool rtnl_held); const struct tcf_exts *exts);
void tc_cleanup_flow_action(struct flow_action *flow_action); void tc_cleanup_flow_action(struct flow_action *flow_action);
int tc_setup_cb_call(struct tcf_block *block, enum tc_setup_type type, int tc_setup_cb_call(struct tcf_block *block, enum tc_setup_type type,
......
...@@ -3433,7 +3433,7 @@ static void tcf_sample_get_group(struct flow_action_entry *entry, ...@@ -3433,7 +3433,7 @@ static void tcf_sample_get_group(struct flow_action_entry *entry,
} }
int tc_setup_flow_action(struct flow_action *flow_action, int tc_setup_flow_action(struct flow_action *flow_action,
const struct tcf_exts *exts, bool rtnl_held) const struct tcf_exts *exts)
{ {
struct tc_action *act; struct tc_action *act;
int i, j, k, err = 0; int i, j, k, err = 0;
...@@ -3441,9 +3441,6 @@ int tc_setup_flow_action(struct flow_action *flow_action, ...@@ -3441,9 +3441,6 @@ int tc_setup_flow_action(struct flow_action *flow_action,
if (!exts) if (!exts)
return 0; return 0;
if (!rtnl_held)
rtnl_lock();
j = 0; j = 0;
tcf_exts_for_each_action(i, act, exts) { tcf_exts_for_each_action(i, act, exts) {
struct flow_action_entry *entry; struct flow_action_entry *entry;
...@@ -3577,9 +3574,6 @@ int tc_setup_flow_action(struct flow_action *flow_action, ...@@ -3577,9 +3574,6 @@ int tc_setup_flow_action(struct flow_action *flow_action,
} }
err_out: err_out:
if (!rtnl_held)
rtnl_unlock();
if (err) if (err)
tc_cleanup_flow_action(flow_action); tc_cleanup_flow_action(flow_action);
......
...@@ -449,8 +449,7 @@ static int fl_hw_replace_filter(struct tcf_proto *tp, ...@@ -449,8 +449,7 @@ static int fl_hw_replace_filter(struct tcf_proto *tp,
cls_flower.rule->match.key = &f->mkey; cls_flower.rule->match.key = &f->mkey;
cls_flower.classid = f->res.classid; cls_flower.classid = f->res.classid;
err = tc_setup_flow_action(&cls_flower.rule->action, &f->exts, err = tc_setup_flow_action(&cls_flower.rule->action, &f->exts);
rtnl_held);
if (err) { if (err) {
kfree(cls_flower.rule); kfree(cls_flower.rule);
if (skip_sw) { if (skip_sw) {
...@@ -2000,8 +1999,7 @@ static int fl_reoffload(struct tcf_proto *tp, bool add, flow_setup_cb_t *cb, ...@@ -2000,8 +1999,7 @@ static int fl_reoffload(struct tcf_proto *tp, bool add, flow_setup_cb_t *cb,
cls_flower.rule->match.mask = &f->mask->key; cls_flower.rule->match.mask = &f->mask->key;
cls_flower.rule->match.key = &f->mkey; cls_flower.rule->match.key = &f->mkey;
err = tc_setup_flow_action(&cls_flower.rule->action, &f->exts, err = tc_setup_flow_action(&cls_flower.rule->action, &f->exts);
true);
if (err) { if (err) {
kfree(cls_flower.rule); kfree(cls_flower.rule);
if (tc_skip_sw(f->flags)) { if (tc_skip_sw(f->flags)) {
......
...@@ -97,7 +97,7 @@ static int mall_replace_hw_filter(struct tcf_proto *tp, ...@@ -97,7 +97,7 @@ static int mall_replace_hw_filter(struct tcf_proto *tp,
cls_mall.command = TC_CLSMATCHALL_REPLACE; cls_mall.command = TC_CLSMATCHALL_REPLACE;
cls_mall.cookie = cookie; cls_mall.cookie = cookie;
err = tc_setup_flow_action(&cls_mall.rule->action, &head->exts, true); err = tc_setup_flow_action(&cls_mall.rule->action, &head->exts);
if (err) { if (err) {
kfree(cls_mall.rule); kfree(cls_mall.rule);
mall_destroy_hw_filter(tp, head, cookie, NULL); mall_destroy_hw_filter(tp, head, cookie, NULL);
...@@ -302,7 +302,7 @@ static int mall_reoffload(struct tcf_proto *tp, bool add, flow_setup_cb_t *cb, ...@@ -302,7 +302,7 @@ static int mall_reoffload(struct tcf_proto *tp, bool add, flow_setup_cb_t *cb,
TC_CLSMATCHALL_REPLACE : TC_CLSMATCHALL_DESTROY; TC_CLSMATCHALL_REPLACE : TC_CLSMATCHALL_DESTROY;
cls_mall.cookie = (unsigned long)head; cls_mall.cookie = (unsigned long)head;
err = tc_setup_flow_action(&cls_mall.rule->action, &head->exts, true); err = tc_setup_flow_action(&cls_mall.rule->action, &head->exts);
if (err) { if (err) {
kfree(cls_mall.rule); kfree(cls_mall.rule);
if (add && tc_skip_sw(head->flags)) { if (add && tc_skip_sw(head->flags)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment