1 Index: linux-2.6.22.19/include/linux/pkt_sched.h
2 ===================================================================
3 --- linux-2.6.22.19.orig/include/linux/pkt_sched.h
4 +++ linux-2.6.22.19/include/linux/pkt_sched.h
5 @@ -146,8 +146,40 @@ 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_DSTDIR,
24 + TCA_SFQ_HASH_SRCDIR,
25 + TCA_SFQ_HASH_FWMARKDIR,
27 + TCA_SFQ_HASH_CTORIGDST,
28 + TCA_SFQ_HASH_CTORIGSRC,
29 + TCA_SFQ_HASH_CTREPLDST,
30 + TCA_SFQ_HASH_CTREPLSRC,
35 + unsigned quantum; /* Bytes per round allocated to flow */
36 + int perturb_period; /* Period of hash perturbation */
37 + __u32 limit; /* Maximal packets in queue */
38 + unsigned divisor; /* Hash divisor */
39 + unsigned flows; /* Maximal number of flows */
40 + unsigned hash_kind; /* Hash function to use for flow identification */
46 Index: linux-2.6.22.19/net/sched/Kconfig
47 ===================================================================
48 --- linux-2.6.22.19.orig/net/sched/Kconfig
49 +++ linux-2.6.22.19/net/sched/Kconfig
50 @@ -133,6 +133,26 @@ config NET_SCH_SFQ
51 To compile this code as a module, choose M here: the
52 module will be called sch_sfq.
55 + tristate "Enhanced Stochastic Fairness Queueing (ESFQ)"
57 + Say Y here if you want to use the Enhanced Stochastic Fairness
58 + Queueing (ESFQ) packet scheduling algorithm for some of your network
59 + devices or as a leaf discipline for a classful qdisc such as HTB or
60 + CBQ (see the top of <file:net/sched/sch_esfq.c> for details and
61 + references to the SFQ algorithm).
63 + This is an enchanced SFQ version which allows you to control some
64 + hardcoded values in the SFQ scheduler.
66 + ESFQ also adds control of the hash function used to identify packet
67 + flows. The original SFQ discipline hashes by connection; ESFQ add
68 + several other hashing methods, such as by src IP or by dst IP, which
69 + can be more fair to users in some networking situations.
71 + To compile this code as a module, choose M here: the
72 + module will be called sch_esfq.
75 tristate "True Link Equalizer (TEQL)"
77 Index: linux-2.6.22.19/net/sched/Makefile
78 ===================================================================
79 --- linux-2.6.22.19.orig/net/sched/Makefile
80 +++ linux-2.6.22.19/net/sched/Makefile
81 @@ -23,6 +23,7 @@ obj-$(CONFIG_NET_SCH_GRED) += sch_gred.o
82 obj-$(CONFIG_NET_SCH_INGRESS) += sch_ingress.o
83 obj-$(CONFIG_NET_SCH_DSMARK) += sch_dsmark.o
84 obj-$(CONFIG_NET_SCH_SFQ) += sch_sfq.o
85 +obj-$(CONFIG_NET_SCH_ESFQ) += sch_esfq.o
86 obj-$(CONFIG_NET_SCH_TBF) += sch_tbf.o
87 obj-$(CONFIG_NET_SCH_TEQL) += sch_teql.o
88 obj-$(CONFIG_NET_SCH_PRIO) += sch_prio.o
89 Index: linux-2.6.22.19/net/sched/sch_esfq.c
90 ===================================================================
92 +++ linux-2.6.22.19/net/sched/sch_esfq.c
95 + * net/sched/sch_esfq.c Extended Stochastic Fairness Queueing discipline.
97 + * This program is free software; you can redistribute it and/or
98 + * modify it under the terms of the GNU General Public License
99 + * as published by the Free Software Foundation; either version
100 + * 2 of the License, or (at your option) any later version.
102 + * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
104 + * Changes: Alexander Atanasov, <alex@ssi.bg>
105 + * Added dynamic depth,limit,divisor,hash_kind options.
106 + * Added dst and src hashes.
108 + * Alexander Clouter, <alex@digriz.org.uk>
109 + * Ported ESFQ to Linux 2.6.
111 + * Corey Hickey, <bugfood-c@fatooh.org>
112 + * Maintenance of the Linux 2.6 port.
113 + * Added fwmark hash (thanks to Robert Kurjata).
114 + * Added direct hashing for src, dst, and fwmark.
115 + * Added usage of jhash.
119 +#include <linux/module.h>
120 +#include <asm/uaccess.h>
121 +#include <asm/system.h>
122 +#include <linux/bitops.h>
123 +#include <linux/types.h>
124 +#include <linux/kernel.h>
125 +#include <linux/jiffies.h>
126 +#include <linux/string.h>
127 +#include <linux/mm.h>
128 +#include <linux/socket.h>
129 +#include <linux/sockios.h>
130 +#include <linux/in.h>
131 +#include <linux/errno.h>
132 +#include <linux/interrupt.h>
133 +#include <linux/if_ether.h>
134 +#include <linux/inet.h>
135 +#include <linux/netdevice.h>
136 +#include <linux/etherdevice.h>
137 +#include <linux/notifier.h>
138 +#include <linux/init.h>
140 +#include <linux/ipv6.h>
141 +#include <net/route.h>
142 +#include <linux/skbuff.h>
143 +#include <net/sock.h>
144 +#include <net/pkt_sched.h>
145 +#include <linux/jhash.h>
147 +#ifdef CONFIG_NF_CONNTRACK_ENABLED
148 +#include <net/netfilter/nf_conntrack.h>
151 +/* Stochastic Fairness Queuing algorithm.
152 + For more comments look at sch_sfq.c.
153 + The difference is that you can change limit, depth,
154 + hash table size and choose alternate hash types.
156 + classic: same as in sch_sfq.c
157 + dst: destination IP address
158 + src: source IP address
159 + fwmark: netfilter mark value
162 + fwmark_direct: direct hashing of the above sources
163 + ctorigdst: original destination IP address
164 + ctorigsrc: original source IP address
165 + ctrepldst: reply destination IP address
166 + 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 */
201 + unsigned dyn_min; /* For dynamic divisor adjustment; minimum value seen */
202 + unsigned dyn_max; /* maximum value seen */
203 + unsigned dyn_range; /* saved range */
206 +/* This contains the info we will hash. */
207 +struct esfq_packet_info
209 + u32 proto; /* protocol or port */
210 + u32 src; /* source from packet header */
211 + u32 dst; /* destination from packet header */
212 + u32 ctorigsrc; /* original source from conntrack */
213 + u32 ctorigdst; /* original destination from conntrack */
214 + u32 ctreplsrc; /* reply source from conntrack */
215 + u32 ctrepldst; /* reply destination from conntrack */
216 + u32 mark; /* netfilter mark (fwmark) */
219 +/* Hash input values directly into the "nearest" slot, taking into account the
220 + * range of input values seen. This is most useful when the hash table is at
221 + * least as large as the range of possible values.
222 + * Note: this functionality was added before the change to using jhash, and may
223 + * no longer be useful. */
224 +static __inline__ unsigned esfq_hash_direct(struct esfq_sched_data *q, u32 h)
226 + /* adjust minimum and maximum */
227 + if (h < q->dyn_min || h > q->dyn_max) {
228 + q->dyn_min = h < q->dyn_min ? h : q->dyn_min;
229 + q->dyn_max = h > q->dyn_max ? h : q->dyn_max;
231 + /* find new range */
232 + if ((q->dyn_range = q->dyn_max - q->dyn_min) >= q->hash_divisor)
233 + printk(KERN_WARNING "ESFQ: (direct hash) Input range %u is larger than hash "
234 + "table. See ESFQ README for details.\n", q->dyn_range);
237 + /* hash input values into slot numbers */
238 + if (q->dyn_min == q->dyn_max)
239 + return 0; /* only one value seen; avoid division by 0 */
241 + return (h - q->dyn_min) * (q->hash_divisor - 1) / q->dyn_range;
244 +static __inline__ unsigned esfq_jhash_1word(struct esfq_sched_data *q,u32 a)
246 + return jhash_1word(a, q->perturbation) & (q->hash_divisor-1);
249 +static __inline__ unsigned esfq_jhash_2words(struct esfq_sched_data *q, u32 a, u32 b)
251 + return jhash_2words(a, b, q->perturbation) & (q->hash_divisor-1);
254 +static __inline__ unsigned esfq_jhash_3words(struct esfq_sched_data *q, u32 a, u32 b, u32 c)
256 + return jhash_3words(a, b, c, q->perturbation) & (q->hash_divisor-1);
260 +static unsigned esfq_hash(struct esfq_sched_data *q, struct sk_buff *skb)
262 + struct esfq_packet_info info;
263 +#ifdef CONFIG_NF_CONNTRACK_ENABLED
264 + enum ip_conntrack_info ctinfo;
265 + struct nf_conn *ct = nf_ct_get(skb, &ctinfo);
268 + switch (skb->protocol) {
269 + case __constant_htons(ETH_P_IP):
271 + struct iphdr *iph = ip_hdr(skb);
272 + info.dst = iph->daddr;
273 + info.src = iph->saddr;
274 + if (!(iph->frag_off&htons(IP_MF|IP_OFFSET)) &&
275 + (iph->protocol == IPPROTO_TCP ||
276 + iph->protocol == IPPROTO_UDP ||
277 + iph->protocol == IPPROTO_SCTP ||
278 + iph->protocol == IPPROTO_DCCP ||
279 + iph->protocol == IPPROTO_ESP))
280 + info.proto = *(((u32*)iph) + iph->ihl);
282 + info.proto = iph->protocol;
285 + case __constant_htons(ETH_P_IPV6):
287 + struct ipv6hdr *iph = ipv6_hdr(skb);
288 + /* Hash ipv6 addresses into a u32. This isn't ideal,
289 + * but the code is simple. */
290 + info.dst = jhash2(iph->daddr.s6_addr32, 4, q->perturbation);
291 + info.src = jhash2(iph->saddr.s6_addr32, 4, q->perturbation);
292 + if (iph->nexthdr == IPPROTO_TCP ||
293 + iph->nexthdr == IPPROTO_UDP ||
294 + iph->nexthdr == IPPROTO_SCTP ||
295 + iph->nexthdr == IPPROTO_DCCP ||
296 + iph->nexthdr == IPPROTO_ESP)
297 + info.proto = *(u32*)&iph[1];
299 + info.proto = iph->nexthdr;
303 + info.dst = (u32)(unsigned long)skb->dst;
304 + info.src = (u32)(unsigned long)skb->sk;
305 + info.proto = skb->protocol;
308 + info.mark = skb->mark;
310 +#ifdef CONFIG_NF_CONNTRACK_ENABLED
311 + /* defaults if there is no conntrack info */
312 + info.ctorigsrc = info.src;
313 + info.ctorigdst = info.dst;
314 + info.ctreplsrc = info.dst;
315 + info.ctrepldst = info.src;
316 + /* collect conntrack info */
317 + if (ct && ct != &nf_conntrack_untracked) {
318 + if (skb->protocol == __constant_htons(ETH_P_IP)) {
319 + info.ctorigsrc = ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.u3.ip;
320 + info.ctorigdst = ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.u3.ip;
321 + info.ctreplsrc = ct->tuplehash[IP_CT_DIR_REPLY].tuple.src.u3.ip;
322 + info.ctrepldst = ct->tuplehash[IP_CT_DIR_REPLY].tuple.dst.u3.ip;
324 + else if (skb->protocol == __constant_htons(ETH_P_IPV6)) {
325 + /* Again, hash ipv6 addresses into a single u32. */
326 + info.ctorigsrc = jhash2(ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.u3.ip6, 4, q->perturbation);
327 + info.ctorigdst = jhash2(ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.u3.ip6, 4, q->perturbation);
328 + info.ctreplsrc = jhash2(ct->tuplehash[IP_CT_DIR_REPLY].tuple.src.u3.ip6, 4, q->perturbation);
329 + info.ctrepldst = jhash2(ct->tuplehash[IP_CT_DIR_REPLY].tuple.dst.u3.ip6, 4, q->perturbation);
335 + switch(q->hash_kind)
337 + case TCA_SFQ_HASH_CLASSIC:
338 + return esfq_jhash_3words(q, info.dst, info.src, info.proto);
339 + case TCA_SFQ_HASH_DST:
340 + return esfq_jhash_1word(q, info.dst);
341 + case TCA_SFQ_HASH_DSTDIR:
342 + return esfq_hash_direct(q, ntohl(info.dst));
343 + case TCA_SFQ_HASH_SRC:
344 + return esfq_jhash_1word(q, info.src);
345 + case TCA_SFQ_HASH_SRCDIR:
346 + return esfq_hash_direct(q, ntohl(info.src));
347 + case TCA_SFQ_HASH_FWMARK:
348 + return esfq_jhash_1word(q, info.mark);
349 + case TCA_SFQ_HASH_FWMARKDIR:
350 + return esfq_hash_direct(q, info.mark);
351 +#ifdef CONFIG_NF_CONNTRACK_ENABLED
352 + case TCA_SFQ_HASH_CTORIGDST:
353 + return esfq_jhash_1word(q, info.ctorigdst);
354 + case TCA_SFQ_HASH_CTORIGSRC:
355 + return esfq_jhash_1word(q, info.ctorigsrc);
356 + case TCA_SFQ_HASH_CTREPLDST:
357 + return esfq_jhash_1word(q, info.ctrepldst);
358 + case TCA_SFQ_HASH_CTREPLSRC:
359 + return esfq_jhash_1word(q, info.ctreplsrc);
362 + if (net_ratelimit())
363 + printk(KERN_WARNING "ESFQ: Unknown hash method. Falling back to classic.\n");
365 + return esfq_jhash_3words(q, info.dst, info.src, info.proto);
368 +static inline void esfq_link(struct esfq_sched_data *q, esfq_index x)
371 + int d = q->qs[x].qlen + q->depth;
374 + n = q->dep[d].next;
375 + q->dep[x].next = n;
376 + q->dep[x].prev = p;
377 + q->dep[p].next = q->dep[n].prev = x;
380 +static inline void esfq_dec(struct esfq_sched_data *q, esfq_index x)
384 + n = q->dep[x].next;
385 + p = q->dep[x].prev;
386 + q->dep[p].next = n;
387 + q->dep[n].prev = p;
389 + if (n == p && q->max_depth == q->qs[x].qlen + 1)
395 +static inline void esfq_inc(struct esfq_sched_data *q, esfq_index x)
400 + n = q->dep[x].next;
401 + p = q->dep[x].prev;
402 + q->dep[p].next = n;
403 + q->dep[n].prev = p;
405 + if (q->max_depth < d)
411 +static unsigned int esfq_drop(struct Qdisc *sch)
413 + struct esfq_sched_data *q = qdisc_priv(sch);
414 + esfq_index d = q->max_depth;
415 + struct sk_buff *skb;
418 + /* Queue is full! Find the longest slot and
419 + drop a packet from it */
422 + esfq_index x = q->dep[d+q->depth].next;
423 + skb = q->qs[x].prev;
425 + __skb_unlink(skb, &q->qs[x]);
429 + sch->qstats.drops++;
430 + sch->qstats.backlog -= len;
435 + /* It is difficult to believe, but ALL THE SLOTS HAVE LENGTH 1. */
436 + d = q->next[q->tail];
437 + q->next[q->tail] = q->next[d];
438 + q->allot[q->next[d]] += q->quantum;
439 + skb = q->qs[d].prev;
441 + __skb_unlink(skb, &q->qs[d]);
445 + q->ht[q->hash[d]] = q->depth;
446 + sch->qstats.drops++;
447 + sch->qstats.backlog -= len;
455 +esfq_enqueue(struct sk_buff *skb, struct Qdisc* sch)
457 + struct esfq_sched_data *q = qdisc_priv(sch);
458 + unsigned hash = esfq_hash(q, skb);
459 + unsigned depth = q->depth;
464 + q->ht[hash] = x = q->dep[depth].next;
467 + sch->qstats.backlog += skb->len;
468 + __skb_queue_tail(&q->qs[x], skb);
470 + if (q->qs[x].qlen == 1) { /* The flow is new */
471 + if (q->tail == depth) { /* It is the first flow */
474 + q->allot[x] = q->quantum;
476 + q->next[x] = q->next[q->tail];
477 + q->next[q->tail] = x;
481 + if (++sch->q.qlen < q->limit-1) {
482 + sch->bstats.bytes += skb->len;
483 + sch->bstats.packets++;
488 + return NET_XMIT_CN;
492 +esfq_requeue(struct sk_buff *skb, struct Qdisc* sch)
494 + struct esfq_sched_data *q = qdisc_priv(sch);
495 + unsigned hash = esfq_hash(q, skb);
496 + unsigned depth = q->depth;
501 + q->ht[hash] = x = q->dep[depth].next;
504 + sch->qstats.backlog += skb->len;
505 + __skb_queue_head(&q->qs[x], skb);
507 + if (q->qs[x].qlen == 1) { /* The flow is new */
508 + if (q->tail == depth) { /* It is the first flow */
511 + q->allot[x] = q->quantum;
513 + q->next[x] = q->next[q->tail];
514 + q->next[q->tail] = x;
518 + if (++sch->q.qlen < q->limit - 1) {
519 + sch->qstats.requeues++;
523 + sch->qstats.drops++;
525 + return NET_XMIT_CN;
531 +static struct sk_buff *
532 +esfq_dequeue(struct Qdisc* sch)
534 + struct esfq_sched_data *q = qdisc_priv(sch);
535 + struct sk_buff *skb;
536 + unsigned depth = q->depth;
537 + esfq_index a, old_a;
539 + /* No active slots */
540 + if (q->tail == depth)
543 + a = old_a = q->next[q->tail];
546 + skb = __skb_dequeue(&q->qs[a]);
549 + sch->qstats.backlog -= skb->len;
551 + /* Is the slot empty? */
552 + if (q->qs[a].qlen == 0) {
553 + q->ht[q->hash[a]] = depth;
559 + q->next[q->tail] = a;
560 + q->allot[a] += q->quantum;
561 + } else if ((q->allot[a] -= skb->len) <= 0) {
564 + q->allot[a] += q->quantum;
571 +esfq_reset(struct Qdisc* sch)
573 + struct sk_buff *skb;
575 + while ((skb = esfq_dequeue(sch)) != NULL)
579 +static void esfq_perturbation(unsigned long arg)
581 + struct Qdisc *sch = (struct Qdisc*)arg;
582 + struct esfq_sched_data *q = qdisc_priv(sch);
584 + q->perturbation = net_random()&0x1F;
586 + if (q->perturb_period) {
587 + q->perturb_timer.expires = jiffies + q->perturb_period;
588 + add_timer(&q->perturb_timer);
592 +static int esfq_change(struct Qdisc *sch, struct rtattr *opt)
594 + struct esfq_sched_data *q = qdisc_priv(sch);
595 + struct tc_esfq_qopt *ctl = RTA_DATA(opt);
596 + int old_perturb = q->perturb_period;
598 + if (opt->rta_len < RTA_LENGTH(sizeof(*ctl)))
601 + sch_tree_lock(sch);
602 + q->quantum = ctl->quantum ? : psched_mtu(sch->dev);
603 + q->perturb_period = ctl->perturb_period*HZ;
604 +// q->hash_divisor = ctl->divisor;
605 +// q->tail = q->limit = q->depth = ctl->flows;
608 + q->limit = min_t(u32, ctl->limit, q->depth);
610 + if (ctl->hash_kind) {
611 + q->hash_kind = ctl->hash_kind;
612 + if (q->hash_kind != TCA_SFQ_HASH_CLASSIC)
613 + q->perturb_period = 0;
616 + // is sch_tree_lock enough to do this ?
617 + while (sch->q.qlen >= q->limit-1)
621 + del_timer(&q->perturb_timer);
622 + if (q->perturb_period) {
623 + q->perturb_timer.expires = jiffies + q->perturb_period;
624 + add_timer(&q->perturb_timer);
626 + q->perturbation = 0;
628 + sch_tree_unlock(sch);
632 +static int esfq_init(struct Qdisc *sch, struct rtattr *opt)
634 + struct esfq_sched_data *q = qdisc_priv(sch);
635 + struct tc_esfq_qopt *ctl;
636 + esfq_index p = ~0U/2;
639 + if (opt && opt->rta_len < RTA_LENGTH(sizeof(*ctl)))
642 + init_timer(&q->perturb_timer);
643 + q->perturb_timer.data = (unsigned long)sch;
644 + q->perturb_timer.function = esfq_perturbation;
645 + q->perturbation = 0;
646 + q->hash_kind = TCA_SFQ_HASH_CLASSIC;
648 + q->dyn_min = ~0U; /* maximum value for this type */
649 + q->dyn_max = 0; /* dyn_min/dyn_max will be set properly upon first packet */
651 + q->quantum = psched_mtu(sch->dev);
652 + q->perturb_period = 0;
653 + q->hash_divisor = 1024;
654 + q->tail = q->limit = q->depth = 128;
657 + ctl = RTA_DATA(opt);
658 + q->quantum = ctl->quantum ? : psched_mtu(sch->dev);
659 + q->perturb_period = ctl->perturb_period*HZ;
660 + q->hash_divisor = ctl->divisor ? : 1024;
661 + q->tail = q->limit = q->depth = ctl->flows ? : 128;
663 + if ( q->depth > p - 1 )
667 + q->limit = min_t(u32, ctl->limit, q->depth);
669 + if (ctl->hash_kind) {
670 + q->hash_kind = ctl->hash_kind;
673 + if (q->perturb_period) {
674 + q->perturb_timer.expires = jiffies + q->perturb_period;
675 + add_timer(&q->perturb_timer);
679 + q->ht = kmalloc(q->hash_divisor*sizeof(esfq_index), GFP_KERNEL);
683 + q->dep = kmalloc((1+q->depth*2)*sizeof(struct esfq_head), GFP_KERNEL);
686 + q->next = kmalloc(q->depth*sizeof(esfq_index), GFP_KERNEL);
690 + q->allot = kmalloc(q->depth*sizeof(short), GFP_KERNEL);
693 + q->hash = kmalloc(q->depth*sizeof(unsigned short), GFP_KERNEL);
696 + q->qs = kmalloc(q->depth*sizeof(struct sk_buff_head), GFP_KERNEL);
700 + for (i=0; i< q->hash_divisor; i++)
701 + q->ht[i] = q->depth;
702 + for (i=0; i<q->depth; i++) {
703 + skb_queue_head_init(&q->qs[i]);
704 + q->dep[i+q->depth].next = i+q->depth;
705 + q->dep[i+q->depth].prev = i+q->depth;
708 + for (i=0; i<q->depth; i++)
712 + del_timer(&q->perturb_timer);
728 +static void esfq_destroy(struct Qdisc *sch)
730 + struct esfq_sched_data *q = qdisc_priv(sch);
731 + del_timer(&q->perturb_timer);
746 +static int esfq_dump(struct Qdisc *sch, struct sk_buff *skb)
748 + struct esfq_sched_data *q = qdisc_priv(sch);
749 + unsigned char *b = skb->tail;
750 + struct tc_esfq_qopt opt;
752 + opt.quantum = q->quantum;
753 + opt.perturb_period = q->perturb_period/HZ;
755 + opt.limit = q->limit;
756 + opt.divisor = q->hash_divisor;
757 + opt.flows = q->depth;
758 + opt.hash_kind = q->hash_kind;
760 + RTA_PUT(skb, TCA_OPTIONS, sizeof(opt), &opt);
765 + skb_trim(skb, b - skb->data);
769 +static struct Qdisc_ops esfq_qdisc_ops =
774 + .priv_size = sizeof(struct esfq_sched_data),
775 + .enqueue = esfq_enqueue,
776 + .dequeue = esfq_dequeue,
777 + .requeue = esfq_requeue,
780 + .reset = esfq_reset,
781 + .destroy = esfq_destroy,
782 + .change = NULL, /* esfq_change - needs more work */
784 + .owner = THIS_MODULE,
787 +static int __init esfq_module_init(void)
789 + return register_qdisc(&esfq_qdisc_ops);
791 +static void __exit esfq_module_exit(void)
793 + unregister_qdisc(&esfq_qdisc_ops);
795 +module_init(esfq_module_init)
796 +module_exit(esfq_module_exit)
797 +MODULE_LICENSE("GPL");