blob: ef6017c93d4f2e12ac2d3ca8b5ca660991f6f93d [file] [log] [blame]
yuezonghe824eb0c2024-06-27 02:32:26 -07001/*
2 * net/sched/sch_sfb.c Stochastic Fair Blue
3 *
4 * Copyright (c) 2008-2011 Juliusz Chroboczek <jch@pps.jussieu.fr>
5 * Copyright (c) 2011 Eric Dumazet <eric.dumazet@gmail.com>
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * version 2 as published by the Free Software Foundation.
10 *
11 * W. Feng, D. Kandlur, D. Saha, K. Shin. Blue:
12 * A New Class of Active Queue Management Algorithms.
13 * U. Michigan CSE-TR-387-99, April 1999.
14 *
15 * http://www.thefengs.com/wuchang/blue/CSE-TR-387-99.pdf
16 *
17 */
18
19#include <linux/module.h>
20#include <linux/types.h>
21#include <linux/kernel.h>
22#include <linux/errno.h>
23#include <linux/skbuff.h>
24#include <linux/random.h>
25#include <linux/jhash.h>
26#include <net/ip.h>
27#include <net/pkt_sched.h>
28#include <net/inet_ecn.h>
29#include <net/flow_keys.h>
30
31/*
32 * SFB uses two B[l][n] : L x N arrays of bins (L levels, N bins per level)
33 * This implementation uses L = 8 and N = 16
34 * This permits us to split one 32bit hash (provided per packet by rxhash or
35 * external classifier) into 8 subhashes of 4 bits.
36 */
37#define SFB_BUCKET_SHIFT 4
38#define SFB_NUMBUCKETS (1 << SFB_BUCKET_SHIFT) /* N bins per Level */
39#define SFB_BUCKET_MASK (SFB_NUMBUCKETS - 1)
40#define SFB_LEVELS (32 / SFB_BUCKET_SHIFT) /* L */
41
42/* SFB algo uses a virtual queue, named "bin" */
43struct sfb_bucket {
44 u16 qlen; /* length of virtual queue */
45 u16 p_mark; /* marking probability */
46};
47
48/* We use a double buffering right before hash change
49 * (Section 4.4 of SFB reference : moving hash functions)
50 */
51struct sfb_bins {
52 u32 perturbation; /* jhash perturbation */
53 struct sfb_bucket bins[SFB_LEVELS][SFB_NUMBUCKETS];
54};
55
56struct sfb_sched_data {
57 struct Qdisc *qdisc;
58 struct tcf_proto *filter_list;
59 unsigned long rehash_interval;
60 unsigned long warmup_time; /* double buffering warmup time in jiffies */
61 u32 max;
62 u32 bin_size; /* maximum queue length per bin */
63 u32 increment; /* d1 */
64 u32 decrement; /* d2 */
65 u32 limit; /* HARD maximal queue length */
66 u32 penalty_rate;
67 u32 penalty_burst;
68 u32 tokens_avail;
69 unsigned long rehash_time;
70 unsigned long token_time;
71
72 u8 slot; /* current active bins (0 or 1) */
73 bool double_buffering;
74 struct sfb_bins bins[2];
75
76 struct {
77 u32 earlydrop;
78 u32 penaltydrop;
79 u32 bucketdrop;
80 u32 queuedrop;
81 u32 childdrop; /* drops in child qdisc */
82 u32 marked; /* ECN mark */
83 } stats;
84};
85
86/*
87 * Each queued skb might be hashed on one or two bins
88 * We store in skb_cb the two hash values.
89 * (A zero value means double buffering was not used)
90 */
91struct sfb_skb_cb {
92 u32 hashes[2];
93};
94
95static inline struct sfb_skb_cb *sfb_skb_cb(const struct sk_buff *skb)
96{
97 qdisc_cb_private_validate(skb, sizeof(struct sfb_skb_cb));
98 return (struct sfb_skb_cb *)qdisc_skb_cb(skb)->data;
99}
100
101/*
102 * If using 'internal' SFB flow classifier, hash comes from skb rxhash
103 * If using external classifier, hash comes from the classid.
104 */
105static u32 sfb_hash(const struct sk_buff *skb, u32 slot)
106{
107 return sfb_skb_cb(skb)->hashes[slot];
108}
109
110/* Probabilities are coded as Q0.16 fixed-point values,
111 * with 0xFFFF representing 65535/65536 (almost 1.0)
112 * Addition and subtraction are saturating in [0, 65535]
113 */
114static u32 prob_plus(u32 p1, u32 p2)
115{
116 u32 res = p1 + p2;
117
118 return min_t(u32, res, SFB_MAX_PROB);
119}
120
121static u32 prob_minus(u32 p1, u32 p2)
122{
123 return p1 > p2 ? p1 - p2 : 0;
124}
125
126static void increment_one_qlen(u32 sfbhash, u32 slot, struct sfb_sched_data *q)
127{
128 int i;
129 struct sfb_bucket *b = &q->bins[slot].bins[0][0];
130
131 for (i = 0; i < SFB_LEVELS; i++) {
132 u32 hash = sfbhash & SFB_BUCKET_MASK;
133
134 sfbhash >>= SFB_BUCKET_SHIFT;
135 if (b[hash].qlen < 0xFFFF)
136 b[hash].qlen++;
137 b += SFB_NUMBUCKETS; /* next level */
138 }
139}
140
141#ifdef CVE_SECURITY//CVE-2022-3586
142static void increment_qlen(const struct sfb_skb_cb *cb, struct sfb_sched_data *q)
143{
144 u32 sfbhash;
145
146 sfbhash = cb->hashes[0];
147 if (sfbhash)
148 increment_one_qlen(sfbhash, 0, q);
149
150 sfbhash = cb->hashes[1];
151 if (sfbhash)
152 increment_one_qlen(sfbhash, 1, q);
153}
154#else
155static void increment_qlen(const struct sk_buff *skb, struct sfb_sched_data *q)
156{
157 u32 sfbhash;
158
159 sfbhash = sfb_hash(skb, 0);
160 if (sfbhash)
161 increment_one_qlen(sfbhash, 0, q);
162
163 sfbhash = sfb_hash(skb, 1);
164 if (sfbhash)
165 increment_one_qlen(sfbhash, 1, q);
166}
167#endif
168static void decrement_one_qlen(u32 sfbhash, u32 slot,
169 struct sfb_sched_data *q)
170{
171 int i;
172 struct sfb_bucket *b = &q->bins[slot].bins[0][0];
173
174 for (i = 0; i < SFB_LEVELS; i++) {
175 u32 hash = sfbhash & SFB_BUCKET_MASK;
176
177 sfbhash >>= SFB_BUCKET_SHIFT;
178 if (b[hash].qlen > 0)
179 b[hash].qlen--;
180 b += SFB_NUMBUCKETS; /* next level */
181 }
182}
183
184static void decrement_qlen(const struct sk_buff *skb, struct sfb_sched_data *q)
185{
186 u32 sfbhash;
187
188 sfbhash = sfb_hash(skb, 0);
189 if (sfbhash)
190 decrement_one_qlen(sfbhash, 0, q);
191
192 sfbhash = sfb_hash(skb, 1);
193 if (sfbhash)
194 decrement_one_qlen(sfbhash, 1, q);
195}
196
197static void decrement_prob(struct sfb_bucket *b, struct sfb_sched_data *q)
198{
199 b->p_mark = prob_minus(b->p_mark, q->decrement);
200}
201
202static void increment_prob(struct sfb_bucket *b, struct sfb_sched_data *q)
203{
204 b->p_mark = prob_plus(b->p_mark, q->increment);
205}
206
207static void sfb_zero_all_buckets(struct sfb_sched_data *q)
208{
209 memset(&q->bins, 0, sizeof(q->bins));
210}
211
212/*
213 * compute max qlen, max p_mark, and avg p_mark
214 */
215static u32 sfb_compute_qlen(u32 *prob_r, u32 *avgpm_r, const struct sfb_sched_data *q)
216{
217 int i;
218 u32 qlen = 0, prob = 0, totalpm = 0;
219 const struct sfb_bucket *b = &q->bins[q->slot].bins[0][0];
220
221 for (i = 0; i < SFB_LEVELS * SFB_NUMBUCKETS; i++) {
222 if (qlen < b->qlen)
223 qlen = b->qlen;
224 totalpm += b->p_mark;
225 if (prob < b->p_mark)
226 prob = b->p_mark;
227 b++;
228 }
229 *prob_r = prob;
230 *avgpm_r = totalpm / (SFB_LEVELS * SFB_NUMBUCKETS);
231 return qlen;
232}
233
234
235static void sfb_init_perturbation(u32 slot, struct sfb_sched_data *q)
236{
237 q->bins[slot].perturbation = net_random();
238}
239
240static void sfb_swap_slot(struct sfb_sched_data *q)
241{
242 sfb_init_perturbation(q->slot, q);
243 q->slot ^= 1;
244 q->double_buffering = false;
245}
246
247/* Non elastic flows are allowed to use part of the bandwidth, expressed
248 * in "penalty_rate" packets per second, with "penalty_burst" burst
249 */
250static bool sfb_rate_limit(struct sk_buff *skb, struct sfb_sched_data *q)
251{
252 if (q->penalty_rate == 0 || q->penalty_burst == 0)
253 return true;
254
255 if (q->tokens_avail < 1) {
256 unsigned long age = min(10UL * HZ, jiffies - q->token_time);
257
258 q->tokens_avail = (age * q->penalty_rate) / HZ;
259 if (q->tokens_avail > q->penalty_burst)
260 q->tokens_avail = q->penalty_burst;
261 q->token_time = jiffies;
262 if (q->tokens_avail < 1)
263 return true;
264 }
265
266 q->tokens_avail--;
267 return false;
268}
269
270static bool sfb_classify(struct sk_buff *skb, struct sfb_sched_data *q,
271 int *qerr, u32 *salt)
272{
273 struct tcf_result res;
274 int result;
275
276 result = tc_classify(skb, q->filter_list, &res);
277 if (result >= 0) {
278#ifdef CONFIG_NET_CLS_ACT
279 switch (result) {
280 case TC_ACT_STOLEN:
281 case TC_ACT_QUEUED:
282 *qerr = NET_XMIT_SUCCESS | __NET_XMIT_STOLEN;
283 case TC_ACT_SHOT:
284 return false;
285 }
286#endif
287 *salt = TC_H_MIN(res.classid);
288 return true;
289 }
290 return false;
291}
292
293static int sfb_enqueue(struct sk_buff *skb, struct Qdisc *sch)
294{
295
296 struct sfb_sched_data *q = qdisc_priv(sch);
297 struct Qdisc *child = q->qdisc;
298 int i;
299 u32 p_min = ~0;
300 u32 minqlen = ~0;
301 u32 r, slot, salt, sfbhash;
302 int ret = NET_XMIT_SUCCESS | __NET_XMIT_BYPASS;
303 struct flow_keys keys;
304
305 if (unlikely(sch->q.qlen >= q->limit)) {
306 sch->qstats.overlimits++;
307 q->stats.queuedrop++;
308 goto drop;
309 }
310
311 if (q->rehash_interval > 0) {
312 unsigned long limit = q->rehash_time + q->rehash_interval;
313
314 if (unlikely(time_after(jiffies, limit))) {
315 sfb_swap_slot(q);
316 q->rehash_time = jiffies;
317 } else if (unlikely(!q->double_buffering && q->warmup_time > 0 &&
318 time_after(jiffies, limit - q->warmup_time))) {
319 q->double_buffering = true;
320 }
321 }
322
323 if (q->filter_list) {
324 /* If using external classifiers, get result and record it. */
325 if (!sfb_classify(skb, q, &ret, &salt))
326 goto other_drop;
327 keys.src = salt;
328 keys.dst = 0;
329 keys.ports = 0;
330 } else {
331 skb_flow_dissect(skb, &keys);
332 }
333
334 slot = q->slot;
335
336 sfbhash = jhash_3words((__force u32)keys.dst,
337 (__force u32)keys.src,
338 (__force u32)keys.ports,
339 q->bins[slot].perturbation);
340 if (!sfbhash)
341 sfbhash = 1;
342 sfb_skb_cb(skb)->hashes[slot] = sfbhash;
343
344 for (i = 0; i < SFB_LEVELS; i++) {
345 u32 hash = sfbhash & SFB_BUCKET_MASK;
346 struct sfb_bucket *b = &q->bins[slot].bins[i][hash];
347
348 sfbhash >>= SFB_BUCKET_SHIFT;
349 if (b->qlen == 0)
350 decrement_prob(b, q);
351 else if (b->qlen >= q->bin_size)
352 increment_prob(b, q);
353 if (minqlen > b->qlen)
354 minqlen = b->qlen;
355 if (p_min > b->p_mark)
356 p_min = b->p_mark;
357 }
358
359 slot ^= 1;
360 sfb_skb_cb(skb)->hashes[slot] = 0;
361
362 if (unlikely(minqlen >= q->max)) {
363 sch->qstats.overlimits++;
364 q->stats.bucketdrop++;
365 goto drop;
366 }
367
368 if (unlikely(p_min >= SFB_MAX_PROB)) {
369 /* Inelastic flow */
370 if (q->double_buffering) {
371 sfbhash = jhash_3words((__force u32)keys.dst,
372 (__force u32)keys.src,
373 (__force u32)keys.ports,
374 q->bins[slot].perturbation);
375 if (!sfbhash)
376 sfbhash = 1;
377 sfb_skb_cb(skb)->hashes[slot] = sfbhash;
378
379 for (i = 0; i < SFB_LEVELS; i++) {
380 u32 hash = sfbhash & SFB_BUCKET_MASK;
381 struct sfb_bucket *b = &q->bins[slot].bins[i][hash];
382
383 sfbhash >>= SFB_BUCKET_SHIFT;
384 if (b->qlen == 0)
385 decrement_prob(b, q);
386 else if (b->qlen >= q->bin_size)
387 increment_prob(b, q);
388 }
389 }
390 if (sfb_rate_limit(skb, q)) {
391 sch->qstats.overlimits++;
392 q->stats.penaltydrop++;
393 goto drop;
394 }
395 goto enqueue;
396 }
397
398 r = net_random() & SFB_MAX_PROB;
399
400 if (unlikely(r < p_min)) {
401 if (unlikely(p_min > SFB_MAX_PROB / 2)) {
402 /* If we're marking that many packets, then either
403 * this flow is unresponsive, or we're badly congested.
404 * In either case, we want to start dropping packets.
405 */
406 if (r < (p_min - SFB_MAX_PROB / 2) * 2) {
407 q->stats.earlydrop++;
408 goto drop;
409 }
410 }
411 if (INET_ECN_set_ce(skb)) {
412 q->stats.marked++;
413 } else {
414 q->stats.earlydrop++;
415 goto drop;
416 }
417 }
418
419enqueue:
420#ifdef CVE_SECURITY//CVE-2022-3586
421 struct sfb_skb_cb cb;
422 memcpy(&cb, sfb_skb_cb(skb), sizeof(cb));
423#endif
424 ret = qdisc_enqueue(skb, child);
425 if (likely(ret == NET_XMIT_SUCCESS)) {
426 sch->q.qlen++;
427#ifdef CVE_SECURITY//CVE-2022-3586
428 increment_qlen(&cb, q);
429#else
430 increment_qlen(skb, q);
431#endif
432 } else if (net_xmit_drop_count(ret)) {
433 q->stats.childdrop++;
434 sch->qstats.drops++;
435 }
436 return ret;
437
438drop:
439 qdisc_drop(skb, sch);
440 return NET_XMIT_CN;
441other_drop:
442 if (ret & __NET_XMIT_BYPASS)
443 sch->qstats.drops++;
444 kfree_skb(skb);
445 return ret;
446}
447
448static struct sk_buff *sfb_dequeue(struct Qdisc *sch)
449{
450 struct sfb_sched_data *q = qdisc_priv(sch);
451 struct Qdisc *child = q->qdisc;
452 struct sk_buff *skb;
453
454 skb = child->dequeue(q->qdisc);
455
456 if (skb) {
457 qdisc_bstats_update(sch, skb);
458 sch->q.qlen--;
459 decrement_qlen(skb, q);
460 }
461
462 return skb;
463}
464
465static struct sk_buff *sfb_peek(struct Qdisc *sch)
466{
467 struct sfb_sched_data *q = qdisc_priv(sch);
468 struct Qdisc *child = q->qdisc;
469
470 return child->ops->peek(child);
471}
472
473/* No sfb_drop -- impossible since the child doesn't return the dropped skb. */
474
475static void sfb_reset(struct Qdisc *sch)
476{
477 struct sfb_sched_data *q = qdisc_priv(sch);
478
479 qdisc_reset(q->qdisc);
480 sch->q.qlen = 0;
481 q->slot = 0;
482 q->double_buffering = false;
483 sfb_zero_all_buckets(q);
484 sfb_init_perturbation(0, q);
485}
486
487static void sfb_destroy(struct Qdisc *sch)
488{
489 struct sfb_sched_data *q = qdisc_priv(sch);
490
491 tcf_destroy_chain(&q->filter_list);
492 qdisc_destroy(q->qdisc);
493}
494
495static const struct nla_policy sfb_policy[TCA_SFB_MAX + 1] = {
496 [TCA_SFB_PARMS] = { .len = sizeof(struct tc_sfb_qopt) },
497};
498
499static const struct tc_sfb_qopt sfb_default_ops = {
500 .rehash_interval = 600 * MSEC_PER_SEC,
501 .warmup_time = 60 * MSEC_PER_SEC,
502 .limit = 0,
503 .max = 25,
504 .bin_size = 20,
505 .increment = (SFB_MAX_PROB + 500) / 1000, /* 0.1 % */
506 .decrement = (SFB_MAX_PROB + 3000) / 6000,
507 .penalty_rate = 10,
508 .penalty_burst = 20,
509};
510
511static int sfb_change(struct Qdisc *sch, struct nlattr *opt)
512{
513 struct sfb_sched_data *q = qdisc_priv(sch);
514 struct Qdisc *child;
515 struct nlattr *tb[TCA_SFB_MAX + 1];
516 const struct tc_sfb_qopt *ctl = &sfb_default_ops;
517 u32 limit;
518 int err;
519
520 if (opt) {
521 err = nla_parse_nested(tb, TCA_SFB_MAX, opt, sfb_policy);
522 if (err < 0)
523 return -EINVAL;
524
525 if (tb[TCA_SFB_PARMS] == NULL)
526 return -EINVAL;
527
528 ctl = nla_data(tb[TCA_SFB_PARMS]);
529 }
530
531 limit = ctl->limit;
532 if (limit == 0)
533 limit = max_t(u32, qdisc_dev(sch)->tx_queue_len, 1);
534
535 child = fifo_create_dflt(sch, &pfifo_qdisc_ops, limit);
536 if (IS_ERR(child))
537 return PTR_ERR(child);
538
539 sch_tree_lock(sch);
540
541 qdisc_tree_decrease_qlen(q->qdisc, q->qdisc->q.qlen);
542 qdisc_destroy(q->qdisc);
543 q->qdisc = child;
544
545 q->rehash_interval = msecs_to_jiffies(ctl->rehash_interval);
546 q->warmup_time = msecs_to_jiffies(ctl->warmup_time);
547 q->rehash_time = jiffies;
548 q->limit = limit;
549 q->increment = ctl->increment;
550 q->decrement = ctl->decrement;
551 q->max = ctl->max;
552 q->bin_size = ctl->bin_size;
553 q->penalty_rate = ctl->penalty_rate;
554 q->penalty_burst = ctl->penalty_burst;
555 q->tokens_avail = ctl->penalty_burst;
556 q->token_time = jiffies;
557
558 q->slot = 0;
559 q->double_buffering = false;
560 sfb_zero_all_buckets(q);
561 sfb_init_perturbation(0, q);
562 sfb_init_perturbation(1, q);
563
564 sch_tree_unlock(sch);
565
566 return 0;
567}
568
569static int sfb_init(struct Qdisc *sch, struct nlattr *opt)
570{
571 struct sfb_sched_data *q = qdisc_priv(sch);
572
573 q->qdisc = &noop_qdisc;
574 return sfb_change(sch, opt);
575}
576
577static int sfb_dump(struct Qdisc *sch, struct sk_buff *skb)
578{
579 struct sfb_sched_data *q = qdisc_priv(sch);
580 struct nlattr *opts;
581 struct tc_sfb_qopt opt = {
582 .rehash_interval = jiffies_to_msecs(q->rehash_interval),
583 .warmup_time = jiffies_to_msecs(q->warmup_time),
584 .limit = q->limit,
585 .max = q->max,
586 .bin_size = q->bin_size,
587 .increment = q->increment,
588 .decrement = q->decrement,
589 .penalty_rate = q->penalty_rate,
590 .penalty_burst = q->penalty_burst,
591 };
592
593 sch->qstats.backlog = q->qdisc->qstats.backlog;
594 opts = nla_nest_start(skb, TCA_OPTIONS);
595 if (opts == NULL)
596 goto nla_put_failure;
597 NLA_PUT(skb, TCA_SFB_PARMS, sizeof(opt), &opt);
598 return nla_nest_end(skb, opts);
599
600nla_put_failure:
601 nla_nest_cancel(skb, opts);
602 return -EMSGSIZE;
603}
604
605static int sfb_dump_stats(struct Qdisc *sch, struct gnet_dump *d)
606{
607 struct sfb_sched_data *q = qdisc_priv(sch);
608 struct tc_sfb_xstats st = {
609 .earlydrop = q->stats.earlydrop,
610 .penaltydrop = q->stats.penaltydrop,
611 .bucketdrop = q->stats.bucketdrop,
612 .queuedrop = q->stats.queuedrop,
613 .childdrop = q->stats.childdrop,
614 .marked = q->stats.marked,
615 };
616
617 st.maxqlen = sfb_compute_qlen(&st.maxprob, &st.avgprob, q);
618
619 return gnet_stats_copy_app(d, &st, sizeof(st));
620}
621
622static int sfb_dump_class(struct Qdisc *sch, unsigned long cl,
623 struct sk_buff *skb, struct tcmsg *tcm)
624{
625 return -ENOSYS;
626}
627
628static int sfb_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new,
629 struct Qdisc **old)
630{
631 struct sfb_sched_data *q = qdisc_priv(sch);
632
633 if (new == NULL)
634 new = &noop_qdisc;
635
636 sch_tree_lock(sch);
637 *old = q->qdisc;
638 q->qdisc = new;
639 qdisc_tree_decrease_qlen(*old, (*old)->q.qlen);
640 qdisc_reset(*old);
641 sch_tree_unlock(sch);
642 return 0;
643}
644
645static struct Qdisc *sfb_leaf(struct Qdisc *sch, unsigned long arg)
646{
647 struct sfb_sched_data *q = qdisc_priv(sch);
648
649 return q->qdisc;
650}
651
652static unsigned long sfb_get(struct Qdisc *sch, u32 classid)
653{
654 return 1;
655}
656
657static void sfb_put(struct Qdisc *sch, unsigned long arg)
658{
659}
660
661static int sfb_change_class(struct Qdisc *sch, u32 classid, u32 parentid,
662 struct nlattr **tca, unsigned long *arg)
663{
664 return -ENOSYS;
665}
666
667static int sfb_delete(struct Qdisc *sch, unsigned long cl)
668{
669 return -ENOSYS;
670}
671
672static void sfb_walk(struct Qdisc *sch, struct qdisc_walker *walker)
673{
674 if (!walker->stop) {
675 if (walker->count >= walker->skip)
676 if (walker->fn(sch, 1, walker) < 0) {
677 walker->stop = 1;
678 return;
679 }
680 walker->count++;
681 }
682}
683
684static struct tcf_proto **sfb_find_tcf(struct Qdisc *sch, unsigned long cl)
685{
686 struct sfb_sched_data *q = qdisc_priv(sch);
687
688 if (cl)
689 return NULL;
690 return &q->filter_list;
691}
692
693static unsigned long sfb_bind(struct Qdisc *sch, unsigned long parent,
694 u32 classid)
695{
696 return 0;
697}
698
699
700static const struct Qdisc_class_ops sfb_class_ops = {
701 .graft = sfb_graft,
702 .leaf = sfb_leaf,
703 .get = sfb_get,
704 .put = sfb_put,
705 .change = sfb_change_class,
706 .delete = sfb_delete,
707 .walk = sfb_walk,
708 .tcf_chain = sfb_find_tcf,
709 .bind_tcf = sfb_bind,
710 .unbind_tcf = sfb_put,
711 .dump = sfb_dump_class,
712};
713
714static struct Qdisc_ops sfb_qdisc_ops __read_mostly = {
715 .id = "sfb",
716 .priv_size = sizeof(struct sfb_sched_data),
717 .cl_ops = &sfb_class_ops,
718 .enqueue = sfb_enqueue,
719 .dequeue = sfb_dequeue,
720 .peek = sfb_peek,
721 .init = sfb_init,
722 .reset = sfb_reset,
723 .destroy = sfb_destroy,
724 .change = sfb_change,
725 .dump = sfb_dump,
726 .dump_stats = sfb_dump_stats,
727 .owner = THIS_MODULE,
728};
729
730static int __init sfb_module_init(void)
731{
732 return register_qdisc(&sfb_qdisc_ops);
733}
734
735static void __exit sfb_module_exit(void)
736{
737 unregister_qdisc(&sfb_qdisc_ops);
738}
739
740module_init(sfb_module_init)
741module_exit(sfb_module_exit)
742
743MODULE_DESCRIPTION("Stochastic Fair Blue queue discipline");
744MODULE_AUTHOR("Juliusz Chroboczek");
745MODULE_AUTHOR("Eric Dumazet");
746MODULE_LICENSE("GPL");