sched: move tcf_proto_destroy and tcf_destroy_chain helpers into cls_api
authorJiri Pirko <jiri@mellanox.com>
Thu, 9 Feb 2017 13:38:56 +0000 (14:38 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 10 Feb 2017 16:38:08 +0000 (11:38 -0500)
Creation is done in this file, move destruction to be at the same place.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 files changed:
include/net/pkt_cls.h
include/net/sch_generic.h
net/sched/cls_api.c
net/sched/sch_api.c
net/sched/sch_atm.c
net/sched/sch_cbq.c
net/sched/sch_choke.c
net/sched/sch_dsmark.c
net/sched/sch_fq_codel.c
net/sched/sch_htb.c
net/sched/sch_ingress.c
net/sched/sch_multiq.c
net/sched/sch_prio.c
net/sched/sch_sfb.c
net/sched/sch_sfq.c

index dabb00af46a0d31e36c45235aa742a124d78df89..71b266cd63d4b0a79a81139d0e4eb890f93d1a09 100644 (file)
@@ -17,6 +17,8 @@ struct tcf_walker {
 int register_tcf_proto_ops(struct tcf_proto_ops *ops);
 int unregister_tcf_proto_ops(struct tcf_proto_ops *ops);
 
+void tcf_destroy_chain(struct tcf_proto __rcu **fl);
+
 static inline unsigned long
 __cls_set_class(unsigned long *clp, unsigned long cl)
 {
index 453350650b9af28120d254c4260e4350e73b6de5..aeec4086afb2446dadb1fb8c54ad54a909634380 100644 (file)
@@ -405,8 +405,6 @@ struct Qdisc *qdisc_create_dflt(struct netdev_queue *dev_queue,
                                const struct Qdisc_ops *ops, u32 parentid);
 void __qdisc_calculate_pkt_len(struct sk_buff *skb,
                               const struct qdisc_size_table *stab);
-bool tcf_proto_destroy(struct tcf_proto *tp, bool force);
-void tcf_destroy_chain(struct tcf_proto __rcu **fl);
 int skb_do_redirect(struct sk_buff *);
 
 static inline void skb_reset_tc(struct sk_buff *skb)
index 90536ebae02a62ba7d2ba38a899ad115cc4e11ac..4efa4df8322f099de2ba7a8a1197a1ac143e3279 100644 (file)
@@ -127,6 +127,27 @@ static inline u32 tcf_auto_prio(struct tcf_proto *tp)
        return first;
 }
 
+static bool tcf_proto_destroy(struct tcf_proto *tp, bool force)
+{
+       if (tp->ops->destroy(tp, force)) {
+               module_put(tp->ops->owner);
+               kfree_rcu(tp, rcu);
+               return true;
+       }
+       return false;
+}
+
+void tcf_destroy_chain(struct tcf_proto __rcu **fl)
+{
+       struct tcf_proto *tp;
+
+       while ((tp = rtnl_dereference(*fl)) != NULL) {
+               RCU_INIT_POINTER(*fl, tp->next);
+               tcf_proto_destroy(tp, true);
+       }
+}
+EXPORT_SYMBOL(tcf_destroy_chain);
+
 /* Add/change/delete/get a filter node */
 
 static int tc_ctl_tfilter(struct sk_buff *skb, struct nlmsghdr *n)
index f30b517f22820be046760d7f009a7cadc8a41c8e..adeabaec0d0b8bd3115e8d8db756460227142c60 100644 (file)
@@ -1900,28 +1900,6 @@ reset:
 }
 EXPORT_SYMBOL(tc_classify);
 
-bool tcf_proto_destroy(struct tcf_proto *tp, bool force)
-{
-       if (tp->ops->destroy(tp, force)) {
-               module_put(tp->ops->owner);
-               kfree_rcu(tp, rcu);
-               return true;
-       }
-
-       return false;
-}
-
-void tcf_destroy_chain(struct tcf_proto __rcu **fl)
-{
-       struct tcf_proto *tp;
-
-       while ((tp = rtnl_dereference(*fl)) != NULL) {
-               RCU_INIT_POINTER(*fl, tp->next);
-               tcf_proto_destroy(tp, true);
-       }
-}
-EXPORT_SYMBOL(tcf_destroy_chain);
-
 #ifdef CONFIG_PROC_FS
 static int psched_show(struct seq_file *seq, void *v)
 {
index 481e4f12aeb4c05e17f6985764cd901c9fa59331..2209c2ddacbfb0b1f222cb593477891d7124d9e3 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/file.h>                /* for fput */
 #include <net/netlink.h>
 #include <net/pkt_sched.h>
+#include <net/pkt_cls.h>
 
 /*
  * The ATM queuing discipline provides a framework for invoking classifiers
index f1207582cbf3005f08af70275d6c1b217f60f26a..d6ca18dc04c3e9e72efedd44088e95118a06b711 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/skbuff.h>
 #include <net/netlink.h>
 #include <net/pkt_sched.h>
+#include <net/pkt_cls.h>
 
 
 /*     Class-Based Queueing (CBQ) algorithm.
index 3b6d5bd691015f0dbfa285218e2453a8587b8043..3b86a97bc67c3e953cb181eddcb5c0c16bf3b27f 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/skbuff.h>
 #include <linux/vmalloc.h>
 #include <net/pkt_sched.h>
+#include <net/pkt_cls.h>
 #include <net/inet_ecn.h>
 #include <net/red.h>
 #include <net/flow_dissector.h>
index 1308bbf460f7ca7e496fe9d9c48da7eb2b0d282d..802ac7c2e5e87eed1341ba4c09d3e5d70bc75876 100644 (file)
@@ -13,6 +13,7 @@
 #include <linux/rtnetlink.h>
 #include <linux/bitops.h>
 #include <net/pkt_sched.h>
+#include <net/pkt_cls.h>
 #include <net/dsfield.h>
 #include <net/inet_ecn.h>
 #include <asm/byteorder.h>
index 2f50e4c72fb406d4aa67b868ceb37ae72fa60bf6..9f3a884d15903fd9012c01b5eee802e02f9f709e 100644 (file)
@@ -23,6 +23,7 @@
 #include <linux/vmalloc.h>
 #include <net/netlink.h>
 #include <net/pkt_sched.h>
+#include <net/pkt_cls.h>
 #include <net/codel.h>
 #include <net/codel_impl.h>
 #include <net/codel_qdisc.h>
index 760f39e7caeeb91b6c34d561f64f1ed97c884a32..4cd5fb134bc9e2dbcdd61b51fb951f94301ed54c 100644 (file)
@@ -40,6 +40,7 @@
 #include <net/netlink.h>
 #include <net/sch_generic.h>
 #include <net/pkt_sched.h>
+#include <net/pkt_cls.h>
 
 /* HTB algorithm.
     Author: devik@cdi.cz
index 8fe6999b642ac3c039f40621f4ca123d129718c4..3bab5f66c39291fb4f20888dbdb779dc7edc2776 100644 (file)
@@ -16,6 +16,7 @@
 
 #include <net/netlink.h>
 #include <net/pkt_sched.h>
+#include <net/pkt_cls.h>
 
 static struct Qdisc *ingress_leaf(struct Qdisc *sch, unsigned long arg)
 {
index 9ffbb025b37e70bc526f54735a9b16573efb0ff4..e7839a0d0eaa52572f675fdb1dfc590c2a70ac76 100644 (file)
@@ -25,7 +25,7 @@
 #include <linux/skbuff.h>
 #include <net/netlink.h>
 #include <net/pkt_sched.h>
-
+#include <net/pkt_cls.h>
 
 struct multiq_sched_data {
        u16 bands;
index 8f575899adfa61cb985c0c645d265e1c9381c9d9..d4d7db267b6edfa56582ca4a588590e0ded9fe66 100644 (file)
@@ -20,7 +20,7 @@
 #include <linux/skbuff.h>
 #include <net/netlink.h>
 #include <net/pkt_sched.h>
-
+#include <net/pkt_cls.h>
 
 struct prio_sched_data {
        int bands;
index 20a350bd1b1dc8283c7e352ce0a953ce0eea2544..fe6963d2151956c508b510edec680b89201173ce 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/jhash.h>
 #include <net/ip.h>
 #include <net/pkt_sched.h>
+#include <net/pkt_cls.h>
 #include <net/inet_ecn.h>
 
 /*
index 7f195ed4d568c14c618c59f8d746cdd29f8dae21..83d06e251b93cda13938cc00d75ff7c45d7785ad 100644 (file)
@@ -23,6 +23,7 @@
 #include <linux/vmalloc.h>
 #include <net/netlink.h>
 #include <net/pkt_sched.h>
+#include <net/pkt_cls.h>
 #include <net/red.h>