forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/net/sched/cls_rsvp.h
....@@ -1,10 +1,6 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 /*
23 * net/sched/cls_rsvp.h Template file for RSVPv[46] classifiers.
3
- *
4
- * This program is free software; you can redistribute it and/or
5
- * modify it under the terms of the GNU General Public License
6
- * as published by the Free Software Foundation; either version
7
- * 2 of the License, or (at your option) any later version.
84 *
95 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
106 */
....@@ -312,7 +308,8 @@
312308 __rsvp_delete_filter(f);
313309 }
314310
315
-static void rsvp_destroy(struct tcf_proto *tp, struct netlink_ext_ack *extack)
311
+static void rsvp_destroy(struct tcf_proto *tp, bool rtnl_held,
312
+ struct netlink_ext_ack *extack)
316313 {
317314 struct rsvp_head *data = rtnl_dereference(tp->root);
318315 int h1, h2;
....@@ -341,7 +338,7 @@
341338 }
342339
343340 static int rsvp_delete(struct tcf_proto *tp, void *arg, bool *last,
344
- struct netlink_ext_ack *extack)
341
+ bool rtnl_held, struct netlink_ext_ack *extack)
345342 {
346343 struct rsvp_head *head = rtnl_dereference(tp->root);
347344 struct rsvp_filter *nfp, *f = arg;
....@@ -475,7 +472,8 @@
475472 struct tcf_proto *tp, unsigned long base,
476473 u32 handle,
477474 struct nlattr **tca,
478
- void **arg, bool ovr, struct netlink_ext_ack *extack)
475
+ void **arg, bool ovr, bool rtnl_held,
476
+ struct netlink_ext_ack *extack)
479477 {
480478 struct rsvp_head *data = rtnl_dereference(tp->root);
481479 struct rsvp_filter *f, *nfp;
....@@ -493,14 +491,16 @@
493491 if (opt == NULL)
494492 return handle ? -EINVAL : 0;
495493
496
- err = nla_parse_nested(tb, TCA_RSVP_MAX, opt, rsvp_policy, NULL);
494
+ err = nla_parse_nested_deprecated(tb, TCA_RSVP_MAX, opt, rsvp_policy,
495
+ NULL);
497496 if (err < 0)
498497 return err;
499498
500
- err = tcf_exts_init(&e, TCA_RSVP_ACT, TCA_RSVP_POLICE);
499
+ err = tcf_exts_init(&e, net, TCA_RSVP_ACT, TCA_RSVP_POLICE);
501500 if (err < 0)
502501 return err;
503
- err = tcf_exts_validate(net, tp, tb, tca[TCA_RATE], &e, ovr, extack);
502
+ err = tcf_exts_validate(net, tp, tb, tca[TCA_RATE], &e, ovr, true,
503
+ extack);
504504 if (err < 0)
505505 goto errout2;
506506
....@@ -518,7 +518,8 @@
518518 goto errout2;
519519 }
520520
521
- err = tcf_exts_init(&n->exts, TCA_RSVP_ACT, TCA_RSVP_POLICE);
521
+ err = tcf_exts_init(&n->exts, net, TCA_RSVP_ACT,
522
+ TCA_RSVP_POLICE);
522523 if (err < 0) {
523524 kfree(n);
524525 goto errout2;
....@@ -546,7 +547,7 @@
546547 if (f == NULL)
547548 goto errout2;
548549
549
- err = tcf_exts_init(&f->exts, TCA_RSVP_ACT, TCA_RSVP_POLICE);
550
+ err = tcf_exts_init(&f->exts, net, TCA_RSVP_ACT, TCA_RSVP_POLICE);
550551 if (err < 0)
551552 goto errout;
552553 h2 = 16;
....@@ -652,7 +653,8 @@
652653 return err;
653654 }
654655
655
-static void rsvp_walk(struct tcf_proto *tp, struct tcf_walker *arg)
656
+static void rsvp_walk(struct tcf_proto *tp, struct tcf_walker *arg,
657
+ bool rtnl_held)
656658 {
657659 struct rsvp_head *head = rtnl_dereference(tp->root);
658660 unsigned int h, h1;
....@@ -686,7 +688,7 @@
686688 }
687689
688690 static int rsvp_dump(struct net *net, struct tcf_proto *tp, void *fh,
689
- struct sk_buff *skb, struct tcmsg *t)
691
+ struct sk_buff *skb, struct tcmsg *t, bool rtnl_held)
690692 {
691693 struct rsvp_filter *f = fh;
692694 struct rsvp_session *s;
....@@ -699,7 +701,7 @@
699701
700702 t->tcm_handle = f->handle;
701703
702
- nest = nla_nest_start(skb, TCA_OPTIONS);
704
+ nest = nla_nest_start_noflag(skb, TCA_OPTIONS);
703705 if (nest == NULL)
704706 goto nla_put_failure;
705707