aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/cls_matchall.c
diff options
context:
space:
mode:
authorVlad Buslov <vladbu@mellanox.com>2019-08-26 16:45:03 +0300
committerDavid S. Miller <davem@davemloft.net>2019-08-26 14:17:43 -0700
commit9838b20a7fb28c69fa66ac8e68d967ffe1d0ecad (patch)
tree9ed88766141671e1bd7f930d7b53746a18d11c37 /net/sched/cls_matchall.c
parentnet: sched: conditionally obtain rtnl lock in cls hw offloads API (diff)
downloadlinux-dev-9838b20a7fb28c69fa66ac8e68d967ffe1d0ecad.tar.xz
linux-dev-9838b20a7fb28c69fa66ac8e68d967ffe1d0ecad.zip
net: sched: take rtnl lock in tc_setup_flow_action()
In order to allow using new flow_action infrastructure from unlocked classifiers, modify tc_setup_flow_action() to accept new 'rtnl_held' argument. Take rtnl lock before accessing tc_action data. This is necessary to protect from concurrent action replace. Signed-off-by: Vlad Buslov <vladbu@mellanox.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--net/sched/cls_matchall.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/sched/cls_matchall.c b/net/sched/cls_matchall.c
index 911d1ea28bb2..3266f25011cc 100644
--- a/net/sched/cls_matchall.c
+++ b/net/sched/cls_matchall.c
@@ -97,7 +97,7 @@ static int mall_replace_hw_filter(struct tcf_proto *tp,
cls_mall.command = TC_CLSMATCHALL_REPLACE;
cls_mall.cookie = cookie;
- err = tc_setup_flow_action(&cls_mall.rule->action, &head->exts);
+ err = tc_setup_flow_action(&cls_mall.rule->action, &head->exts, true);
if (err) {
kfree(cls_mall.rule);
mall_destroy_hw_filter(tp, head, cookie, NULL);
@@ -300,7 +300,7 @@ static int mall_reoffload(struct tcf_proto *tp, bool add, flow_setup_cb_t *cb,
TC_CLSMATCHALL_REPLACE : TC_CLSMATCHALL_DESTROY;
cls_mall.cookie = (unsigned long)head;
- err = tc_setup_flow_action(&cls_mall.rule->action, &head->exts);
+ err = tc_setup_flow_action(&cls_mall.rule->action, &head->exts, true);
if (err) {
kfree(cls_mall.rule);
if (add && tc_skip_sw(head->flags)) {