blob: a6fc53d69513baa3578e6b73a7947ae1dee8ee0c [file] [log] [blame]
Eric Dumazet4b549a22012-05-11 09:30:50 +00001/*
2 * Fair Queue CoDel discipline
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.
8 *
9 * Copyright (C) 2012 Eric Dumazet <edumazet@google.com>
10 */
11
12#include <linux/module.h>
13#include <linux/types.h>
14#include <linux/kernel.h>
15#include <linux/jiffies.h>
16#include <linux/string.h>
17#include <linux/in.h>
18#include <linux/errno.h>
19#include <linux/init.h>
20#include <linux/skbuff.h>
21#include <linux/jhash.h>
22#include <linux/slab.h>
23#include <linux/vmalloc.h>
24#include <net/netlink.h>
25#include <net/pkt_sched.h>
Eric Dumazet4b549a22012-05-11 09:30:50 +000026#include <net/codel.h>
27
28/* Fair Queue CoDel.
29 *
30 * Principles :
31 * Packets are classified (internal classifier or external) on flows.
32 * This is a Stochastic model (as we use a hash, several flows
33 * might be hashed on same slot)
34 * Each flow has a CoDel managed queue.
35 * Flows are linked onto two (Round Robin) lists,
36 * so that new flows have priority on old ones.
37 *
38 * For a given flow, packets are not reordered (CoDel uses a FIFO)
39 * head drops only.
40 * ECN capability is on by default.
41 * Low memory footprint (64 bytes per flow)
42 */
43
44struct fq_codel_flow {
45 struct sk_buff *head;
46 struct sk_buff *tail;
47 struct list_head flowchain;
48 int deficit;
49 u32 dropped; /* number of drops (or ECN marks) on this flow */
50 struct codel_vars cvars;
51}; /* please try to keep this structure <= 64 bytes */
52
53struct fq_codel_sched_data {
John Fastabend25d8c0d2014-09-12 20:05:27 -070054 struct tcf_proto __rcu *filter_list; /* optional external classifier */
Eric Dumazet4b549a22012-05-11 09:30:50 +000055 struct fq_codel_flow *flows; /* Flows table [flows_cnt] */
56 u32 *backlogs; /* backlog table [flows_cnt] */
57 u32 flows_cnt; /* number of flows */
58 u32 perturbation; /* hash perturbation */
59 u32 quantum; /* psched_mtu(qdisc_dev(sch)); */
60 struct codel_params cparams;
61 struct codel_stats cstats;
62 u32 drop_overlimit;
63 u32 new_flow_count;
64
65 struct list_head new_flows; /* list of new flows */
66 struct list_head old_flows; /* list of old flows */
67};
68
69static unsigned int fq_codel_hash(const struct fq_codel_sched_data *q,
Tom Herbert342db222015-05-01 11:30:13 -070070 struct sk_buff *skb)
Eric Dumazet4b549a22012-05-11 09:30:50 +000071{
Tom Herbert342db222015-05-01 11:30:13 -070072 u32 hash = skb_get_hash_perturb(skb, q->perturbation);
Daniel Borkmann8fc54f62014-08-23 20:58:54 +020073
74 return reciprocal_scale(hash, q->flows_cnt);
Eric Dumazet4b549a22012-05-11 09:30:50 +000075}
76
77static unsigned int fq_codel_classify(struct sk_buff *skb, struct Qdisc *sch,
78 int *qerr)
79{
80 struct fq_codel_sched_data *q = qdisc_priv(sch);
John Fastabend25d8c0d2014-09-12 20:05:27 -070081 struct tcf_proto *filter;
Eric Dumazet4b549a22012-05-11 09:30:50 +000082 struct tcf_result res;
83 int result;
84
85 if (TC_H_MAJ(skb->priority) == sch->handle &&
86 TC_H_MIN(skb->priority) > 0 &&
87 TC_H_MIN(skb->priority) <= q->flows_cnt)
88 return TC_H_MIN(skb->priority);
89
Valdis.Kletnieks@vt.edu69204cf2014-12-09 16:15:50 -050090 filter = rcu_dereference_bh(q->filter_list);
John Fastabend25d8c0d2014-09-12 20:05:27 -070091 if (!filter)
Eric Dumazet4b549a22012-05-11 09:30:50 +000092 return fq_codel_hash(q, skb) + 1;
93
94 *qerr = NET_XMIT_SUCCESS | __NET_XMIT_BYPASS;
John Fastabend25d8c0d2014-09-12 20:05:27 -070095 result = tc_classify(skb, filter, &res);
Eric Dumazet4b549a22012-05-11 09:30:50 +000096 if (result >= 0) {
97#ifdef CONFIG_NET_CLS_ACT
98 switch (result) {
99 case TC_ACT_STOLEN:
100 case TC_ACT_QUEUED:
101 *qerr = NET_XMIT_SUCCESS | __NET_XMIT_STOLEN;
102 case TC_ACT_SHOT:
103 return 0;
104 }
105#endif
106 if (TC_H_MIN(res.classid) <= q->flows_cnt)
107 return TC_H_MIN(res.classid);
108 }
109 return 0;
110}
111
112/* helper functions : might be changed when/if skb use a standard list_head */
113
114/* remove one skb from head of slot queue */
115static inline struct sk_buff *dequeue_head(struct fq_codel_flow *flow)
116{
117 struct sk_buff *skb = flow->head;
118
119 flow->head = skb->next;
120 skb->next = NULL;
121 return skb;
122}
123
124/* add skb to flow queue (tail add) */
125static inline void flow_queue_add(struct fq_codel_flow *flow,
126 struct sk_buff *skb)
127{
128 if (flow->head == NULL)
129 flow->head = skb;
130 else
131 flow->tail->next = skb;
132 flow->tail = skb;
133 skb->next = NULL;
134}
135
136static unsigned int fq_codel_drop(struct Qdisc *sch)
137{
138 struct fq_codel_sched_data *q = qdisc_priv(sch);
139 struct sk_buff *skb;
140 unsigned int maxbacklog = 0, idx = 0, i, len;
141 struct fq_codel_flow *flow;
142
143 /* Queue is full! Find the fat flow and drop packet from it.
144 * This might sound expensive, but with 1024 flows, we scan
145 * 4KB of memory, and we dont need to handle a complex tree
146 * in fast path (packet queue/enqueue) with many cache misses.
147 */
148 for (i = 0; i < q->flows_cnt; i++) {
149 if (q->backlogs[i] > maxbacklog) {
150 maxbacklog = q->backlogs[i];
151 idx = i;
152 }
153 }
154 flow = &q->flows[idx];
155 skb = dequeue_head(flow);
156 len = qdisc_pkt_len(skb);
157 q->backlogs[idx] -= len;
158 kfree_skb(skb);
159 sch->q.qlen--;
John Fastabend25331d62014-09-28 11:53:29 -0700160 qdisc_qstats_drop(sch);
161 qdisc_qstats_backlog_dec(sch, skb);
Eric Dumazet4b549a22012-05-11 09:30:50 +0000162 flow->dropped++;
163 return idx;
164}
165
166static int fq_codel_enqueue(struct sk_buff *skb, struct Qdisc *sch)
167{
168 struct fq_codel_sched_data *q = qdisc_priv(sch);
169 unsigned int idx;
170 struct fq_codel_flow *flow;
171 int uninitialized_var(ret);
172
173 idx = fq_codel_classify(skb, sch, &ret);
174 if (idx == 0) {
175 if (ret & __NET_XMIT_BYPASS)
John Fastabend25331d62014-09-28 11:53:29 -0700176 qdisc_qstats_drop(sch);
Eric Dumazet4b549a22012-05-11 09:30:50 +0000177 kfree_skb(skb);
178 return ret;
179 }
180 idx--;
181
182 codel_set_enqueue_time(skb);
183 flow = &q->flows[idx];
184 flow_queue_add(flow, skb);
185 q->backlogs[idx] += qdisc_pkt_len(skb);
John Fastabend25331d62014-09-28 11:53:29 -0700186 qdisc_qstats_backlog_inc(sch, skb);
Eric Dumazet4b549a22012-05-11 09:30:50 +0000187
188 if (list_empty(&flow->flowchain)) {
189 list_add_tail(&flow->flowchain, &q->new_flows);
Eric Dumazet4b549a22012-05-11 09:30:50 +0000190 q->new_flow_count++;
191 flow->deficit = q->quantum;
192 flow->dropped = 0;
193 }
Vijay Subramaniancd68ddd2013-03-28 13:52:00 +0000194 if (++sch->q.qlen <= sch->limit)
Eric Dumazet4b549a22012-05-11 09:30:50 +0000195 return NET_XMIT_SUCCESS;
196
197 q->drop_overlimit++;
198 /* Return Congestion Notification only if we dropped a packet
199 * from this flow.
200 */
201 if (fq_codel_drop(sch) == idx)
202 return NET_XMIT_CN;
203
204 /* As we dropped a packet, better let upper stack know this */
205 qdisc_tree_decrease_qlen(sch, 1);
206 return NET_XMIT_SUCCESS;
207}
208
209/* This is the specific function called from codel_dequeue()
210 * to dequeue a packet from queue. Note: backlog is handled in
211 * codel, we dont need to reduce it here.
212 */
213static struct sk_buff *dequeue(struct codel_vars *vars, struct Qdisc *sch)
214{
Eric Dumazet865ec552012-05-16 04:39:09 +0000215 struct fq_codel_sched_data *q = qdisc_priv(sch);
Eric Dumazet4b549a22012-05-11 09:30:50 +0000216 struct fq_codel_flow *flow;
217 struct sk_buff *skb = NULL;
218
219 flow = container_of(vars, struct fq_codel_flow, cvars);
220 if (flow->head) {
221 skb = dequeue_head(flow);
Eric Dumazet865ec552012-05-16 04:39:09 +0000222 q->backlogs[flow - q->flows] -= qdisc_pkt_len(skb);
Eric Dumazet4b549a22012-05-11 09:30:50 +0000223 sch->q.qlen--;
224 }
225 return skb;
226}
227
228static struct sk_buff *fq_codel_dequeue(struct Qdisc *sch)
229{
230 struct fq_codel_sched_data *q = qdisc_priv(sch);
231 struct sk_buff *skb;
232 struct fq_codel_flow *flow;
233 struct list_head *head;
234 u32 prev_drop_count, prev_ecn_mark;
235
236begin:
237 head = &q->new_flows;
238 if (list_empty(head)) {
239 head = &q->old_flows;
240 if (list_empty(head))
241 return NULL;
242 }
243 flow = list_first_entry(head, struct fq_codel_flow, flowchain);
244
245 if (flow->deficit <= 0) {
246 flow->deficit += q->quantum;
247 list_move_tail(&flow->flowchain, &q->old_flows);
248 goto begin;
249 }
250
251 prev_drop_count = q->cstats.drop_count;
252 prev_ecn_mark = q->cstats.ecn_mark;
253
254 skb = codel_dequeue(sch, &q->cparams, &flow->cvars, &q->cstats,
Eric Dumazet865ec552012-05-16 04:39:09 +0000255 dequeue);
Eric Dumazet4b549a22012-05-11 09:30:50 +0000256
257 flow->dropped += q->cstats.drop_count - prev_drop_count;
258 flow->dropped += q->cstats.ecn_mark - prev_ecn_mark;
259
260 if (!skb) {
261 /* force a pass through old_flows to prevent starvation */
262 if ((head == &q->new_flows) && !list_empty(&q->old_flows))
263 list_move_tail(&flow->flowchain, &q->old_flows);
264 else
265 list_del_init(&flow->flowchain);
266 goto begin;
267 }
268 qdisc_bstats_update(sch, skb);
269 flow->deficit -= qdisc_pkt_len(skb);
270 /* We cant call qdisc_tree_decrease_qlen() if our qlen is 0,
271 * or HTB crashes. Defer it for next round.
272 */
273 if (q->cstats.drop_count && sch->q.qlen) {
274 qdisc_tree_decrease_qlen(sch, q->cstats.drop_count);
275 q->cstats.drop_count = 0;
276 }
277 return skb;
278}
279
280static void fq_codel_reset(struct Qdisc *sch)
281{
282 struct sk_buff *skb;
283
284 while ((skb = fq_codel_dequeue(sch)) != NULL)
285 kfree_skb(skb);
286}
287
288static const struct nla_policy fq_codel_policy[TCA_FQ_CODEL_MAX + 1] = {
289 [TCA_FQ_CODEL_TARGET] = { .type = NLA_U32 },
290 [TCA_FQ_CODEL_LIMIT] = { .type = NLA_U32 },
291 [TCA_FQ_CODEL_INTERVAL] = { .type = NLA_U32 },
292 [TCA_FQ_CODEL_ECN] = { .type = NLA_U32 },
293 [TCA_FQ_CODEL_FLOWS] = { .type = NLA_U32 },
294 [TCA_FQ_CODEL_QUANTUM] = { .type = NLA_U32 },
295};
296
297static int fq_codel_change(struct Qdisc *sch, struct nlattr *opt)
298{
299 struct fq_codel_sched_data *q = qdisc_priv(sch);
300 struct nlattr *tb[TCA_FQ_CODEL_MAX + 1];
301 int err;
302
303 if (!opt)
304 return -EINVAL;
305
306 err = nla_parse_nested(tb, TCA_FQ_CODEL_MAX, opt, fq_codel_policy);
307 if (err < 0)
308 return err;
309 if (tb[TCA_FQ_CODEL_FLOWS]) {
310 if (q->flows)
311 return -EINVAL;
312 q->flows_cnt = nla_get_u32(tb[TCA_FQ_CODEL_FLOWS]);
313 if (!q->flows_cnt ||
314 q->flows_cnt > 65536)
315 return -EINVAL;
316 }
317 sch_tree_lock(sch);
318
319 if (tb[TCA_FQ_CODEL_TARGET]) {
320 u64 target = nla_get_u32(tb[TCA_FQ_CODEL_TARGET]);
321
322 q->cparams.target = (target * NSEC_PER_USEC) >> CODEL_SHIFT;
323 }
324
325 if (tb[TCA_FQ_CODEL_INTERVAL]) {
326 u64 interval = nla_get_u32(tb[TCA_FQ_CODEL_INTERVAL]);
327
328 q->cparams.interval = (interval * NSEC_PER_USEC) >> CODEL_SHIFT;
329 }
330
331 if (tb[TCA_FQ_CODEL_LIMIT])
332 sch->limit = nla_get_u32(tb[TCA_FQ_CODEL_LIMIT]);
333
334 if (tb[TCA_FQ_CODEL_ECN])
335 q->cparams.ecn = !!nla_get_u32(tb[TCA_FQ_CODEL_ECN]);
336
337 if (tb[TCA_FQ_CODEL_QUANTUM])
338 q->quantum = max(256U, nla_get_u32(tb[TCA_FQ_CODEL_QUANTUM]));
339
340 while (sch->q.qlen > sch->limit) {
341 struct sk_buff *skb = fq_codel_dequeue(sch);
342
343 kfree_skb(skb);
344 q->cstats.drop_count++;
345 }
346 qdisc_tree_decrease_qlen(sch, q->cstats.drop_count);
347 q->cstats.drop_count = 0;
348
349 sch_tree_unlock(sch);
350 return 0;
351}
352
353static void *fq_codel_zalloc(size_t sz)
354{
355 void *ptr = kzalloc(sz, GFP_KERNEL | __GFP_NOWARN);
356
357 if (!ptr)
358 ptr = vzalloc(sz);
359 return ptr;
360}
361
362static void fq_codel_free(void *addr)
363{
WANG Cong4cb28972014-06-02 15:55:22 -0700364 kvfree(addr);
Eric Dumazet4b549a22012-05-11 09:30:50 +0000365}
366
367static void fq_codel_destroy(struct Qdisc *sch)
368{
369 struct fq_codel_sched_data *q = qdisc_priv(sch);
370
371 tcf_destroy_chain(&q->filter_list);
372 fq_codel_free(q->backlogs);
373 fq_codel_free(q->flows);
374}
375
376static int fq_codel_init(struct Qdisc *sch, struct nlattr *opt)
377{
378 struct fq_codel_sched_data *q = qdisc_priv(sch);
379 int i;
380
381 sch->limit = 10*1024;
382 q->flows_cnt = 1024;
383 q->quantum = psched_mtu(qdisc_dev(sch));
Aruna-Hewapathirane63862b52014-01-11 07:15:59 -0500384 q->perturbation = prandom_u32();
Eric Dumazet4b549a22012-05-11 09:30:50 +0000385 INIT_LIST_HEAD(&q->new_flows);
386 INIT_LIST_HEAD(&q->old_flows);
387 codel_params_init(&q->cparams);
388 codel_stats_init(&q->cstats);
389 q->cparams.ecn = true;
390
391 if (opt) {
392 int err = fq_codel_change(sch, opt);
393 if (err)
394 return err;
395 }
396
397 if (!q->flows) {
398 q->flows = fq_codel_zalloc(q->flows_cnt *
399 sizeof(struct fq_codel_flow));
400 if (!q->flows)
401 return -ENOMEM;
402 q->backlogs = fq_codel_zalloc(q->flows_cnt * sizeof(u32));
403 if (!q->backlogs) {
404 fq_codel_free(q->flows);
405 return -ENOMEM;
406 }
407 for (i = 0; i < q->flows_cnt; i++) {
408 struct fq_codel_flow *flow = q->flows + i;
409
410 INIT_LIST_HEAD(&flow->flowchain);
Eric Dumazetb3791352012-09-01 03:19:57 +0000411 codel_vars_init(&flow->cvars);
Eric Dumazet4b549a22012-05-11 09:30:50 +0000412 }
413 }
414 if (sch->limit >= 1)
415 sch->flags |= TCQ_F_CAN_BYPASS;
416 else
417 sch->flags &= ~TCQ_F_CAN_BYPASS;
418 return 0;
419}
420
421static int fq_codel_dump(struct Qdisc *sch, struct sk_buff *skb)
422{
423 struct fq_codel_sched_data *q = qdisc_priv(sch);
424 struct nlattr *opts;
425
426 opts = nla_nest_start(skb, TCA_OPTIONS);
427 if (opts == NULL)
428 goto nla_put_failure;
429
430 if (nla_put_u32(skb, TCA_FQ_CODEL_TARGET,
431 codel_time_to_us(q->cparams.target)) ||
432 nla_put_u32(skb, TCA_FQ_CODEL_LIMIT,
433 sch->limit) ||
434 nla_put_u32(skb, TCA_FQ_CODEL_INTERVAL,
435 codel_time_to_us(q->cparams.interval)) ||
436 nla_put_u32(skb, TCA_FQ_CODEL_ECN,
437 q->cparams.ecn) ||
438 nla_put_u32(skb, TCA_FQ_CODEL_QUANTUM,
439 q->quantum) ||
440 nla_put_u32(skb, TCA_FQ_CODEL_FLOWS,
441 q->flows_cnt))
442 goto nla_put_failure;
443
Yang Yingliangd59b7d82014-03-12 10:20:32 +0800444 return nla_nest_end(skb, opts);
Eric Dumazet4b549a22012-05-11 09:30:50 +0000445
446nla_put_failure:
447 return -1;
448}
449
450static int fq_codel_dump_stats(struct Qdisc *sch, struct gnet_dump *d)
451{
452 struct fq_codel_sched_data *q = qdisc_priv(sch);
453 struct tc_fq_codel_xstats st = {
454 .type = TCA_FQ_CODEL_XSTATS_QDISC,
Eric Dumazet4b549a22012-05-11 09:30:50 +0000455 };
456 struct list_head *pos;
457
Sasha Levin669d67b2012-05-14 11:57:06 +0000458 st.qdisc_stats.maxpacket = q->cstats.maxpacket;
459 st.qdisc_stats.drop_overlimit = q->drop_overlimit;
460 st.qdisc_stats.ecn_mark = q->cstats.ecn_mark;
461 st.qdisc_stats.new_flow_count = q->new_flow_count;
462
Eric Dumazet4b549a22012-05-11 09:30:50 +0000463 list_for_each(pos, &q->new_flows)
464 st.qdisc_stats.new_flows_len++;
465
466 list_for_each(pos, &q->old_flows)
467 st.qdisc_stats.old_flows_len++;
468
469 return gnet_stats_copy_app(d, &st, sizeof(st));
470}
471
472static struct Qdisc *fq_codel_leaf(struct Qdisc *sch, unsigned long arg)
473{
474 return NULL;
475}
476
477static unsigned long fq_codel_get(struct Qdisc *sch, u32 classid)
478{
479 return 0;
480}
481
482static unsigned long fq_codel_bind(struct Qdisc *sch, unsigned long parent,
483 u32 classid)
484{
485 /* we cannot bypass queue discipline anymore */
486 sch->flags &= ~TCQ_F_CAN_BYPASS;
487 return 0;
488}
489
490static void fq_codel_put(struct Qdisc *q, unsigned long cl)
491{
492}
493
John Fastabend25d8c0d2014-09-12 20:05:27 -0700494static struct tcf_proto __rcu **fq_codel_find_tcf(struct Qdisc *sch,
495 unsigned long cl)
Eric Dumazet4b549a22012-05-11 09:30:50 +0000496{
497 struct fq_codel_sched_data *q = qdisc_priv(sch);
498
499 if (cl)
500 return NULL;
501 return &q->filter_list;
502}
503
504static int fq_codel_dump_class(struct Qdisc *sch, unsigned long cl,
505 struct sk_buff *skb, struct tcmsg *tcm)
506{
507 tcm->tcm_handle |= TC_H_MIN(cl);
508 return 0;
509}
510
511static int fq_codel_dump_class_stats(struct Qdisc *sch, unsigned long cl,
512 struct gnet_dump *d)
513{
514 struct fq_codel_sched_data *q = qdisc_priv(sch);
515 u32 idx = cl - 1;
516 struct gnet_stats_queue qs = { 0 };
517 struct tc_fq_codel_xstats xstats;
518
519 if (idx < q->flows_cnt) {
520 const struct fq_codel_flow *flow = &q->flows[idx];
521 const struct sk_buff *skb = flow->head;
522
523 memset(&xstats, 0, sizeof(xstats));
524 xstats.type = TCA_FQ_CODEL_XSTATS_CLASS;
525 xstats.class_stats.deficit = flow->deficit;
526 xstats.class_stats.ldelay =
527 codel_time_to_us(flow->cvars.ldelay);
528 xstats.class_stats.count = flow->cvars.count;
529 xstats.class_stats.lastcount = flow->cvars.lastcount;
530 xstats.class_stats.dropping = flow->cvars.dropping;
531 if (flow->cvars.dropping) {
532 codel_tdiff_t delta = flow->cvars.drop_next -
533 codel_get_time();
534
535 xstats.class_stats.drop_next = (delta >= 0) ?
536 codel_time_to_us(delta) :
537 -codel_time_to_us(-delta);
538 }
539 while (skb) {
540 qs.qlen++;
541 skb = skb->next;
542 }
543 qs.backlog = q->backlogs[idx];
544 qs.drops = flow->dropped;
545 }
John Fastabendb0ab6f92014-09-28 11:54:24 -0700546 if (gnet_stats_copy_queue(d, NULL, &qs, 0) < 0)
Eric Dumazet4b549a22012-05-11 09:30:50 +0000547 return -1;
548 if (idx < q->flows_cnt)
549 return gnet_stats_copy_app(d, &xstats, sizeof(xstats));
550 return 0;
551}
552
553static void fq_codel_walk(struct Qdisc *sch, struct qdisc_walker *arg)
554{
555 struct fq_codel_sched_data *q = qdisc_priv(sch);
556 unsigned int i;
557
558 if (arg->stop)
559 return;
560
561 for (i = 0; i < q->flows_cnt; i++) {
562 if (list_empty(&q->flows[i].flowchain) ||
563 arg->count < arg->skip) {
564 arg->count++;
565 continue;
566 }
567 if (arg->fn(sch, i + 1, arg) < 0) {
568 arg->stop = 1;
569 break;
570 }
571 arg->count++;
572 }
573}
574
575static const struct Qdisc_class_ops fq_codel_class_ops = {
576 .leaf = fq_codel_leaf,
577 .get = fq_codel_get,
578 .put = fq_codel_put,
579 .tcf_chain = fq_codel_find_tcf,
580 .bind_tcf = fq_codel_bind,
581 .unbind_tcf = fq_codel_put,
582 .dump = fq_codel_dump_class,
583 .dump_stats = fq_codel_dump_class_stats,
584 .walk = fq_codel_walk,
585};
586
587static struct Qdisc_ops fq_codel_qdisc_ops __read_mostly = {
588 .cl_ops = &fq_codel_class_ops,
589 .id = "fq_codel",
590 .priv_size = sizeof(struct fq_codel_sched_data),
591 .enqueue = fq_codel_enqueue,
592 .dequeue = fq_codel_dequeue,
593 .peek = qdisc_peek_dequeued,
594 .drop = fq_codel_drop,
595 .init = fq_codel_init,
596 .reset = fq_codel_reset,
597 .destroy = fq_codel_destroy,
598 .change = fq_codel_change,
599 .dump = fq_codel_dump,
600 .dump_stats = fq_codel_dump_stats,
601 .owner = THIS_MODULE,
602};
603
604static int __init fq_codel_module_init(void)
605{
606 return register_qdisc(&fq_codel_qdisc_ops);
607}
608
609static void __exit fq_codel_module_exit(void)
610{
611 unregister_qdisc(&fq_codel_qdisc_ops);
612}
613
614module_init(fq_codel_module_init)
615module_exit(fq_codel_module_exit)
616MODULE_AUTHOR("Eric Dumazet");
617MODULE_LICENSE("GPL");