aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/cls_api.c
diff options
context:
space:
mode:
authorVlad Buslov <vladbu@mellanox.com>2019-02-11 03:55:43 -0500
committerDavid S. Miller <davem@davemloft.net>2019-02-12 13:41:33 -0500
commitec6743a10996d38e0438e5f45f2347ff2f42df0a (patch)
treed75c1ea33f894ba7ec79f4046cacdfb59759731e /net/sched/cls_api.c
parent726d061286ceeeabda54ba6f080d0cb8f187a9d7 (diff)
net: sched: track rtnl lock status when validating extensions
Actions API is already updated to not rely on rtnl lock for synchronization. However, it need to be provided with rtnl status when called from classifiers API in order to be able to correctly release the lock when loading kernel module. Extend extension validation function with 'rtnl_held' flag which is passed to actions API. Add new 'rtnl_held' parameter to tcf_exts_validate() in cls API. No classifier is currently updated to support unlocked execution, so pass hardcoded 'true' flag parameter value. 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 'net/sched/cls_api.c')
-rw-r--r--net/sched/cls_api.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index 3038a82f6591..a3e715d34efb 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -2841,7 +2841,7 @@ EXPORT_SYMBOL(tcf_exts_destroy);
2841 2841
2842int tcf_exts_validate(struct net *net, struct tcf_proto *tp, struct nlattr **tb, 2842int tcf_exts_validate(struct net *net, struct tcf_proto *tp, struct nlattr **tb,
2843 struct nlattr *rate_tlv, struct tcf_exts *exts, bool ovr, 2843 struct nlattr *rate_tlv, struct tcf_exts *exts, bool ovr,
2844 struct netlink_ext_ack *extack) 2844 bool rtnl_held, struct netlink_ext_ack *extack)
2845{ 2845{
2846#ifdef CONFIG_NET_CLS_ACT 2846#ifdef CONFIG_NET_CLS_ACT
2847 { 2847 {
@@ -2851,7 +2851,8 @@ int tcf_exts_validate(struct net *net, struct tcf_proto *tp, struct nlattr **tb,
2851 if (exts->police && tb[exts->police]) { 2851 if (exts->police && tb[exts->police]) {
2852 act = tcf_action_init_1(net, tp, tb[exts->police], 2852 act = tcf_action_init_1(net, tp, tb[exts->police],
2853 rate_tlv, "police", ovr, 2853 rate_tlv, "police", ovr,
2854 TCA_ACT_BIND, true, extack); 2854 TCA_ACT_BIND, rtnl_held,
2855 extack);
2855 if (IS_ERR(act)) 2856 if (IS_ERR(act))
2856 return PTR_ERR(act); 2857 return PTR_ERR(act);
2857 2858
@@ -2863,8 +2864,8 @@ int tcf_exts_validate(struct net *net, struct tcf_proto *tp, struct nlattr **tb,
2863 2864
2864 err = tcf_action_init(net, tp, tb[exts->action], 2865 err = tcf_action_init(net, tp, tb[exts->action],
2865 rate_tlv, NULL, ovr, TCA_ACT_BIND, 2866 rate_tlv, NULL, ovr, TCA_ACT_BIND,
2866 exts->actions, &attr_size, true, 2867 exts->actions, &attr_size,
2867 extack); 2868 rtnl_held, extack);
2868 if (err < 0) 2869 if (err < 0)
2869 return err; 2870 return err;
2870 exts->nr_actions = err; 2871 exts->nr_actions = err;