blob: 73b914bc47a4ccebdd3145c2b6d69dd2f0139151 [file] [log] [blame]
Patrick McHardy13d2a1d2008-11-20 04:10:00 -08001/*
2 * net/sched/sch_drr.c Deficit Round Robin scheduler
3 *
4 * Copyright (c) 2008 Patrick McHardy <kaber@trash.net>
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * version 2 as published by the Free Software Foundation.
9 */
10
11#include <linux/module.h>
Tejun Heo5a0e3ad2010-03-24 17:04:11 +090012#include <linux/slab.h>
Patrick McHardy13d2a1d2008-11-20 04:10:00 -080013#include <linux/init.h>
14#include <linux/errno.h>
15#include <linux/netdevice.h>
16#include <linux/pkt_sched.h>
17#include <net/sch_generic.h>
18#include <net/pkt_sched.h>
19#include <net/pkt_cls.h>
20
21struct drr_class {
22 struct Qdisc_class_common common;
Patrick McHardy13d2a1d2008-11-20 04:10:00 -080023 unsigned int filter_cnt;
24
Eric Dumazetc1a8f1f2009-08-16 09:36:49 +000025 struct gnet_stats_basic_packed bstats;
Patrick McHardy13d2a1d2008-11-20 04:10:00 -080026 struct gnet_stats_queue qstats;
Eric Dumazet1c0d32f2016-12-04 09:48:16 -080027 struct net_rate_estimator __rcu *rate_est;
Patrick McHardy13d2a1d2008-11-20 04:10:00 -080028 struct list_head alist;
29 struct Qdisc *qdisc;
30
31 u32 quantum;
32 u32 deficit;
33};
34
35struct drr_sched {
36 struct list_head active;
John Fastabend25d8c0d2014-09-12 20:05:27 -070037 struct tcf_proto __rcu *filter_list;
Jiri Pirko6529eab2017-05-17 11:07:55 +020038 struct tcf_block *block;
Patrick McHardy13d2a1d2008-11-20 04:10:00 -080039 struct Qdisc_class_hash clhash;
40};
41
42static struct drr_class *drr_find_class(struct Qdisc *sch, u32 classid)
43{
44 struct drr_sched *q = qdisc_priv(sch);
45 struct Qdisc_class_common *clc;
46
47 clc = qdisc_class_find(&q->clhash, classid);
48 if (clc == NULL)
49 return NULL;
50 return container_of(clc, struct drr_class, common);
51}
52
53static void drr_purge_queue(struct drr_class *cl)
54{
55 unsigned int len = cl->qdisc->q.qlen;
WANG Cong2ccccf52016-02-25 14:55:01 -080056 unsigned int backlog = cl->qdisc->qstats.backlog;
Patrick McHardy13d2a1d2008-11-20 04:10:00 -080057
58 qdisc_reset(cl->qdisc);
WANG Cong2ccccf52016-02-25 14:55:01 -080059 qdisc_tree_reduce_backlog(cl->qdisc, len, backlog);
Patrick McHardy13d2a1d2008-11-20 04:10:00 -080060}
61
62static const struct nla_policy drr_policy[TCA_DRR_MAX + 1] = {
63 [TCA_DRR_QUANTUM] = { .type = NLA_U32 },
64};
65
66static int drr_change_class(struct Qdisc *sch, u32 classid, u32 parentid,
Alexander Aring793d81d2017-12-20 12:35:15 -050067 struct nlattr **tca, unsigned long *arg,
68 struct netlink_ext_ack *extack)
Patrick McHardy13d2a1d2008-11-20 04:10:00 -080069{
70 struct drr_sched *q = qdisc_priv(sch);
71 struct drr_class *cl = (struct drr_class *)*arg;
Jarek Poplawski1844f742009-02-27 02:42:38 -080072 struct nlattr *opt = tca[TCA_OPTIONS];
Patrick McHardy13d2a1d2008-11-20 04:10:00 -080073 struct nlattr *tb[TCA_DRR_MAX + 1];
74 u32 quantum;
75 int err;
76
Jarek Poplawski1844f742009-02-27 02:42:38 -080077 if (!opt)
78 return -EINVAL;
79
Johannes Bergfceb6432017-04-12 14:34:07 +020080 err = nla_parse_nested(tb, TCA_DRR_MAX, opt, drr_policy, NULL);
Patrick McHardy13d2a1d2008-11-20 04:10:00 -080081 if (err < 0)
82 return err;
83
84 if (tb[TCA_DRR_QUANTUM]) {
85 quantum = nla_get_u32(tb[TCA_DRR_QUANTUM]);
86 if (quantum == 0)
87 return -EINVAL;
88 } else
89 quantum = psched_mtu(qdisc_dev(sch));
90
91 if (cl != NULL) {
Stephen Hemminger71bcb092008-11-25 21:13:31 -080092 if (tca[TCA_RATE]) {
John Fastabend22e0f8b2014-09-28 11:52:56 -070093 err = gen_replace_estimator(&cl->bstats, NULL,
94 &cl->rate_est,
Eric Dumazetedb09eb2016-06-06 09:37:16 -070095 NULL,
96 qdisc_root_sleeping_running(sch),
Stephen Hemminger71bcb092008-11-25 21:13:31 -080097 tca[TCA_RATE]);
98 if (err)
99 return err;
100 }
101
Patrick McHardy13d2a1d2008-11-20 04:10:00 -0800102 sch_tree_lock(sch);
103 if (tb[TCA_DRR_QUANTUM])
104 cl->quantum = quantum;
105 sch_tree_unlock(sch);
106
Patrick McHardy13d2a1d2008-11-20 04:10:00 -0800107 return 0;
108 }
109
110 cl = kzalloc(sizeof(struct drr_class), GFP_KERNEL);
111 if (cl == NULL)
112 return -ENOBUFS;
113
Patrick McHardy13d2a1d2008-11-20 04:10:00 -0800114 cl->common.classid = classid;
115 cl->quantum = quantum;
Changli Gao3511c912010-10-16 13:04:08 +0000116 cl->qdisc = qdisc_create_dflt(sch->dev_queue,
Patrick McHardy13d2a1d2008-11-20 04:10:00 -0800117 &pfifo_qdisc_ops, classid);
118 if (cl->qdisc == NULL)
119 cl->qdisc = &noop_qdisc;
Jiri Kosina49b49972017-03-08 16:03:32 +0100120 else
121 qdisc_hash_add(cl->qdisc, true);
Patrick McHardy13d2a1d2008-11-20 04:10:00 -0800122
Stephen Hemminger71bcb092008-11-25 21:13:31 -0800123 if (tca[TCA_RATE]) {
John Fastabend22e0f8b2014-09-28 11:52:56 -0700124 err = gen_replace_estimator(&cl->bstats, NULL, &cl->rate_est,
Eric Dumazetedb09eb2016-06-06 09:37:16 -0700125 NULL,
126 qdisc_root_sleeping_running(sch),
Stephen Hemminger71bcb092008-11-25 21:13:31 -0800127 tca[TCA_RATE]);
128 if (err) {
129 qdisc_destroy(cl->qdisc);
130 kfree(cl);
131 return err;
132 }
133 }
Patrick McHardy13d2a1d2008-11-20 04:10:00 -0800134
135 sch_tree_lock(sch);
136 qdisc_class_hash_insert(&q->clhash, &cl->common);
137 sch_tree_unlock(sch);
138
139 qdisc_class_hash_grow(sch, &q->clhash);
140
141 *arg = (unsigned long)cl;
142 return 0;
143}
144
145static void drr_destroy_class(struct Qdisc *sch, struct drr_class *cl)
146{
Eric Dumazet1c0d32f2016-12-04 09:48:16 -0800147 gen_kill_estimator(&cl->rate_est);
Patrick McHardy13d2a1d2008-11-20 04:10:00 -0800148 qdisc_destroy(cl->qdisc);
149 kfree(cl);
150}
151
152static int drr_delete_class(struct Qdisc *sch, unsigned long arg)
153{
154 struct drr_sched *q = qdisc_priv(sch);
155 struct drr_class *cl = (struct drr_class *)arg;
156
157 if (cl->filter_cnt > 0)
158 return -EBUSY;
159
160 sch_tree_lock(sch);
161
162 drr_purge_queue(cl);
163 qdisc_class_hash_remove(&q->clhash, &cl->common);
164
Patrick McHardy13d2a1d2008-11-20 04:10:00 -0800165 sch_tree_unlock(sch);
WANG Cong143976c2017-08-24 16:51:29 -0700166
167 drr_destroy_class(sch, cl);
Patrick McHardy13d2a1d2008-11-20 04:10:00 -0800168 return 0;
169}
170
WANG Cong143976c2017-08-24 16:51:29 -0700171static unsigned long drr_search_class(struct Qdisc *sch, u32 classid)
Patrick McHardy13d2a1d2008-11-20 04:10:00 -0800172{
WANG Cong143976c2017-08-24 16:51:29 -0700173 return (unsigned long)drr_find_class(sch, classid);
Patrick McHardy13d2a1d2008-11-20 04:10:00 -0800174}
175
Jiri Pirko6529eab2017-05-17 11:07:55 +0200176static struct tcf_block *drr_tcf_block(struct Qdisc *sch, unsigned long cl)
Patrick McHardy13d2a1d2008-11-20 04:10:00 -0800177{
178 struct drr_sched *q = qdisc_priv(sch);
179
180 if (cl)
181 return NULL;
182
Jiri Pirko6529eab2017-05-17 11:07:55 +0200183 return q->block;
Patrick McHardy13d2a1d2008-11-20 04:10:00 -0800184}
185
186static unsigned long drr_bind_tcf(struct Qdisc *sch, unsigned long parent,
187 u32 classid)
188{
189 struct drr_class *cl = drr_find_class(sch, classid);
190
191 if (cl != NULL)
192 cl->filter_cnt++;
193
194 return (unsigned long)cl;
195}
196
197static void drr_unbind_tcf(struct Qdisc *sch, unsigned long arg)
198{
199 struct drr_class *cl = (struct drr_class *)arg;
200
201 cl->filter_cnt--;
202}
203
204static int drr_graft_class(struct Qdisc *sch, unsigned long arg,
205 struct Qdisc *new, struct Qdisc **old)
206{
207 struct drr_class *cl = (struct drr_class *)arg;
208
209 if (new == NULL) {
Changli Gao3511c912010-10-16 13:04:08 +0000210 new = qdisc_create_dflt(sch->dev_queue,
Patrick McHardy13d2a1d2008-11-20 04:10:00 -0800211 &pfifo_qdisc_ops, cl->common.classid);
212 if (new == NULL)
213 new = &noop_qdisc;
214 }
215
WANG Cong86a79962016-02-25 14:55:00 -0800216 *old = qdisc_replace(sch, new, &cl->qdisc);
Patrick McHardy13d2a1d2008-11-20 04:10:00 -0800217 return 0;
218}
219
220static struct Qdisc *drr_class_leaf(struct Qdisc *sch, unsigned long arg)
221{
222 struct drr_class *cl = (struct drr_class *)arg;
223
224 return cl->qdisc;
225}
226
227static void drr_qlen_notify(struct Qdisc *csh, unsigned long arg)
228{
229 struct drr_class *cl = (struct drr_class *)arg;
230
Konstantin Khlebnikov95946652017-08-15 16:39:59 +0300231 list_del(&cl->alist);
Patrick McHardy13d2a1d2008-11-20 04:10:00 -0800232}
233
234static int drr_dump_class(struct Qdisc *sch, unsigned long arg,
235 struct sk_buff *skb, struct tcmsg *tcm)
236{
237 struct drr_class *cl = (struct drr_class *)arg;
238 struct nlattr *nest;
239
240 tcm->tcm_parent = TC_H_ROOT;
241 tcm->tcm_handle = cl->common.classid;
242 tcm->tcm_info = cl->qdisc->handle;
243
244 nest = nla_nest_start(skb, TCA_OPTIONS);
245 if (nest == NULL)
246 goto nla_put_failure;
David S. Miller1b34ec42012-03-29 05:11:39 -0400247 if (nla_put_u32(skb, TCA_DRR_QUANTUM, cl->quantum))
248 goto nla_put_failure;
Patrick McHardy13d2a1d2008-11-20 04:10:00 -0800249 return nla_nest_end(skb, nest);
250
251nla_put_failure:
252 nla_nest_cancel(skb, nest);
253 return -EMSGSIZE;
254}
255
256static int drr_dump_class_stats(struct Qdisc *sch, unsigned long arg,
257 struct gnet_dump *d)
258{
259 struct drr_class *cl = (struct drr_class *)arg;
John Fastabend64015852014-09-28 11:53:57 -0700260 __u32 qlen = cl->qdisc->q.qlen;
Patrick McHardy13d2a1d2008-11-20 04:10:00 -0800261 struct tc_drr_stats xstats;
262
263 memset(&xstats, 0, sizeof(xstats));
John Fastabend64015852014-09-28 11:53:57 -0700264 if (qlen)
Patrick McHardy13d2a1d2008-11-20 04:10:00 -0800265 xstats.deficit = cl->deficit;
266
Eric Dumazetedb09eb2016-06-06 09:37:16 -0700267 if (gnet_stats_copy_basic(qdisc_root_sleeping_running(sch),
268 d, NULL, &cl->bstats) < 0 ||
Eric Dumazet1c0d32f2016-12-04 09:48:16 -0800269 gnet_stats_copy_rate_est(d, &cl->rate_est) < 0 ||
John Fastabendb0ab6f92014-09-28 11:54:24 -0700270 gnet_stats_copy_queue(d, NULL, &cl->qdisc->qstats, qlen) < 0)
Patrick McHardy13d2a1d2008-11-20 04:10:00 -0800271 return -1;
272
273 return gnet_stats_copy_app(d, &xstats, sizeof(xstats));
274}
275
276static void drr_walk(struct Qdisc *sch, struct qdisc_walker *arg)
277{
278 struct drr_sched *q = qdisc_priv(sch);
279 struct drr_class *cl;
Patrick McHardy13d2a1d2008-11-20 04:10:00 -0800280 unsigned int i;
281
282 if (arg->stop)
283 return;
284
285 for (i = 0; i < q->clhash.hashsize; i++) {
Sasha Levinb67bfe02013-02-27 17:06:00 -0800286 hlist_for_each_entry(cl, &q->clhash.hash[i], common.hnode) {
Patrick McHardy13d2a1d2008-11-20 04:10:00 -0800287 if (arg->count < arg->skip) {
288 arg->count++;
289 continue;
290 }
291 if (arg->fn(sch, (unsigned long)cl, arg) < 0) {
292 arg->stop = 1;
293 return;
294 }
295 arg->count++;
296 }
297 }
298}
299
300static struct drr_class *drr_classify(struct sk_buff *skb, struct Qdisc *sch,
301 int *qerr)
302{
303 struct drr_sched *q = qdisc_priv(sch);
304 struct drr_class *cl;
305 struct tcf_result res;
John Fastabend25d8c0d2014-09-12 20:05:27 -0700306 struct tcf_proto *fl;
Patrick McHardy13d2a1d2008-11-20 04:10:00 -0800307 int result;
308
309 if (TC_H_MAJ(skb->priority ^ sch->handle) == 0) {
310 cl = drr_find_class(sch, skb->priority);
311 if (cl != NULL)
312 return cl;
313 }
314
315 *qerr = NET_XMIT_SUCCESS | __NET_XMIT_BYPASS;
John Fastabend25d8c0d2014-09-12 20:05:27 -0700316 fl = rcu_dereference_bh(q->filter_list);
Jiri Pirko87d83092017-05-17 11:07:54 +0200317 result = tcf_classify(skb, fl, &res, false);
Patrick McHardy13d2a1d2008-11-20 04:10:00 -0800318 if (result >= 0) {
319#ifdef CONFIG_NET_CLS_ACT
320 switch (result) {
321 case TC_ACT_QUEUED:
322 case TC_ACT_STOLEN:
Jiri Pirkoe25ea212017-06-06 14:12:02 +0200323 case TC_ACT_TRAP:
Patrick McHardy13d2a1d2008-11-20 04:10:00 -0800324 *qerr = NET_XMIT_SUCCESS | __NET_XMIT_STOLEN;
Gustavo A. R. Silvaf3ae6082017-10-19 16:28:24 -0500325 /* fall through */
Patrick McHardy13d2a1d2008-11-20 04:10:00 -0800326 case TC_ACT_SHOT:
327 return NULL;
328 }
329#endif
330 cl = (struct drr_class *)res.class;
331 if (cl == NULL)
332 cl = drr_find_class(sch, res.classid);
333 return cl;
334 }
335 return NULL;
336}
337
Eric Dumazet520ac302016-06-21 23:16:49 -0700338static int drr_enqueue(struct sk_buff *skb, struct Qdisc *sch,
339 struct sk_buff **to_free)
Patrick McHardy13d2a1d2008-11-20 04:10:00 -0800340{
341 struct drr_sched *q = qdisc_priv(sch);
342 struct drr_class *cl;
David S. Millerf54ba772012-09-27 18:35:47 -0400343 int err = 0;
Patrick McHardy13d2a1d2008-11-20 04:10:00 -0800344
345 cl = drr_classify(skb, sch, &err);
346 if (cl == NULL) {
347 if (err & __NET_XMIT_BYPASS)
John Fastabend25331d62014-09-28 11:53:29 -0700348 qdisc_qstats_drop(sch);
Eric Dumazet520ac302016-06-21 23:16:49 -0700349 __qdisc_drop(skb, to_free);
Patrick McHardy13d2a1d2008-11-20 04:10:00 -0800350 return err;
351 }
352
Eric Dumazet520ac302016-06-21 23:16:49 -0700353 err = qdisc_enqueue(skb, cl->qdisc, to_free);
Patrick McHardy13d2a1d2008-11-20 04:10:00 -0800354 if (unlikely(err != NET_XMIT_SUCCESS)) {
355 if (net_xmit_drop_count(err)) {
356 cl->qstats.drops++;
John Fastabend25331d62014-09-28 11:53:29 -0700357 qdisc_qstats_drop(sch);
Patrick McHardy13d2a1d2008-11-20 04:10:00 -0800358 }
359 return err;
360 }
361
362 if (cl->qdisc->q.qlen == 1) {
363 list_add_tail(&cl->alist, &q->active);
364 cl->deficit = cl->quantum;
365 }
366
WANG Cong6a73b572016-06-01 16:15:17 -0700367 qdisc_qstats_backlog_inc(sch, skb);
Patrick McHardy13d2a1d2008-11-20 04:10:00 -0800368 sch->q.qlen++;
369 return err;
370}
371
372static struct sk_buff *drr_dequeue(struct Qdisc *sch)
373{
374 struct drr_sched *q = qdisc_priv(sch);
375 struct drr_class *cl;
376 struct sk_buff *skb;
377 unsigned int len;
378
Patrick McHardy3f0947c2008-11-24 15:46:08 -0800379 if (list_empty(&q->active))
380 goto out;
381 while (1) {
Patrick McHardy13d2a1d2008-11-20 04:10:00 -0800382 cl = list_first_entry(&q->active, struct drr_class, alist);
383 skb = cl->qdisc->ops->peek(cl->qdisc);
Florian Westphal6e765a02014-06-11 20:35:18 +0200384 if (skb == NULL) {
385 qdisc_warn_nonwc(__func__, cl->qdisc);
Patrick McHardy3f0947c2008-11-24 15:46:08 -0800386 goto out;
Florian Westphal6e765a02014-06-11 20:35:18 +0200387 }
Patrick McHardy13d2a1d2008-11-20 04:10:00 -0800388
389 len = qdisc_pkt_len(skb);
390 if (len <= cl->deficit) {
391 cl->deficit -= len;
392 skb = qdisc_dequeue_peeked(cl->qdisc);
Bernie Harrisdf3eb6c2016-01-28 16:30:51 +1300393 if (unlikely(skb == NULL))
394 goto out;
Patrick McHardy13d2a1d2008-11-20 04:10:00 -0800395 if (cl->qdisc->q.qlen == 0)
396 list_del(&cl->alist);
Eric Dumazet2dd875f2012-05-10 05:36:34 +0000397
398 bstats_update(&cl->bstats, skb);
Eric Dumazet9190b3b2011-01-20 23:31:33 -0800399 qdisc_bstats_update(sch, skb);
WANG Cong6a73b572016-06-01 16:15:17 -0700400 qdisc_qstats_backlog_dec(sch, skb);
Patrick McHardy13d2a1d2008-11-20 04:10:00 -0800401 sch->q.qlen--;
402 return skb;
403 }
404
405 cl->deficit += cl->quantum;
Patrick McHardy13d2a1d2008-11-20 04:10:00 -0800406 list_move_tail(&cl->alist, &q->active);
407 }
Patrick McHardy3f0947c2008-11-24 15:46:08 -0800408out:
Patrick McHardy13d2a1d2008-11-20 04:10:00 -0800409 return NULL;
410}
411
Alexander Aringe63d7df2017-12-20 12:35:13 -0500412static int drr_init_qdisc(struct Qdisc *sch, struct nlattr *opt,
413 struct netlink_ext_ack *extack)
Patrick McHardy13d2a1d2008-11-20 04:10:00 -0800414{
415 struct drr_sched *q = qdisc_priv(sch);
416 int err;
417
Jiri Pirko69d78ef2017-10-13 14:00:57 +0200418 err = tcf_block_get(&q->block, &q->filter_list, sch);
Jiri Pirko6529eab2017-05-17 11:07:55 +0200419 if (err)
420 return err;
Patrick McHardy13d2a1d2008-11-20 04:10:00 -0800421 err = qdisc_class_hash_init(&q->clhash);
422 if (err < 0)
423 return err;
424 INIT_LIST_HEAD(&q->active);
425 return 0;
426}
427
428static void drr_reset_qdisc(struct Qdisc *sch)
429{
430 struct drr_sched *q = qdisc_priv(sch);
431 struct drr_class *cl;
Patrick McHardy13d2a1d2008-11-20 04:10:00 -0800432 unsigned int i;
433
434 for (i = 0; i < q->clhash.hashsize; i++) {
Sasha Levinb67bfe02013-02-27 17:06:00 -0800435 hlist_for_each_entry(cl, &q->clhash.hash[i], common.hnode) {
Patrick McHardy13d2a1d2008-11-20 04:10:00 -0800436 if (cl->qdisc->q.qlen)
437 list_del(&cl->alist);
438 qdisc_reset(cl->qdisc);
439 }
440 }
WANG Cong6a73b572016-06-01 16:15:17 -0700441 sch->qstats.backlog = 0;
Patrick McHardy13d2a1d2008-11-20 04:10:00 -0800442 sch->q.qlen = 0;
443}
444
445static void drr_destroy_qdisc(struct Qdisc *sch)
446{
447 struct drr_sched *q = qdisc_priv(sch);
448 struct drr_class *cl;
Sasha Levinb67bfe02013-02-27 17:06:00 -0800449 struct hlist_node *next;
Patrick McHardy13d2a1d2008-11-20 04:10:00 -0800450 unsigned int i;
451
Jiri Pirko6529eab2017-05-17 11:07:55 +0200452 tcf_block_put(q->block);
Patrick McHardy13d2a1d2008-11-20 04:10:00 -0800453
454 for (i = 0; i < q->clhash.hashsize; i++) {
Sasha Levinb67bfe02013-02-27 17:06:00 -0800455 hlist_for_each_entry_safe(cl, next, &q->clhash.hash[i],
Patrick McHardy13d2a1d2008-11-20 04:10:00 -0800456 common.hnode)
457 drr_destroy_class(sch, cl);
458 }
459 qdisc_class_hash_destroy(&q->clhash);
460}
461
462static const struct Qdisc_class_ops drr_class_ops = {
463 .change = drr_change_class,
464 .delete = drr_delete_class,
WANG Cong143976c2017-08-24 16:51:29 -0700465 .find = drr_search_class,
Jiri Pirko6529eab2017-05-17 11:07:55 +0200466 .tcf_block = drr_tcf_block,
Patrick McHardy13d2a1d2008-11-20 04:10:00 -0800467 .bind_tcf = drr_bind_tcf,
468 .unbind_tcf = drr_unbind_tcf,
469 .graft = drr_graft_class,
470 .leaf = drr_class_leaf,
471 .qlen_notify = drr_qlen_notify,
472 .dump = drr_dump_class,
473 .dump_stats = drr_dump_class_stats,
474 .walk = drr_walk,
475};
476
477static struct Qdisc_ops drr_qdisc_ops __read_mostly = {
478 .cl_ops = &drr_class_ops,
479 .id = "drr",
480 .priv_size = sizeof(struct drr_sched),
481 .enqueue = drr_enqueue,
482 .dequeue = drr_dequeue,
483 .peek = qdisc_peek_dequeued,
Patrick McHardy13d2a1d2008-11-20 04:10:00 -0800484 .init = drr_init_qdisc,
485 .reset = drr_reset_qdisc,
486 .destroy = drr_destroy_qdisc,
487 .owner = THIS_MODULE,
488};
489
490static int __init drr_init(void)
491{
492 return register_qdisc(&drr_qdisc_ops);
493}
494
495static void __exit drr_exit(void)
496{
497 unregister_qdisc(&drr_qdisc_ops);
498}
499
500module_init(drr_init);
501module_exit(drr_exit);
502MODULE_LICENSE("GPL");