Daniel Borkmann | 1f211a1 | 2016-01-07 22:29:47 +0100 | [diff] [blame] | 1 | /* net/sched/sch_ingress.c - Ingress and clsact qdisc |
| 2 | * |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 3 | * This program is free software; you can redistribute it and/or |
| 4 | * modify it under the terms of the GNU General Public License |
| 5 | * as published by the Free Software Foundation; either version |
| 6 | * 2 of the License, or (at your option) any later version. |
| 7 | * |
| 8 | * Authors: Jamal Hadi Salim 1999 |
| 9 | */ |
| 10 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 11 | #include <linux/module.h> |
| 12 | #include <linux/types.h> |
Patrick McHardy | 0ba4805 | 2007-07-02 22:49:07 -0700 | [diff] [blame] | 13 | #include <linux/list.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 14 | #include <linux/skbuff.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 15 | #include <linux/rtnetlink.h> |
Daniel Borkmann | d2788d3 | 2015-05-09 22:51:32 +0200 | [diff] [blame] | 16 | |
Arnaldo Carvalho de Melo | dc5fc57 | 2007-03-25 23:06:12 -0700 | [diff] [blame] | 17 | #include <net/netlink.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 18 | #include <net/pkt_sched.h> |
Jiri Pirko | cf1facd | 2017-02-09 14:38:56 +0100 | [diff] [blame] | 19 | #include <net/pkt_cls.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 20 | |
Jiri Pirko | 6529eab | 2017-05-17 11:07:55 +0200 | [diff] [blame] | 21 | struct ingress_sched_data { |
| 22 | struct tcf_block *block; |
Jiri Pirko | 6e40cf2 | 2017-10-19 15:50:30 +0200 | [diff] [blame] | 23 | struct tcf_block_ext_info block_info; |
Jiri Pirko | 4620940 | 2017-11-03 11:46:25 +0100 | [diff] [blame] | 24 | struct mini_Qdisc_pair miniqp; |
Jiri Pirko | 6529eab | 2017-05-17 11:07:55 +0200 | [diff] [blame] | 25 | }; |
| 26 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 27 | static struct Qdisc *ingress_leaf(struct Qdisc *sch, unsigned long arg) |
| 28 | { |
| 29 | return NULL; |
| 30 | } |
| 31 | |
WANG Cong | 143976c | 2017-08-24 16:51:29 -0700 | [diff] [blame] | 32 | static unsigned long ingress_find(struct Qdisc *sch, u32 classid) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 33 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 34 | return TC_H_MIN(classid) + 1; |
| 35 | } |
| 36 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 37 | static unsigned long ingress_bind_filter(struct Qdisc *sch, |
Patrick McHardy | 58f4df4 | 2008-01-21 00:11:01 -0800 | [diff] [blame] | 38 | unsigned long parent, u32 classid) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 39 | { |
WANG Cong | 143976c | 2017-08-24 16:51:29 -0700 | [diff] [blame] | 40 | return ingress_find(sch, classid); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 41 | } |
| 42 | |
WANG Cong | 143976c | 2017-08-24 16:51:29 -0700 | [diff] [blame] | 43 | static void ingress_unbind_filter(struct Qdisc *sch, unsigned long cl) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 44 | { |
| 45 | } |
| 46 | |
Patrick McHardy | 58f4df4 | 2008-01-21 00:11:01 -0800 | [diff] [blame] | 47 | static void ingress_walk(struct Qdisc *sch, struct qdisc_walker *walker) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 48 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 49 | } |
| 50 | |
Jiri Pirko | 6529eab | 2017-05-17 11:07:55 +0200 | [diff] [blame] | 51 | static struct tcf_block *ingress_tcf_block(struct Qdisc *sch, unsigned long cl) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 52 | { |
Jiri Pirko | 6529eab | 2017-05-17 11:07:55 +0200 | [diff] [blame] | 53 | struct ingress_sched_data *q = qdisc_priv(sch); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 54 | |
Jiri Pirko | 6529eab | 2017-05-17 11:07:55 +0200 | [diff] [blame] | 55 | return q->block; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 56 | } |
| 57 | |
Jiri Pirko | c7eb7d7 | 2017-11-03 11:46:24 +0100 | [diff] [blame] | 58 | static void clsact_chain_head_change(struct tcf_proto *tp_head, void *priv) |
| 59 | { |
Jiri Pirko | 4620940 | 2017-11-03 11:46:25 +0100 | [diff] [blame] | 60 | struct mini_Qdisc_pair *miniqp = priv; |
Jiri Pirko | c7eb7d7 | 2017-11-03 11:46:24 +0100 | [diff] [blame] | 61 | |
Jiri Pirko | 4620940 | 2017-11-03 11:46:25 +0100 | [diff] [blame] | 62 | mini_qdisc_pair_swap(miniqp, tp_head); |
Jiri Pirko | c7eb7d7 | 2017-11-03 11:46:24 +0100 | [diff] [blame] | 63 | } |
| 64 | |
Alexander Aring | e63d7df | 2017-12-20 12:35:13 -0500 | [diff] [blame^] | 65 | static int ingress_init(struct Qdisc *sch, struct nlattr *opt, |
| 66 | struct netlink_ext_ack *extack) |
Daniel Borkmann | 4577139 | 2015-04-10 23:07:54 +0200 | [diff] [blame] | 67 | { |
Jiri Pirko | 6529eab | 2017-05-17 11:07:55 +0200 | [diff] [blame] | 68 | struct ingress_sched_data *q = qdisc_priv(sch); |
| 69 | struct net_device *dev = qdisc_dev(sch); |
| 70 | int err; |
| 71 | |
Jiri Pirko | b59e697 | 2017-12-15 12:40:13 +0100 | [diff] [blame] | 72 | net_inc_ingress_queue(); |
| 73 | |
Jiri Pirko | 4620940 | 2017-11-03 11:46:25 +0100 | [diff] [blame] | 74 | mini_qdisc_pair_init(&q->miniqp, sch, &dev->miniq_ingress); |
| 75 | |
Jiri Pirko | 6e40cf2 | 2017-10-19 15:50:30 +0200 | [diff] [blame] | 76 | q->block_info.binder_type = TCF_BLOCK_BINDER_TYPE_CLSACT_INGRESS; |
Jiri Pirko | c7eb7d7 | 2017-11-03 11:46:24 +0100 | [diff] [blame] | 77 | q->block_info.chain_head_change = clsact_chain_head_change; |
Jiri Pirko | 4620940 | 2017-11-03 11:46:25 +0100 | [diff] [blame] | 78 | q->block_info.chain_head_change_priv = &q->miniqp; |
Jiri Pirko | 6e40cf2 | 2017-10-19 15:50:30 +0200 | [diff] [blame] | 79 | |
Jiri Pirko | c7eb7d7 | 2017-11-03 11:46:24 +0100 | [diff] [blame] | 80 | err = tcf_block_get_ext(&q->block, sch, &q->block_info); |
Jiri Pirko | 6529eab | 2017-05-17 11:07:55 +0200 | [diff] [blame] | 81 | if (err) |
| 82 | return err; |
| 83 | |
Alexei Starovoitov | 087c1a6 | 2015-04-30 20:14:07 -0700 | [diff] [blame] | 84 | sch->flags |= TCQ_F_CPUSTATS; |
Daniel Borkmann | 4577139 | 2015-04-10 23:07:54 +0200 | [diff] [blame] | 85 | |
| 86 | return 0; |
| 87 | } |
| 88 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 89 | static void ingress_destroy(struct Qdisc *sch) |
| 90 | { |
Jiri Pirko | 6529eab | 2017-05-17 11:07:55 +0200 | [diff] [blame] | 91 | struct ingress_sched_data *q = qdisc_priv(sch); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 92 | |
Jiri Pirko | c7eb7d7 | 2017-11-03 11:46:24 +0100 | [diff] [blame] | 93 | tcf_block_put_ext(q->block, sch, &q->block_info); |
Daniel Borkmann | 4577139 | 2015-04-10 23:07:54 +0200 | [diff] [blame] | 94 | net_dec_ingress_queue(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 95 | } |
| 96 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 97 | static int ingress_dump(struct Qdisc *sch, struct sk_buff *skb) |
| 98 | { |
Patrick McHardy | 4b3550ef | 2008-01-23 20:34:11 -0800 | [diff] [blame] | 99 | struct nlattr *nest; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 100 | |
Patrick McHardy | 4b3550ef | 2008-01-23 20:34:11 -0800 | [diff] [blame] | 101 | nest = nla_nest_start(skb, TCA_OPTIONS); |
| 102 | if (nest == NULL) |
| 103 | goto nla_put_failure; |
Daniel Borkmann | d2788d3 | 2015-05-09 22:51:32 +0200 | [diff] [blame] | 104 | |
Yang Yingliang | d59b7d8 | 2014-03-12 10:20:32 +0800 | [diff] [blame] | 105 | return nla_nest_end(skb, nest); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 106 | |
Patrick McHardy | 1e90474 | 2008-01-22 22:11:17 -0800 | [diff] [blame] | 107 | nla_put_failure: |
Patrick McHardy | 4b3550ef | 2008-01-23 20:34:11 -0800 | [diff] [blame] | 108 | nla_nest_cancel(skb, nest); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 109 | return -1; |
| 110 | } |
| 111 | |
Eric Dumazet | 20fea08 | 2007-11-14 01:44:41 -0800 | [diff] [blame] | 112 | static const struct Qdisc_class_ops ingress_class_ops = { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 113 | .leaf = ingress_leaf, |
WANG Cong | 143976c | 2017-08-24 16:51:29 -0700 | [diff] [blame] | 114 | .find = ingress_find, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 115 | .walk = ingress_walk, |
Jiri Pirko | 6529eab | 2017-05-17 11:07:55 +0200 | [diff] [blame] | 116 | .tcf_block = ingress_tcf_block, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 117 | .bind_tcf = ingress_bind_filter, |
WANG Cong | 143976c | 2017-08-24 16:51:29 -0700 | [diff] [blame] | 118 | .unbind_tcf = ingress_unbind_filter, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 119 | }; |
| 120 | |
Eric Dumazet | 20fea08 | 2007-11-14 01:44:41 -0800 | [diff] [blame] | 121 | static struct Qdisc_ops ingress_qdisc_ops __read_mostly = { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 122 | .cl_ops = &ingress_class_ops, |
| 123 | .id = "ingress", |
Jiri Pirko | 6529eab | 2017-05-17 11:07:55 +0200 | [diff] [blame] | 124 | .priv_size = sizeof(struct ingress_sched_data), |
Daniel Borkmann | 4577139 | 2015-04-10 23:07:54 +0200 | [diff] [blame] | 125 | .init = ingress_init, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 126 | .destroy = ingress_destroy, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 127 | .dump = ingress_dump, |
| 128 | .owner = THIS_MODULE, |
| 129 | }; |
| 130 | |
Jiri Pirko | 6529eab | 2017-05-17 11:07:55 +0200 | [diff] [blame] | 131 | struct clsact_sched_data { |
| 132 | struct tcf_block *ingress_block; |
| 133 | struct tcf_block *egress_block; |
Jiri Pirko | 6e40cf2 | 2017-10-19 15:50:30 +0200 | [diff] [blame] | 134 | struct tcf_block_ext_info ingress_block_info; |
| 135 | struct tcf_block_ext_info egress_block_info; |
Jiri Pirko | 4620940 | 2017-11-03 11:46:25 +0100 | [diff] [blame] | 136 | struct mini_Qdisc_pair miniqp_ingress; |
| 137 | struct mini_Qdisc_pair miniqp_egress; |
Jiri Pirko | 6529eab | 2017-05-17 11:07:55 +0200 | [diff] [blame] | 138 | }; |
| 139 | |
WANG Cong | 143976c | 2017-08-24 16:51:29 -0700 | [diff] [blame] | 140 | static unsigned long clsact_find(struct Qdisc *sch, u32 classid) |
Daniel Borkmann | 1f211a1 | 2016-01-07 22:29:47 +0100 | [diff] [blame] | 141 | { |
| 142 | switch (TC_H_MIN(classid)) { |
| 143 | case TC_H_MIN(TC_H_MIN_INGRESS): |
| 144 | case TC_H_MIN(TC_H_MIN_EGRESS): |
| 145 | return TC_H_MIN(classid); |
| 146 | default: |
| 147 | return 0; |
| 148 | } |
| 149 | } |
| 150 | |
| 151 | static unsigned long clsact_bind_filter(struct Qdisc *sch, |
| 152 | unsigned long parent, u32 classid) |
| 153 | { |
WANG Cong | 143976c | 2017-08-24 16:51:29 -0700 | [diff] [blame] | 154 | return clsact_find(sch, classid); |
Daniel Borkmann | 1f211a1 | 2016-01-07 22:29:47 +0100 | [diff] [blame] | 155 | } |
| 156 | |
Jiri Pirko | 6529eab | 2017-05-17 11:07:55 +0200 | [diff] [blame] | 157 | static struct tcf_block *clsact_tcf_block(struct Qdisc *sch, unsigned long cl) |
Daniel Borkmann | 1f211a1 | 2016-01-07 22:29:47 +0100 | [diff] [blame] | 158 | { |
Jiri Pirko | 6529eab | 2017-05-17 11:07:55 +0200 | [diff] [blame] | 159 | struct clsact_sched_data *q = qdisc_priv(sch); |
Daniel Borkmann | 1f211a1 | 2016-01-07 22:29:47 +0100 | [diff] [blame] | 160 | |
| 161 | switch (cl) { |
| 162 | case TC_H_MIN(TC_H_MIN_INGRESS): |
Jiri Pirko | 6529eab | 2017-05-17 11:07:55 +0200 | [diff] [blame] | 163 | return q->ingress_block; |
Daniel Borkmann | 1f211a1 | 2016-01-07 22:29:47 +0100 | [diff] [blame] | 164 | case TC_H_MIN(TC_H_MIN_EGRESS): |
Jiri Pirko | 6529eab | 2017-05-17 11:07:55 +0200 | [diff] [blame] | 165 | return q->egress_block; |
Daniel Borkmann | 1f211a1 | 2016-01-07 22:29:47 +0100 | [diff] [blame] | 166 | default: |
| 167 | return NULL; |
| 168 | } |
| 169 | } |
| 170 | |
Alexander Aring | e63d7df | 2017-12-20 12:35:13 -0500 | [diff] [blame^] | 171 | static int clsact_init(struct Qdisc *sch, struct nlattr *opt, |
| 172 | struct netlink_ext_ack *extack) |
Daniel Borkmann | 1f211a1 | 2016-01-07 22:29:47 +0100 | [diff] [blame] | 173 | { |
Jiri Pirko | 6529eab | 2017-05-17 11:07:55 +0200 | [diff] [blame] | 174 | struct clsact_sched_data *q = qdisc_priv(sch); |
| 175 | struct net_device *dev = qdisc_dev(sch); |
| 176 | int err; |
| 177 | |
Jiri Pirko | b59e697 | 2017-12-15 12:40:13 +0100 | [diff] [blame] | 178 | net_inc_ingress_queue(); |
| 179 | net_inc_egress_queue(); |
| 180 | |
Jiri Pirko | 4620940 | 2017-11-03 11:46:25 +0100 | [diff] [blame] | 181 | mini_qdisc_pair_init(&q->miniqp_ingress, sch, &dev->miniq_ingress); |
| 182 | |
Jiri Pirko | 6e40cf2 | 2017-10-19 15:50:30 +0200 | [diff] [blame] | 183 | q->ingress_block_info.binder_type = TCF_BLOCK_BINDER_TYPE_CLSACT_INGRESS; |
Jiri Pirko | c7eb7d7 | 2017-11-03 11:46:24 +0100 | [diff] [blame] | 184 | q->ingress_block_info.chain_head_change = clsact_chain_head_change; |
Jiri Pirko | 4620940 | 2017-11-03 11:46:25 +0100 | [diff] [blame] | 185 | q->ingress_block_info.chain_head_change_priv = &q->miniqp_ingress; |
Jiri Pirko | 6e40cf2 | 2017-10-19 15:50:30 +0200 | [diff] [blame] | 186 | |
Jiri Pirko | c7eb7d7 | 2017-11-03 11:46:24 +0100 | [diff] [blame] | 187 | err = tcf_block_get_ext(&q->ingress_block, sch, &q->ingress_block_info); |
Jiri Pirko | 6529eab | 2017-05-17 11:07:55 +0200 | [diff] [blame] | 188 | if (err) |
| 189 | return err; |
| 190 | |
Jiri Pirko | 4620940 | 2017-11-03 11:46:25 +0100 | [diff] [blame] | 191 | mini_qdisc_pair_init(&q->miniqp_egress, sch, &dev->miniq_egress); |
| 192 | |
Jiri Pirko | 6e40cf2 | 2017-10-19 15:50:30 +0200 | [diff] [blame] | 193 | q->egress_block_info.binder_type = TCF_BLOCK_BINDER_TYPE_CLSACT_EGRESS; |
Jiri Pirko | c7eb7d7 | 2017-11-03 11:46:24 +0100 | [diff] [blame] | 194 | q->egress_block_info.chain_head_change = clsact_chain_head_change; |
Jiri Pirko | 4620940 | 2017-11-03 11:46:25 +0100 | [diff] [blame] | 195 | q->egress_block_info.chain_head_change_priv = &q->miniqp_egress; |
Jiri Pirko | 6e40cf2 | 2017-10-19 15:50:30 +0200 | [diff] [blame] | 196 | |
Jiri Pirko | c7eb7d7 | 2017-11-03 11:46:24 +0100 | [diff] [blame] | 197 | err = tcf_block_get_ext(&q->egress_block, sch, &q->egress_block_info); |
Jiri Pirko | 6529eab | 2017-05-17 11:07:55 +0200 | [diff] [blame] | 198 | if (err) |
Jiri Pirko | 343723d | 2017-12-15 12:40:12 +0100 | [diff] [blame] | 199 | return err; |
Jiri Pirko | 6529eab | 2017-05-17 11:07:55 +0200 | [diff] [blame] | 200 | |
Daniel Borkmann | 1f211a1 | 2016-01-07 22:29:47 +0100 | [diff] [blame] | 201 | sch->flags |= TCQ_F_CPUSTATS; |
| 202 | |
| 203 | return 0; |
| 204 | } |
| 205 | |
| 206 | static void clsact_destroy(struct Qdisc *sch) |
| 207 | { |
Jiri Pirko | 6529eab | 2017-05-17 11:07:55 +0200 | [diff] [blame] | 208 | struct clsact_sched_data *q = qdisc_priv(sch); |
Daniel Borkmann | 1f211a1 | 2016-01-07 22:29:47 +0100 | [diff] [blame] | 209 | |
Jiri Pirko | c7eb7d7 | 2017-11-03 11:46:24 +0100 | [diff] [blame] | 210 | tcf_block_put_ext(q->egress_block, sch, &q->egress_block_info); |
| 211 | tcf_block_put_ext(q->ingress_block, sch, &q->ingress_block_info); |
Daniel Borkmann | 1f211a1 | 2016-01-07 22:29:47 +0100 | [diff] [blame] | 212 | |
| 213 | net_dec_ingress_queue(); |
| 214 | net_dec_egress_queue(); |
| 215 | } |
| 216 | |
| 217 | static const struct Qdisc_class_ops clsact_class_ops = { |
| 218 | .leaf = ingress_leaf, |
WANG Cong | 143976c | 2017-08-24 16:51:29 -0700 | [diff] [blame] | 219 | .find = clsact_find, |
Daniel Borkmann | 1f211a1 | 2016-01-07 22:29:47 +0100 | [diff] [blame] | 220 | .walk = ingress_walk, |
Jiri Pirko | 6529eab | 2017-05-17 11:07:55 +0200 | [diff] [blame] | 221 | .tcf_block = clsact_tcf_block, |
Daniel Borkmann | 1f211a1 | 2016-01-07 22:29:47 +0100 | [diff] [blame] | 222 | .bind_tcf = clsact_bind_filter, |
WANG Cong | 143976c | 2017-08-24 16:51:29 -0700 | [diff] [blame] | 223 | .unbind_tcf = ingress_unbind_filter, |
Daniel Borkmann | 1f211a1 | 2016-01-07 22:29:47 +0100 | [diff] [blame] | 224 | }; |
| 225 | |
| 226 | static struct Qdisc_ops clsact_qdisc_ops __read_mostly = { |
| 227 | .cl_ops = &clsact_class_ops, |
| 228 | .id = "clsact", |
Jiri Pirko | 6529eab | 2017-05-17 11:07:55 +0200 | [diff] [blame] | 229 | .priv_size = sizeof(struct clsact_sched_data), |
Daniel Borkmann | 1f211a1 | 2016-01-07 22:29:47 +0100 | [diff] [blame] | 230 | .init = clsact_init, |
| 231 | .destroy = clsact_destroy, |
| 232 | .dump = ingress_dump, |
| 233 | .owner = THIS_MODULE, |
| 234 | }; |
| 235 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 236 | static int __init ingress_module_init(void) |
| 237 | { |
Daniel Borkmann | 1f211a1 | 2016-01-07 22:29:47 +0100 | [diff] [blame] | 238 | int ret; |
| 239 | |
| 240 | ret = register_qdisc(&ingress_qdisc_ops); |
| 241 | if (!ret) { |
| 242 | ret = register_qdisc(&clsact_qdisc_ops); |
| 243 | if (ret) |
| 244 | unregister_qdisc(&ingress_qdisc_ops); |
| 245 | } |
| 246 | |
| 247 | return ret; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 248 | } |
Patrick McHardy | 58f4df4 | 2008-01-21 00:11:01 -0800 | [diff] [blame] | 249 | |
YOSHIFUJI Hideaki | 10297b9 | 2007-02-09 23:25:16 +0900 | [diff] [blame] | 250 | static void __exit ingress_module_exit(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 251 | { |
| 252 | unregister_qdisc(&ingress_qdisc_ops); |
Daniel Borkmann | 1f211a1 | 2016-01-07 22:29:47 +0100 | [diff] [blame] | 253 | unregister_qdisc(&clsact_qdisc_ops); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 254 | } |
Patrick McHardy | 58f4df4 | 2008-01-21 00:11:01 -0800 | [diff] [blame] | 255 | |
Daniel Borkmann | d2788d3 | 2015-05-09 22:51:32 +0200 | [diff] [blame] | 256 | module_init(ingress_module_init); |
| 257 | module_exit(ingress_module_exit); |
| 258 | |
Daniel Borkmann | 1f211a1 | 2016-01-07 22:29:47 +0100 | [diff] [blame] | 259 | MODULE_ALIAS("sch_clsact"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 260 | MODULE_LICENSE("GPL"); |