1 diff -Naur linux-2.6.21.5.orig/include/linux/pkt_sched.h linux-2.6.21.5/include/linux/pkt_sched.h
2 --- linux-2.6.21.5.orig/include/linux/pkt_sched.h 2007-06-11 11:37:06.000000000 -0700
3 +++ linux-2.6.21.5/include/linux/pkt_sched.h 2007-06-22 22:53:46.000000000 -0700
6 * The only reason for this is efficiency, it is possible
7 * to change these parameters in compile time.
9 + * If you need to play with these values, use esfq instead.
17 + TCA_SFQ_HASH_CLASSIC,
20 + TCA_SFQ_HASH_FWMARK,
22 + TCA_SFQ_HASH_CTORIGDST,
23 + TCA_SFQ_HASH_CTORIGSRC,
24 + TCA_SFQ_HASH_CTREPLDST,
25 + TCA_SFQ_HASH_CTREPLSRC,
26 + TCA_SFQ_HASH_CTNATCHG,
31 + unsigned quantum; /* Bytes per round allocated to flow */
32 + int perturb_period; /* Period of hash perturbation */
33 + __u32 limit; /* Maximal packets in queue */
34 + unsigned divisor; /* Hash divisor */
35 + unsigned flows; /* Maximal number of flows */
36 + unsigned hash_kind; /* Hash function to use for flow identification */
42 diff -Naur linux-2.6.21.5.orig/net/sched/Kconfig linux-2.6.21.5/net/sched/Kconfig
43 --- linux-2.6.21.5.orig/net/sched/Kconfig 2007-06-11 11:37:06.000000000 -0700
44 +++ linux-2.6.21.5/net/sched/Kconfig 2007-06-23 14:11:02.000000000 -0700
46 To compile this code as a module, choose M here: the
47 module will be called sch_sfq.
50 + tristate "Enhanced Stochastic Fairness Queueing (ESFQ)"
52 + Say Y here if you want to use the Enhanced Stochastic Fairness
53 + Queueing (ESFQ) packet scheduling algorithm for some of your network
54 + devices or as a leaf discipline for a classful qdisc such as HTB or
55 + CBQ (see the top of <file:net/sched/sch_esfq.c> for details and
56 + references to the SFQ algorithm).
58 + This is an enchanced SFQ version which allows you to control some
59 + hardcoded values in the SFQ scheduler.
61 + ESFQ also adds control of the hash function used to identify packet
62 + flows. The original SFQ discipline hashes by connection; ESFQ add
63 + several other hashing methods, such as by src IP or by dst IP, which
64 + can be more fair to users in some networking situations.
66 + To compile this code as a module, choose M here: the
67 + module will be called sch_esfq.
69 +config NET_SCH_ESFQ_NFCT
70 + bool "Connection Tracking Hash Types"
71 + depends on NET_SCH_ESFQ && NF_CONNTRACK
73 + Say Y here to enable support for hashing based on netfilter connection
74 + tracking information. This is useful for a router that is also using
75 + NAT to connect privately-addressed hosts to the Internet. If you want
76 + to provide fair distribution of upstream bandwidth, ESFQ must use
77 + connection tracking information, since all outgoing packets will share
78 + the same source address.
81 tristate "True Link Equalizer (TEQL)"
83 diff -Naur linux-2.6.21.5.orig/net/sched/Makefile linux-2.6.21.5/net/sched/Makefile
84 --- linux-2.6.21.5.orig/net/sched/Makefile 2007-06-11 11:37:06.000000000 -0700
85 +++ linux-2.6.21.5/net/sched/Makefile 2007-06-22 22:53:46.000000000 -0700
87 obj-$(CONFIG_NET_SCH_INGRESS) += sch_ingress.o
88 obj-$(CONFIG_NET_SCH_DSMARK) += sch_dsmark.o
89 obj-$(CONFIG_NET_SCH_SFQ) += sch_sfq.o
90 +obj-$(CONFIG_NET_SCH_ESFQ) += sch_esfq.o
91 obj-$(CONFIG_NET_SCH_TBF) += sch_tbf.o
92 obj-$(CONFIG_NET_SCH_TEQL) += sch_teql.o
93 obj-$(CONFIG_NET_SCH_PRIO) += sch_prio.o
94 diff -Naur linux-2.6.21.5.orig/net/sched/sch_esfq.c linux-2.6.21.5/net/sched/sch_esfq.c
95 --- linux-2.6.21.5.orig/net/sched/sch_esfq.c 1969-12-31 16:00:00.000000000 -0800
96 +++ linux-2.6.21.5/net/sched/sch_esfq.c 2007-06-23 19:18:00.000000000 -0700
99 + * net/sched/sch_esfq.c Extended Stochastic Fairness Queueing discipline.
101 + * This program is free software; you can redistribute it and/or
102 + * modify it under the terms of the GNU General Public License
103 + * as published by the Free Software Foundation; either version
104 + * 2 of the License, or (at your option) any later version.
106 + * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
108 + * Changes: Alexander Atanasov, <alex@ssi.bg>
109 + * Added dynamic depth,limit,divisor,hash_kind options.
110 + * Added dst and src hashes.
112 + * Alexander Clouter, <alex@digriz.org.uk>
113 + * Ported ESFQ to Linux 2.6.
115 + * Corey Hickey, <bugfood-c@fatooh.org>
116 + * Maintenance of the Linux 2.6 port.
117 + * Added fwmark hash (thanks to Robert Kurjata).
118 + * Added usage of jhash.
119 + * Added conntrack support.
120 + * Added ctnatchg hash (thanks to Ben Pfountz).
123 +#include <linux/module.h>
124 +#include <asm/uaccess.h>
125 +#include <asm/system.h>
126 +#include <linux/bitops.h>
127 +#include <linux/types.h>
128 +#include <linux/kernel.h>
129 +#include <linux/jiffies.h>
130 +#include <linux/string.h>
131 +#include <linux/mm.h>
132 +#include <linux/socket.h>
133 +#include <linux/sockios.h>
134 +#include <linux/in.h>
135 +#include <linux/errno.h>
136 +#include <linux/interrupt.h>
137 +#include <linux/if_ether.h>
138 +#include <linux/inet.h>
139 +#include <linux/netdevice.h>
140 +#include <linux/etherdevice.h>
141 +#include <linux/notifier.h>
142 +#include <linux/init.h>
144 +#include <linux/ipv6.h>
145 +#include <net/route.h>
146 +#include <linux/skbuff.h>
147 +#include <net/sock.h>
148 +#include <net/pkt_sched.h>
149 +#include <linux/jhash.h>
150 +#include <net/netfilter/nf_conntrack.h>
152 +/* Stochastic Fairness Queuing algorithm.
153 + For more comments look at sch_sfq.c.
154 + The difference is that you can change limit, depth,
155 + hash table size and choose alternate hash types.
157 + classic: same as in sch_sfq.c
158 + dst: destination IP address
159 + src: source IP address
160 + fwmark: netfilter mark value
161 + ctorigdst: original destination IP address
162 + ctorigsrc: original source IP address
163 + ctrepldst: reply destination IP address
164 + ctreplsrc: reply source IP
171 +/* This type should contain at least SFQ_DEPTH*2 values */
172 +typedef unsigned int esfq_index;
180 +struct esfq_sched_data
183 + int perturb_period;
184 + unsigned quantum; /* Allotment per round: MUST BE >= MTU */
187 + unsigned hash_divisor;
188 + unsigned hash_kind;
190 + struct timer_list perturb_timer;
192 + esfq_index tail; /* Index of current slot in round */
193 + esfq_index max_depth; /* Maximal depth */
195 + esfq_index *ht; /* Hash table */
196 + esfq_index *next; /* Active slots link */
197 + short *allot; /* Current allotment per slot */
198 + unsigned short *hash; /* Hash value indexed by slots */
199 + struct sk_buff_head *qs; /* Slot queue */
200 + struct esfq_head *dep; /* Linked list of slots, indexed by depth */
203 +/* This contains the info we will hash. */
204 +struct esfq_packet_info
206 + u32 proto; /* protocol or port */
207 + u32 src; /* source from packet header */
208 + u32 dst; /* destination from packet header */
209 + u32 ctorigsrc; /* original source from conntrack */
210 + u32 ctorigdst; /* original destination from conntrack */
211 + u32 ctreplsrc; /* reply source from conntrack */
212 + u32 ctrepldst; /* reply destination from conntrack */
213 + u32 mark; /* netfilter mark (fwmark) */
216 +static __inline__ unsigned esfq_jhash_1word(struct esfq_sched_data *q,u32 a)
218 + return jhash_1word(a, q->perturbation) & (q->hash_divisor-1);
221 +static __inline__ unsigned esfq_jhash_2words(struct esfq_sched_data *q, u32 a, u32 b)
223 + return jhash_2words(a, b, q->perturbation) & (q->hash_divisor-1);
226 +static __inline__ unsigned esfq_jhash_3words(struct esfq_sched_data *q, u32 a, u32 b, u32 c)
228 + return jhash_3words(a, b, c, q->perturbation) & (q->hash_divisor-1);
231 +static unsigned esfq_hash(struct esfq_sched_data *q, struct sk_buff *skb)
233 + struct esfq_packet_info info;
234 +#ifdef CONFIG_NET_SCH_ESFQ_NFCT
235 + enum ip_conntrack_info ctinfo;
236 + struct nf_conn *ct = nf_ct_get(skb, &ctinfo);
239 + switch (skb->protocol) {
240 + case __constant_htons(ETH_P_IP):
242 + struct iphdr *iph = ip_hdr(skb);
243 + info.dst = iph->daddr;
244 + info.src = iph->saddr;
245 + if (!(iph->frag_off&htons(IP_MF|IP_OFFSET)) &&
246 + (iph->protocol == IPPROTO_TCP ||
247 + iph->protocol == IPPROTO_UDP ||
248 + iph->protocol == IPPROTO_SCTP ||
249 + iph->protocol == IPPROTO_DCCP ||
250 + iph->protocol == IPPROTO_ESP))
251 + info.proto = *(((u32*)iph) + iph->ihl);
253 + info.proto = iph->protocol;
256 + case __constant_htons(ETH_P_IPV6):
258 + struct ipv6hdr *iph = ipv6_hdr(skb);
259 + /* Hash ipv6 addresses into a u32. This isn't ideal,
260 + * but the code is simple. */
261 + info.dst = jhash2(iph->daddr.s6_addr32, 4, q->perturbation);
262 + info.src = jhash2(iph->saddr.s6_addr32, 4, q->perturbation);
263 + if (iph->nexthdr == IPPROTO_TCP ||
264 + iph->nexthdr == IPPROTO_UDP ||
265 + iph->nexthdr == IPPROTO_SCTP ||
266 + iph->nexthdr == IPPROTO_DCCP ||
267 + iph->nexthdr == IPPROTO_ESP)
268 + info.proto = *(u32*)&iph[1];
270 + info.proto = iph->nexthdr;
274 + info.dst = (u32)(unsigned long)skb->dst;
275 + info.src = (u32)(unsigned long)skb->sk;
276 + info.proto = skb->protocol;
279 + info.mark = skb->mark;
281 +#ifdef CONFIG_NET_SCH_ESFQ_NFCT
282 + /* defaults if there is no conntrack info */
283 + info.ctorigsrc = info.src;
284 + info.ctorigdst = info.dst;
285 + info.ctreplsrc = info.dst;
286 + info.ctrepldst = info.src;
287 + /* collect conntrack info */
288 + if (ct && ct != &nf_conntrack_untracked) {
289 + if (skb->protocol == __constant_htons(ETH_P_IP)) {
290 + info.ctorigsrc = ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.u3.ip;
291 + info.ctorigdst = ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.u3.ip;
292 + info.ctreplsrc = ct->tuplehash[IP_CT_DIR_REPLY].tuple.src.u3.ip;
293 + info.ctrepldst = ct->tuplehash[IP_CT_DIR_REPLY].tuple.dst.u3.ip;
295 + else if (skb->protocol == __constant_htons(ETH_P_IPV6)) {
296 + /* Again, hash ipv6 addresses into a single u32. */
297 + info.ctorigsrc = jhash2(ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.u3.ip6, 4, q->perturbation);
298 + info.ctorigdst = jhash2(ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.u3.ip6, 4, q->perturbation);
299 + info.ctreplsrc = jhash2(ct->tuplehash[IP_CT_DIR_REPLY].tuple.src.u3.ip6, 4, q->perturbation);
300 + info.ctrepldst = jhash2(ct->tuplehash[IP_CT_DIR_REPLY].tuple.dst.u3.ip6, 4, q->perturbation);
306 + switch(q->hash_kind) {
307 + case TCA_SFQ_HASH_CLASSIC:
308 + return esfq_jhash_3words(q, info.dst, info.src, info.proto);
309 + case TCA_SFQ_HASH_DST:
310 + return esfq_jhash_1word(q, info.dst);
311 + case TCA_SFQ_HASH_SRC:
312 + return esfq_jhash_1word(q, info.src);
313 + case TCA_SFQ_HASH_FWMARK:
314 + return esfq_jhash_1word(q, info.mark);
315 +#ifdef CONFIG_NET_SCH_ESFQ_NFCT
316 + case TCA_SFQ_HASH_CTORIGDST:
317 + return esfq_jhash_1word(q, info.ctorigdst);
318 + case TCA_SFQ_HASH_CTORIGSRC:
319 + return esfq_jhash_1word(q, info.ctorigsrc);
320 + case TCA_SFQ_HASH_CTREPLDST:
321 + return esfq_jhash_1word(q, info.ctrepldst);
322 + case TCA_SFQ_HASH_CTREPLSRC:
323 + return esfq_jhash_1word(q, info.ctreplsrc);
324 + case TCA_SFQ_HASH_CTNATCHG:
326 + if (info.ctorigdst == info.ctreplsrc)
327 + return esfq_jhash_1word(q, info.ctorigsrc);
328 + return esfq_jhash_1word(q, info.ctreplsrc);
332 + if (net_ratelimit())
333 + printk(KERN_WARNING "ESFQ: Unknown hash method. Falling back to classic.\n");
335 + return esfq_jhash_3words(q, info.dst, info.src, info.proto);
338 +static inline void esfq_link(struct esfq_sched_data *q, esfq_index x)
341 + int d = q->qs[x].qlen + q->depth;
344 + n = q->dep[d].next;
345 + q->dep[x].next = n;
346 + q->dep[x].prev = p;
347 + q->dep[p].next = q->dep[n].prev = x;
350 +static inline void esfq_dec(struct esfq_sched_data *q, esfq_index x)
354 + n = q->dep[x].next;
355 + p = q->dep[x].prev;
356 + q->dep[p].next = n;
357 + q->dep[n].prev = p;
359 + if (n == p && q->max_depth == q->qs[x].qlen + 1)
365 +static inline void esfq_inc(struct esfq_sched_data *q, esfq_index x)
370 + n = q->dep[x].next;
371 + p = q->dep[x].prev;
372 + q->dep[p].next = n;
373 + q->dep[n].prev = p;
375 + if (q->max_depth < d)
381 +static unsigned int esfq_drop(struct Qdisc *sch)
383 + struct esfq_sched_data *q = qdisc_priv(sch);
384 + esfq_index d = q->max_depth;
385 + struct sk_buff *skb;
388 + /* Queue is full! Find the longest slot and
389 + drop a packet from it */
392 + esfq_index x = q->dep[d+q->depth].next;
393 + skb = q->qs[x].prev;
395 + __skb_unlink(skb, &q->qs[x]);
399 + sch->qstats.drops++;
400 + sch->qstats.backlog -= len;
405 + /* It is difficult to believe, but ALL THE SLOTS HAVE LENGTH 1. */
406 + d = q->next[q->tail];
407 + q->next[q->tail] = q->next[d];
408 + q->allot[q->next[d]] += q->quantum;
409 + skb = q->qs[d].prev;
411 + __skb_unlink(skb, &q->qs[d]);
415 + q->ht[q->hash[d]] = q->depth;
416 + sch->qstats.drops++;
417 + sch->qstats.backlog -= len;
424 +static void esfq_q_enqueue(struct sk_buff *skb, struct esfq_sched_data *q, unsigned int end)
426 + unsigned hash = esfq_hash(q, skb);
427 + unsigned depth = q->depth;
432 + q->ht[hash] = x = q->dep[depth].next;
436 + if (end == ESFQ_TAIL)
437 + __skb_queue_tail(&q->qs[x], skb);
439 + __skb_queue_head(&q->qs[x], skb);
442 + if (q->qs[x].qlen == 1) { /* The flow is new */
443 + if (q->tail == depth) { /* It is the first flow */
446 + q->allot[x] = q->quantum;
448 + q->next[x] = q->next[q->tail];
449 + q->next[q->tail] = x;
455 +static int esfq_enqueue(struct sk_buff *skb, struct Qdisc* sch)
457 + struct esfq_sched_data *q = qdisc_priv(sch);
458 + esfq_q_enqueue(skb, q, ESFQ_TAIL);
459 + sch->qstats.backlog += skb->len;
460 + if (++sch->q.qlen < q->limit-1) {
461 + sch->bstats.bytes += skb->len;
462 + sch->bstats.packets++;
466 + sch->qstats.drops++;
468 + return NET_XMIT_CN;
472 +static int esfq_requeue(struct sk_buff *skb, struct Qdisc* sch)
474 + struct esfq_sched_data *q = qdisc_priv(sch);
475 + esfq_q_enqueue(skb, q, ESFQ_HEAD);
476 + sch->qstats.backlog += skb->len;
477 + if (++sch->q.qlen < q->limit - 1) {
478 + sch->qstats.requeues++;
482 + sch->qstats.drops++;
484 + return NET_XMIT_CN;
487 +static struct sk_buff *esfq_q_dequeue(struct esfq_sched_data *q)
489 + struct sk_buff *skb;
490 + unsigned depth = q->depth;
491 + esfq_index a, old_a;
493 + /* No active slots */
494 + if (q->tail == depth)
497 + a = old_a = q->next[q->tail];
500 + skb = __skb_dequeue(&q->qs[a]);
503 + /* Is the slot empty? */
504 + if (q->qs[a].qlen == 0) {
505 + q->ht[q->hash[a]] = depth;
511 + q->next[q->tail] = a;
512 + q->allot[a] += q->quantum;
513 + } else if ((q->allot[a] -= skb->len) <= 0) {
516 + q->allot[a] += q->quantum;
522 +static struct sk_buff *esfq_dequeue(struct Qdisc* sch)
524 + struct esfq_sched_data *q = qdisc_priv(sch);
525 + struct sk_buff *skb;
527 + skb = esfq_q_dequeue(q);
531 + sch->qstats.backlog -= skb->len;
535 +static void esfq_q_destroy(struct esfq_sched_data *q)
537 + del_timer(&q->perturb_timer);
552 +static void esfq_destroy(struct Qdisc *sch)
554 + struct esfq_sched_data *q = qdisc_priv(sch);
559 +static void esfq_reset(struct Qdisc* sch)
561 + struct sk_buff *skb;
563 + while ((skb = esfq_dequeue(sch)) != NULL)
567 +static void esfq_perturbation(unsigned long arg)
569 + struct Qdisc *sch = (struct Qdisc*)arg;
570 + struct esfq_sched_data *q = qdisc_priv(sch);
572 + q->perturbation = net_random()&0x1F;
574 + if (q->perturb_period) {
575 + q->perturb_timer.expires = jiffies + q->perturb_period;
576 + add_timer(&q->perturb_timer);
580 +static unsigned int esfq_check_hash(unsigned int kind)
583 + case TCA_SFQ_HASH_CTORIGDST:
584 + case TCA_SFQ_HASH_CTORIGSRC:
585 + case TCA_SFQ_HASH_CTREPLDST:
586 + case TCA_SFQ_HASH_CTREPLSRC:
587 + case TCA_SFQ_HASH_CTNATCHG:
588 +#ifndef CONFIG_NET_SCH_ESFQ_NFCT
590 + if (net_ratelimit())
591 + printk(KERN_WARNING "ESFQ: Conntrack hash types disabled in kernel config. Falling back to classic.\n");
592 + return TCA_SFQ_HASH_CLASSIC;
595 + case TCA_SFQ_HASH_CLASSIC:
596 + case TCA_SFQ_HASH_DST:
597 + case TCA_SFQ_HASH_SRC:
598 + case TCA_SFQ_HASH_FWMARK:
602 + if (net_ratelimit())
603 + printk(KERN_WARNING "ESFQ: Unknown hash type. Falling back to classic.\n");
604 + return TCA_SFQ_HASH_CLASSIC;
609 +static int esfq_q_init(struct esfq_sched_data *q, struct rtattr *opt)
611 + struct tc_esfq_qopt *ctl = RTA_DATA(opt);
612 + esfq_index p = ~0U/2;
615 + if (opt && opt->rta_len < RTA_LENGTH(sizeof(*ctl)))
618 + q->perturbation = 0;
619 + q->hash_kind = TCA_SFQ_HASH_CLASSIC;
622 + q->perturb_period = 0;
623 + q->hash_divisor = 1024;
624 + q->tail = q->limit = q->depth = 128;
627 + struct tc_esfq_qopt *ctl = RTA_DATA(opt);
629 + q->quantum = ctl->quantum;
630 + q->perturb_period = ctl->perturb_period*HZ;
631 + q->hash_divisor = ctl->divisor ? : 1024;
632 + q->tail = q->limit = q->depth = ctl->flows ? : 128;
634 + if ( q->depth > p - 1 )
638 + q->limit = min_t(u32, ctl->limit, q->depth);
640 + if (ctl->hash_kind) {
641 + q->hash_kind = esfq_check_hash(ctl->hash_kind);
645 + q->ht = kmalloc(q->hash_divisor*sizeof(esfq_index), GFP_KERNEL);
648 + q->dep = kmalloc((1+q->depth*2)*sizeof(struct esfq_head), GFP_KERNEL);
651 + q->next = kmalloc(q->depth*sizeof(esfq_index), GFP_KERNEL);
654 + q->allot = kmalloc(q->depth*sizeof(short), GFP_KERNEL);
657 + q->hash = kmalloc(q->depth*sizeof(unsigned short), GFP_KERNEL);
660 + q->qs = kmalloc(q->depth*sizeof(struct sk_buff_head), GFP_KERNEL);
664 + for (i=0; i< q->hash_divisor; i++)
665 + q->ht[i] = q->depth;
666 + for (i=0; i<q->depth; i++) {
667 + skb_queue_head_init(&q->qs[i]);
668 + q->dep[i+q->depth].next = i+q->depth;
669 + q->dep[i+q->depth].prev = i+q->depth;
672 + for (i=0; i<q->depth; i++)
680 +static int esfq_init(struct Qdisc *sch, struct rtattr *opt)
682 + struct esfq_sched_data *q = qdisc_priv(sch);
685 + q->quantum = psched_mtu(sch->dev); /* default */
686 + if ((err = esfq_q_init(q, opt)))
689 + init_timer(&q->perturb_timer);
690 + q->perturb_timer.data = (unsigned long)sch;
691 + q->perturb_timer.function = esfq_perturbation;
692 + if (q->perturb_period) {
693 + q->perturb_timer.expires = jiffies + q->perturb_period;
694 + add_timer(&q->perturb_timer);
700 +static int esfq_change(struct Qdisc *sch, struct rtattr *opt)
702 + struct esfq_sched_data *q = qdisc_priv(sch);
703 + struct esfq_sched_data new;
704 + struct sk_buff *skb;
707 + /* set up new queue */
708 + memset(&new, 0, sizeof(struct esfq_sched_data));
709 + new.quantum = psched_mtu(sch->dev); /* default */
710 + if ((err = esfq_q_init(&new, opt)))
713 + /* copy all packets from the old queue to the new queue */
714 + sch_tree_lock(sch);
715 + while ((skb = esfq_q_dequeue(q)) != NULL)
716 + esfq_q_enqueue(skb, &new, ESFQ_TAIL);
718 + /* clean up the old queue */
721 + /* copy elements of the new queue into the old queue */
722 + q->perturb_period = new.perturb_period;
723 + q->quantum = new.quantum;
724 + q->limit = new.limit;
725 + q->depth = new.depth;
726 + q->hash_divisor = new.hash_divisor;
727 + q->hash_kind = new.hash_kind;
728 + q->tail = new.tail;
729 + q->max_depth = new.max_depth;
732 + q->next = new.next;
733 + q->allot = new.allot;
734 + q->hash = new.hash;
738 + if (q->perturb_period) {
739 + q->perturb_timer.expires = jiffies + q->perturb_period;
740 + add_timer(&q->perturb_timer);
742 + q->perturbation = 0;
744 + sch_tree_unlock(sch);
748 +static int esfq_dump(struct Qdisc *sch, struct sk_buff *skb)
750 + struct esfq_sched_data *q = qdisc_priv(sch);
751 + unsigned char *b = skb->tail;
752 + struct tc_esfq_qopt opt;
754 + opt.quantum = q->quantum;
755 + opt.perturb_period = q->perturb_period/HZ;
757 + opt.limit = q->limit;
758 + opt.divisor = q->hash_divisor;
759 + opt.flows = q->depth;
760 + opt.hash_kind = q->hash_kind;
762 + RTA_PUT(skb, TCA_OPTIONS, sizeof(opt), &opt);
767 + skb_trim(skb, b - skb->data);
771 +static struct Qdisc_ops esfq_qdisc_ops =
776 + .priv_size = sizeof(struct esfq_sched_data),
777 + .enqueue = esfq_enqueue,
778 + .dequeue = esfq_dequeue,
779 + .requeue = esfq_requeue,
782 + .reset = esfq_reset,
783 + .destroy = esfq_destroy,
784 + .change = esfq_change,
786 + .owner = THIS_MODULE,
789 +static int __init esfq_module_init(void)
791 + return register_qdisc(&esfq_qdisc_ops);
793 +static void __exit esfq_module_exit(void)
795 + unregister_qdisc(&esfq_qdisc_ops);
797 +module_init(esfq_module_init)
798 +module_exit(esfq_module_exit)
799 +MODULE_LICENSE("GPL");