1 Index: linux-2.6.24.7/include/linux/pkt_sched.h
2 ===================================================================
3 --- linux-2.6.24.7.orig/include/linux/pkt_sched.h
4 +++ linux-2.6.24.7/include/linux/pkt_sched.h
5 @@ -155,8 +155,37 @@ struct tc_sfq_qopt
7 * The only reason for this is efficiency, it is possible
8 * to change these parameters in compile time.
10 + * If you need to play with these values, use esfq instead.
18 + TCA_SFQ_HASH_CLASSIC,
21 + TCA_SFQ_HASH_FWMARK,
23 + TCA_SFQ_HASH_CTORIGDST,
24 + TCA_SFQ_HASH_CTORIGSRC,
25 + TCA_SFQ_HASH_CTREPLDST,
26 + TCA_SFQ_HASH_CTREPLSRC,
27 + TCA_SFQ_HASH_CTNATCHG,
32 + unsigned quantum; /* Bytes per round allocated to flow */
33 + int perturb_period; /* Period of hash perturbation */
34 + __u32 limit; /* Maximal packets in queue */
35 + unsigned divisor; /* Hash divisor */
36 + unsigned flows; /* Maximal number of flows */
37 + unsigned hash_kind; /* Hash function to use for flow identification */
43 Index: linux-2.6.24.7/net/sched/Kconfig
44 ===================================================================
45 --- linux-2.6.24.7.orig/net/sched/Kconfig
46 +++ linux-2.6.24.7/net/sched/Kconfig
47 @@ -139,6 +139,37 @@ config NET_SCH_SFQ
48 To compile this code as a module, choose M here: the
49 module will be called sch_sfq.
52 + tristate "Enhanced Stochastic Fairness Queueing (ESFQ)"
54 + Say Y here if you want to use the Enhanced Stochastic Fairness
55 + Queueing (ESFQ) packet scheduling algorithm for some of your network
56 + devices or as a leaf discipline for a classful qdisc such as HTB or
57 + CBQ (see the top of <file:net/sched/sch_esfq.c> for details and
58 + references to the SFQ algorithm).
60 + This is an enchanced SFQ version which allows you to control some
61 + hardcoded values in the SFQ scheduler.
63 + ESFQ also adds control of the hash function used to identify packet
64 + flows. The original SFQ discipline hashes by connection; ESFQ add
65 + several other hashing methods, such as by src IP or by dst IP, which
66 + can be more fair to users in some networking situations.
68 + To compile this code as a module, choose M here: the
69 + module will be called sch_esfq.
71 +config NET_SCH_ESFQ_NFCT
72 + bool "Connection Tracking Hash Types"
73 + depends on NET_SCH_ESFQ && NF_CONNTRACK
75 + Say Y here to enable support for hashing based on netfilter connection
76 + tracking information. This is useful for a router that is also using
77 + NAT to connect privately-addressed hosts to the Internet. If you want
78 + to provide fair distribution of upstream bandwidth, ESFQ must use
79 + connection tracking information, since all outgoing packets will share
80 + the same source address.
83 tristate "True Link Equalizer (TEQL)"
85 Index: linux-2.6.24.7/net/sched/Makefile
86 ===================================================================
87 --- linux-2.6.24.7.orig/net/sched/Makefile
88 +++ linux-2.6.24.7/net/sched/Makefile
89 @@ -23,6 +23,7 @@ obj-$(CONFIG_NET_SCH_GRED) += sch_gred.o
90 obj-$(CONFIG_NET_SCH_INGRESS) += sch_ingress.o
91 obj-$(CONFIG_NET_SCH_DSMARK) += sch_dsmark.o
92 obj-$(CONFIG_NET_SCH_SFQ) += sch_sfq.o
93 +obj-$(CONFIG_NET_SCH_ESFQ) += sch_esfq.o
94 obj-$(CONFIG_NET_SCH_TBF) += sch_tbf.o
95 obj-$(CONFIG_NET_SCH_TEQL) += sch_teql.o
96 obj-$(CONFIG_NET_SCH_PRIO) += sch_prio.o
97 Index: linux-2.6.24.7/net/sched/sch_esfq.c
98 ===================================================================
100 +++ linux-2.6.24.7/net/sched/sch_esfq.c
103 + * net/sched/sch_esfq.c Extended Stochastic Fairness Queueing discipline.
105 + * This program is free software; you can redistribute it and/or
106 + * modify it under the terms of the GNU General Public License
107 + * as published by the Free Software Foundation; either version
108 + * 2 of the License, or (at your option) any later version.
110 + * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
112 + * Changes: Alexander Atanasov, <alex@ssi.bg>
113 + * Added dynamic depth,limit,divisor,hash_kind options.
114 + * Added dst and src hashes.
116 + * Alexander Clouter, <alex@digriz.org.uk>
117 + * Ported ESFQ to Linux 2.6.
119 + * Corey Hickey, <bugfood-c@fatooh.org>
120 + * Maintenance of the Linux 2.6 port.
121 + * Added fwmark hash (thanks to Robert Kurjata).
122 + * Added usage of jhash.
123 + * Added conntrack support.
124 + * Added ctnatchg hash (thanks to Ben Pfountz).
127 +#include <linux/module.h>
128 +#include <asm/uaccess.h>
129 +#include <asm/system.h>
130 +#include <linux/bitops.h>
131 +#include <linux/types.h>
132 +#include <linux/kernel.h>
133 +#include <linux/jiffies.h>
134 +#include <linux/string.h>
135 +#include <linux/mm.h>
136 +#include <linux/socket.h>
137 +#include <linux/sockios.h>
138 +#include <linux/in.h>
139 +#include <linux/errno.h>
140 +#include <linux/interrupt.h>
141 +#include <linux/if_ether.h>
142 +#include <linux/inet.h>
143 +#include <linux/netdevice.h>
144 +#include <linux/etherdevice.h>
145 +#include <linux/notifier.h>
146 +#include <linux/init.h>
148 +#include <linux/ipv6.h>
149 +#include <net/route.h>
150 +#include <linux/skbuff.h>
151 +#include <net/sock.h>
152 +#include <net/pkt_sched.h>
153 +#include <linux/jhash.h>
154 +#include <net/netfilter/nf_conntrack.h>
156 +/* Stochastic Fairness Queuing algorithm.
157 + For more comments look at sch_sfq.c.
158 + The difference is that you can change limit, depth,
159 + hash table size and choose alternate hash types.
161 + classic: same as in sch_sfq.c
162 + dst: destination IP address
163 + src: source IP address
164 + fwmark: netfilter mark value
165 + ctorigdst: original destination IP address
166 + ctorigsrc: original source IP address
167 + ctrepldst: reply destination IP address
168 + ctreplsrc: reply source IP
175 +/* This type should contain at least SFQ_DEPTH*2 values */
176 +typedef unsigned int esfq_index;
184 +struct esfq_sched_data
187 + int perturb_period;
188 + unsigned quantum; /* Allotment per round: MUST BE >= MTU */
191 + unsigned hash_divisor;
192 + unsigned hash_kind;
194 + struct timer_list perturb_timer;
196 + esfq_index tail; /* Index of current slot in round */
197 + esfq_index max_depth; /* Maximal depth */
199 + esfq_index *ht; /* Hash table */
200 + esfq_index *next; /* Active slots link */
201 + short *allot; /* Current allotment per slot */
202 + unsigned short *hash; /* Hash value indexed by slots */
203 + struct sk_buff_head *qs; /* Slot queue */
204 + struct esfq_head *dep; /* Linked list of slots, indexed by depth */
207 +/* This contains the info we will hash. */
208 +struct esfq_packet_info
210 + u32 proto; /* protocol or port */
211 + u32 src; /* source from packet header */
212 + u32 dst; /* destination from packet header */
213 + u32 ctorigsrc; /* original source from conntrack */
214 + u32 ctorigdst; /* original destination from conntrack */
215 + u32 ctreplsrc; /* reply source from conntrack */
216 + u32 ctrepldst; /* reply destination from conntrack */
217 + u32 mark; /* netfilter mark (fwmark) */
220 +static __inline__ unsigned esfq_jhash_1word(struct esfq_sched_data *q,u32 a)
222 + return jhash_1word(a, q->perturbation) & (q->hash_divisor-1);
225 +static __inline__ unsigned esfq_jhash_2words(struct esfq_sched_data *q, u32 a, u32 b)
227 + return jhash_2words(a, b, q->perturbation) & (q->hash_divisor-1);
230 +static __inline__ unsigned esfq_jhash_3words(struct esfq_sched_data *q, u32 a, u32 b, u32 c)
232 + return jhash_3words(a, b, c, q->perturbation) & (q->hash_divisor-1);
235 +static unsigned esfq_hash(struct esfq_sched_data *q, struct sk_buff *skb)
237 + struct esfq_packet_info info;
238 +#ifdef CONFIG_NET_SCH_ESFQ_NFCT
239 + enum ip_conntrack_info ctinfo;
240 + struct nf_conn *ct = nf_ct_get(skb, &ctinfo);
243 + switch (skb->protocol) {
244 + case __constant_htons(ETH_P_IP):
246 + struct iphdr *iph = ip_hdr(skb);
247 + info.dst = iph->daddr;
248 + info.src = iph->saddr;
249 + if (!(iph->frag_off&htons(IP_MF|IP_OFFSET)) &&
250 + (iph->protocol == IPPROTO_TCP ||
251 + iph->protocol == IPPROTO_UDP ||
252 + iph->protocol == IPPROTO_SCTP ||
253 + iph->protocol == IPPROTO_DCCP ||
254 + iph->protocol == IPPROTO_ESP))
255 + info.proto = *(((u32*)iph) + iph->ihl);
257 + info.proto = iph->protocol;
260 + case __constant_htons(ETH_P_IPV6):
262 + struct ipv6hdr *iph = ipv6_hdr(skb);
263 + /* Hash ipv6 addresses into a u32. This isn't ideal,
264 + * but the code is simple. */
265 + info.dst = jhash2(iph->daddr.s6_addr32, 4, q->perturbation);
266 + info.src = jhash2(iph->saddr.s6_addr32, 4, q->perturbation);
267 + if (iph->nexthdr == IPPROTO_TCP ||
268 + iph->nexthdr == IPPROTO_UDP ||
269 + iph->nexthdr == IPPROTO_SCTP ||
270 + iph->nexthdr == IPPROTO_DCCP ||
271 + iph->nexthdr == IPPROTO_ESP)
272 + info.proto = *(u32*)&iph[1];
274 + info.proto = iph->nexthdr;
278 + info.dst = (u32)(unsigned long)skb->dst;
279 + info.src = (u32)(unsigned long)skb->sk;
280 + info.proto = skb->protocol;
283 + info.mark = skb->mark;
285 +#ifdef CONFIG_NET_SCH_ESFQ_NFCT
286 + /* defaults if there is no conntrack info */
287 + info.ctorigsrc = info.src;
288 + info.ctorigdst = info.dst;
289 + info.ctreplsrc = info.dst;
290 + info.ctrepldst = info.src;
291 + /* collect conntrack info */
292 + if (ct && ct != &nf_conntrack_untracked) {
293 + if (skb->protocol == __constant_htons(ETH_P_IP)) {
294 + info.ctorigsrc = ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.u3.ip;
295 + info.ctorigdst = ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.u3.ip;
296 + info.ctreplsrc = ct->tuplehash[IP_CT_DIR_REPLY].tuple.src.u3.ip;
297 + info.ctrepldst = ct->tuplehash[IP_CT_DIR_REPLY].tuple.dst.u3.ip;
299 + else if (skb->protocol == __constant_htons(ETH_P_IPV6)) {
300 + /* Again, hash ipv6 addresses into a single u32. */
301 + info.ctorigsrc = jhash2(ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.u3.ip6, 4, q->perturbation);
302 + info.ctorigdst = jhash2(ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.u3.ip6, 4, q->perturbation);
303 + info.ctreplsrc = jhash2(ct->tuplehash[IP_CT_DIR_REPLY].tuple.src.u3.ip6, 4, q->perturbation);
304 + info.ctrepldst = jhash2(ct->tuplehash[IP_CT_DIR_REPLY].tuple.dst.u3.ip6, 4, q->perturbation);
310 + switch(q->hash_kind) {
311 + case TCA_SFQ_HASH_CLASSIC:
312 + return esfq_jhash_3words(q, info.dst, info.src, info.proto);
313 + case TCA_SFQ_HASH_DST:
314 + return esfq_jhash_1word(q, info.dst);
315 + case TCA_SFQ_HASH_SRC:
316 + return esfq_jhash_1word(q, info.src);
317 + case TCA_SFQ_HASH_FWMARK:
318 + return esfq_jhash_1word(q, info.mark);
319 +#ifdef CONFIG_NET_SCH_ESFQ_NFCT
320 + case TCA_SFQ_HASH_CTORIGDST:
321 + return esfq_jhash_1word(q, info.ctorigdst);
322 + case TCA_SFQ_HASH_CTORIGSRC:
323 + return esfq_jhash_1word(q, info.ctorigsrc);
324 + case TCA_SFQ_HASH_CTREPLDST:
325 + return esfq_jhash_1word(q, info.ctrepldst);
326 + case TCA_SFQ_HASH_CTREPLSRC:
327 + return esfq_jhash_1word(q, info.ctreplsrc);
328 + case TCA_SFQ_HASH_CTNATCHG:
330 + if (info.ctorigdst == info.ctreplsrc)
331 + return esfq_jhash_1word(q, info.ctorigsrc);
332 + return esfq_jhash_1word(q, info.ctreplsrc);
336 + if (net_ratelimit())
337 + printk(KERN_WARNING "ESFQ: Unknown hash method. Falling back to classic.\n");
339 + return esfq_jhash_3words(q, info.dst, info.src, info.proto);
342 +static inline void esfq_link(struct esfq_sched_data *q, esfq_index x)
345 + int d = q->qs[x].qlen + q->depth;
348 + n = q->dep[d].next;
349 + q->dep[x].next = n;
350 + q->dep[x].prev = p;
351 + q->dep[p].next = q->dep[n].prev = x;
354 +static inline void esfq_dec(struct esfq_sched_data *q, esfq_index x)
358 + n = q->dep[x].next;
359 + p = q->dep[x].prev;
360 + q->dep[p].next = n;
361 + q->dep[n].prev = p;
363 + if (n == p && q->max_depth == q->qs[x].qlen + 1)
369 +static inline void esfq_inc(struct esfq_sched_data *q, esfq_index x)
374 + n = q->dep[x].next;
375 + p = q->dep[x].prev;
376 + q->dep[p].next = n;
377 + q->dep[n].prev = p;
379 + if (q->max_depth < d)
385 +static unsigned int esfq_drop(struct Qdisc *sch)
387 + struct esfq_sched_data *q = qdisc_priv(sch);
388 + esfq_index d = q->max_depth;
389 + struct sk_buff *skb;
392 + /* Queue is full! Find the longest slot and
393 + drop a packet from it */
396 + esfq_index x = q->dep[d+q->depth].next;
397 + skb = q->qs[x].prev;
399 + __skb_unlink(skb, &q->qs[x]);
403 + sch->qstats.drops++;
404 + sch->qstats.backlog -= len;
409 + /* It is difficult to believe, but ALL THE SLOTS HAVE LENGTH 1. */
410 + d = q->next[q->tail];
411 + q->next[q->tail] = q->next[d];
412 + q->allot[q->next[d]] += q->quantum;
413 + skb = q->qs[d].prev;
415 + __skb_unlink(skb, &q->qs[d]);
419 + q->ht[q->hash[d]] = q->depth;
420 + sch->qstats.drops++;
421 + sch->qstats.backlog -= len;
428 +static void esfq_q_enqueue(struct sk_buff *skb, struct esfq_sched_data *q, unsigned int end)
430 + unsigned hash = esfq_hash(q, skb);
431 + unsigned depth = q->depth;
436 + q->ht[hash] = x = q->dep[depth].next;
440 + if (end == ESFQ_TAIL)
441 + __skb_queue_tail(&q->qs[x], skb);
443 + __skb_queue_head(&q->qs[x], skb);
446 + if (q->qs[x].qlen == 1) { /* The flow is new */
447 + if (q->tail == depth) { /* It is the first flow */
450 + q->allot[x] = q->quantum;
452 + q->next[x] = q->next[q->tail];
453 + q->next[q->tail] = x;
459 +static int esfq_enqueue(struct sk_buff *skb, struct Qdisc* sch)
461 + struct esfq_sched_data *q = qdisc_priv(sch);
462 + esfq_q_enqueue(skb, q, ESFQ_TAIL);
463 + sch->qstats.backlog += skb->len;
464 + if (++sch->q.qlen < q->limit-1) {
465 + sch->bstats.bytes += skb->len;
466 + sch->bstats.packets++;
470 + sch->qstats.drops++;
472 + return NET_XMIT_CN;
476 +static int esfq_requeue(struct sk_buff *skb, struct Qdisc* sch)
478 + struct esfq_sched_data *q = qdisc_priv(sch);
479 + esfq_q_enqueue(skb, q, ESFQ_HEAD);
480 + sch->qstats.backlog += skb->len;
481 + if (++sch->q.qlen < q->limit - 1) {
482 + sch->qstats.requeues++;
486 + sch->qstats.drops++;
488 + return NET_XMIT_CN;
491 +static struct sk_buff *esfq_q_dequeue(struct esfq_sched_data *q)
493 + struct sk_buff *skb;
494 + unsigned depth = q->depth;
495 + esfq_index a, old_a;
497 + /* No active slots */
498 + if (q->tail == depth)
501 + a = old_a = q->next[q->tail];
504 + skb = __skb_dequeue(&q->qs[a]);
507 + /* Is the slot empty? */
508 + if (q->qs[a].qlen == 0) {
509 + q->ht[q->hash[a]] = depth;
515 + q->next[q->tail] = a;
516 + q->allot[a] += q->quantum;
517 + } else if ((q->allot[a] -= skb->len) <= 0) {
520 + q->allot[a] += q->quantum;
526 +static struct sk_buff *esfq_dequeue(struct Qdisc* sch)
528 + struct esfq_sched_data *q = qdisc_priv(sch);
529 + struct sk_buff *skb;
531 + skb = esfq_q_dequeue(q);
535 + sch->qstats.backlog -= skb->len;
539 +static void esfq_q_destroy(struct esfq_sched_data *q)
541 + del_timer(&q->perturb_timer);
556 +static void esfq_destroy(struct Qdisc *sch)
558 + struct esfq_sched_data *q = qdisc_priv(sch);
563 +static void esfq_reset(struct Qdisc* sch)
565 + struct sk_buff *skb;
567 + while ((skb = esfq_dequeue(sch)) != NULL)
571 +static void esfq_perturbation(unsigned long arg)
573 + struct Qdisc *sch = (struct Qdisc*)arg;
574 + struct esfq_sched_data *q = qdisc_priv(sch);
576 + q->perturbation = net_random()&0x1F;
578 + if (q->perturb_period) {
579 + q->perturb_timer.expires = jiffies + q->perturb_period;
580 + add_timer(&q->perturb_timer);
584 +static unsigned int esfq_check_hash(unsigned int kind)
587 + case TCA_SFQ_HASH_CTORIGDST:
588 + case TCA_SFQ_HASH_CTORIGSRC:
589 + case TCA_SFQ_HASH_CTREPLDST:
590 + case TCA_SFQ_HASH_CTREPLSRC:
591 + case TCA_SFQ_HASH_CTNATCHG:
592 +#ifndef CONFIG_NET_SCH_ESFQ_NFCT
594 + if (net_ratelimit())
595 + printk(KERN_WARNING "ESFQ: Conntrack hash types disabled in kernel config. Falling back to classic.\n");
596 + return TCA_SFQ_HASH_CLASSIC;
599 + case TCA_SFQ_HASH_CLASSIC:
600 + case TCA_SFQ_HASH_DST:
601 + case TCA_SFQ_HASH_SRC:
602 + case TCA_SFQ_HASH_FWMARK:
606 + if (net_ratelimit())
607 + printk(KERN_WARNING "ESFQ: Unknown hash type. Falling back to classic.\n");
608 + return TCA_SFQ_HASH_CLASSIC;
613 +static int esfq_q_init(struct esfq_sched_data *q, struct rtattr *opt)
615 + struct tc_esfq_qopt *ctl = RTA_DATA(opt);
616 + esfq_index p = ~0U/2;
619 + if (opt && opt->rta_len < RTA_LENGTH(sizeof(*ctl)))
622 + q->perturbation = 0;
623 + q->hash_kind = TCA_SFQ_HASH_CLASSIC;
626 + q->perturb_period = 0;
627 + q->hash_divisor = 1024;
628 + q->tail = q->limit = q->depth = 128;
631 + struct tc_esfq_qopt *ctl = RTA_DATA(opt);
633 + q->quantum = ctl->quantum;
634 + q->perturb_period = ctl->perturb_period*HZ;
635 + q->hash_divisor = ctl->divisor ? : 1024;
636 + q->tail = q->limit = q->depth = ctl->flows ? : 128;
638 + if ( q->depth > p - 1 )
642 + q->limit = min_t(u32, ctl->limit, q->depth);
644 + if (ctl->hash_kind) {
645 + q->hash_kind = esfq_check_hash(ctl->hash_kind);
649 + q->ht = kmalloc(q->hash_divisor*sizeof(esfq_index), GFP_KERNEL);
652 + q->dep = kmalloc((1+q->depth*2)*sizeof(struct esfq_head), GFP_KERNEL);
655 + q->next = kmalloc(q->depth*sizeof(esfq_index), GFP_KERNEL);
658 + q->allot = kmalloc(q->depth*sizeof(short), GFP_KERNEL);
661 + q->hash = kmalloc(q->depth*sizeof(unsigned short), GFP_KERNEL);
664 + q->qs = kmalloc(q->depth*sizeof(struct sk_buff_head), GFP_KERNEL);
668 + for (i=0; i< q->hash_divisor; i++)
669 + q->ht[i] = q->depth;
670 + for (i=0; i<q->depth; i++) {
671 + skb_queue_head_init(&q->qs[i]);
672 + q->dep[i+q->depth].next = i+q->depth;
673 + q->dep[i+q->depth].prev = i+q->depth;
676 + for (i=0; i<q->depth; i++)
684 +static int esfq_init(struct Qdisc *sch, struct rtattr *opt)
686 + struct esfq_sched_data *q = qdisc_priv(sch);
689 + q->quantum = psched_mtu(sch->dev); /* default */
690 + if ((err = esfq_q_init(q, opt)))
693 + init_timer(&q->perturb_timer);
694 + q->perturb_timer.data = (unsigned long)sch;
695 + q->perturb_timer.function = esfq_perturbation;
696 + if (q->perturb_period) {
697 + q->perturb_timer.expires = jiffies + q->perturb_period;
698 + add_timer(&q->perturb_timer);
704 +static int esfq_change(struct Qdisc *sch, struct rtattr *opt)
706 + struct esfq_sched_data *q = qdisc_priv(sch);
707 + struct esfq_sched_data new;
708 + struct sk_buff *skb;
711 + /* set up new queue */
712 + memset(&new, 0, sizeof(struct esfq_sched_data));
713 + new.quantum = psched_mtu(sch->dev); /* default */
714 + if ((err = esfq_q_init(&new, opt)))
717 + /* copy all packets from the old queue to the new queue */
718 + sch_tree_lock(sch);
719 + while ((skb = esfq_q_dequeue(q)) != NULL)
720 + esfq_q_enqueue(skb, &new, ESFQ_TAIL);
722 + /* clean up the old queue */
725 + /* copy elements of the new queue into the old queue */
726 + q->perturb_period = new.perturb_period;
727 + q->quantum = new.quantum;
728 + q->limit = new.limit;
729 + q->depth = new.depth;
730 + q->hash_divisor = new.hash_divisor;
731 + q->hash_kind = new.hash_kind;
732 + q->tail = new.tail;
733 + q->max_depth = new.max_depth;
736 + q->next = new.next;
737 + q->allot = new.allot;
738 + q->hash = new.hash;
742 + if (q->perturb_period) {
743 + q->perturb_timer.expires = jiffies + q->perturb_period;
744 + add_timer(&q->perturb_timer);
746 + q->perturbation = 0;
748 + sch_tree_unlock(sch);
752 +static int esfq_dump(struct Qdisc *sch, struct sk_buff *skb)
754 + struct esfq_sched_data *q = qdisc_priv(sch);
755 + unsigned char *b = skb->tail;
756 + struct tc_esfq_qopt opt;
758 + opt.quantum = q->quantum;
759 + opt.perturb_period = q->perturb_period/HZ;
761 + opt.limit = q->limit;
762 + opt.divisor = q->hash_divisor;
763 + opt.flows = q->depth;
764 + opt.hash_kind = q->hash_kind;
766 + RTA_PUT(skb, TCA_OPTIONS, sizeof(opt), &opt);
771 + skb_trim(skb, b - skb->data);
775 +static struct Qdisc_ops esfq_qdisc_ops =
780 + .priv_size = sizeof(struct esfq_sched_data),
781 + .enqueue = esfq_enqueue,
782 + .dequeue = esfq_dequeue,
783 + .requeue = esfq_requeue,
786 + .reset = esfq_reset,
787 + .destroy = esfq_destroy,
788 + .change = esfq_change,
790 + .owner = THIS_MODULE,
793 +static int __init esfq_module_init(void)
795 + return register_qdisc(&esfq_qdisc_ops);
797 +static void __exit esfq_module_exit(void)
799 + unregister_qdisc(&esfq_qdisc_ops);
801 +module_init(esfq_module_init)
802 +module_exit(esfq_module_exit)
803 +MODULE_LICENSE("GPL");