aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/cls_route.c
diff options
context:
space:
mode:
authorVlad Buslov <vladbu@mellanox.com>2019-02-11 03:55:45 -0500
committerDavid S. Miller <davem@davemloft.net>2019-02-12 13:41:33 -0500
commit12db03b65c2b90752e4c37666977fd4a1b5f5824 (patch)
tree6915e0a9fae6df1abbd8ce54ce5a13d6b2688953 /net/sched/cls_route.c
parent7d5509fa0d3ddfe252b4418513e493ac98de3317 (diff)
net: sched: extend proto ops to support unlocked classifiers
Add 'rtnl_held' flag to tcf proto change, delete, destroy, dump, walk functions to track rtnl lock status. Extend users of these function in cls API to propagate rtnl lock status to them. This allows classifiers to obtain rtnl lock when necessary and to pass rtnl lock status to extensions and driver offload callbacks. Add flags field to tcf proto ops. Add flag value to indicate that classifier doesn't require rtnl lock. 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_route.c')
-rw-r--r--net/sched/cls_route.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/net/sched/cls_route.c b/net/sched/cls_route.c
index 44b26038c4c4..e590c3a2999d 100644
--- a/net/sched/cls_route.c
+++ b/net/sched/cls_route.c
@@ -276,7 +276,8 @@ static void route4_queue_work(struct route4_filter *f)
276 tcf_queue_work(&f->rwork, route4_delete_filter_work); 276 tcf_queue_work(&f->rwork, route4_delete_filter_work);
277} 277}
278 278
279static void route4_destroy(struct tcf_proto *tp, struct netlink_ext_ack *extack) 279static void route4_destroy(struct tcf_proto *tp, bool rtnl_held,
280 struct netlink_ext_ack *extack)
280{ 281{
281 struct route4_head *head = rtnl_dereference(tp->root); 282 struct route4_head *head = rtnl_dereference(tp->root);
282 int h1, h2; 283 int h1, h2;
@@ -312,7 +313,7 @@ static void route4_destroy(struct tcf_proto *tp, struct netlink_ext_ack *extack)
312} 313}
313 314
314static int route4_delete(struct tcf_proto *tp, void *arg, bool *last, 315static int route4_delete(struct tcf_proto *tp, void *arg, bool *last,
315 struct netlink_ext_ack *extack) 316 bool rtnl_held, struct netlink_ext_ack *extack)
316{ 317{
317 struct route4_head *head = rtnl_dereference(tp->root); 318 struct route4_head *head = rtnl_dereference(tp->root);
318 struct route4_filter *f = arg; 319 struct route4_filter *f = arg;
@@ -468,7 +469,7 @@ static int route4_set_parms(struct net *net, struct tcf_proto *tp,
468static int route4_change(struct net *net, struct sk_buff *in_skb, 469static int route4_change(struct net *net, struct sk_buff *in_skb,
469 struct tcf_proto *tp, unsigned long base, u32 handle, 470 struct tcf_proto *tp, unsigned long base, u32 handle,
470 struct nlattr **tca, void **arg, bool ovr, 471 struct nlattr **tca, void **arg, bool ovr,
471 struct netlink_ext_ack *extack) 472 bool rtnl_held, struct netlink_ext_ack *extack)
472{ 473{
473 struct route4_head *head = rtnl_dereference(tp->root); 474 struct route4_head *head = rtnl_dereference(tp->root);
474 struct route4_filter __rcu **fp; 475 struct route4_filter __rcu **fp;
@@ -560,7 +561,8 @@ errout:
560 return err; 561 return err;
561} 562}
562 563
563static void route4_walk(struct tcf_proto *tp, struct tcf_walker *arg) 564static void route4_walk(struct tcf_proto *tp, struct tcf_walker *arg,
565 bool rtnl_held)
564{ 566{
565 struct route4_head *head = rtnl_dereference(tp->root); 567 struct route4_head *head = rtnl_dereference(tp->root);
566 unsigned int h, h1; 568 unsigned int h, h1;
@@ -597,7 +599,7 @@ static void route4_walk(struct tcf_proto *tp, struct tcf_walker *arg)
597} 599}
598 600
599static int route4_dump(struct net *net, struct tcf_proto *tp, void *fh, 601static int route4_dump(struct net *net, struct tcf_proto *tp, void *fh,
600 struct sk_buff *skb, struct tcmsg *t) 602 struct sk_buff *skb, struct tcmsg *t, bool rtnl_held)
601{ 603{
602 struct route4_filter *f = fh; 604 struct route4_filter *f = fh;
603 struct nlattr *nest; 605 struct nlattr *nest;