linux/net/sched
Eric Dumazet e13e02a3c6 net_sched: SFB flow scheduler
This is the Stochastic Fair Blue scheduler, based on work from :

W. Feng, D. Kandlur, D. Saha, K. Shin. Blue: A New Class of Active Queue
Management Algorithms. U. Michigan CSE-TR-387-99, April 1999.

http://www.thefengs.com/wuchang/blue/CSE-TR-387-99.pdf

This implementation is based on work done by Juliusz Chroboczek

General SFB algorithm can be found in figure 14, page 15:

B[l][n] : L x N array of bins (L levels, N bins per level)
enqueue()
Calculate hash function values h{0}, h{1}, .. h{L-1}
Update bins at each level
for i = 0 to L - 1
   if (B[i][h{i}].qlen > bin_size)
      B[i][h{i}].p_mark += p_increment;
   else if (B[i][h{i}].qlen == 0)
      B[i][h{i}].p_mark -= p_decrement;
p_min = min(B[0][h{0}].p_mark ... B[L-1][h{L-1}].p_mark);
if (p_min == 1.0)
    ratelimit();
else
    mark/drop with probabilty p_min;

I did the adaptation of Juliusz code to meet current kernel standards,
and various changes to address previous comments :

http://thread.gmane.org/gmane.linux.network/90225
http://thread.gmane.org/gmane.linux.network/90375

Default flow classifier is the rxhash introduced by RPS in 2.6.35, but
we can use an external flow classifier if wanted.

tc qdisc add dev $DEV parent 1:11 handle 11:  \
        est 0.5sec 2sec sfb limit 128

tc filter add dev $DEV protocol ip parent 11: handle 3 \
        flow hash keys dst divisor 1024

Notes:

1) SFB default child qdisc is pfifo_fast. It can be changed by another
qdisc but a child qdisc MUST not drop a packet previously queued. This
is because SFB needs to handle a dequeued packet in order to maintain
its virtual queue states. pfifo_head_drop or CHOKe should not be used.

2) ECN is enabled by default, unlike RED/CHOKe/GRED

With help from Patrick McHardy & Andi Kleen

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Juliusz Chroboczek <Juliusz.Chroboczek@pps.jussieu.fr>
CC: Stephen Hemminger <shemminger@vyatta.com>
CC: Patrick McHardy <kaber@trash.net>
CC: Andi Kleen <andi@firstfloor.org>
CC: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-02-23 14:05:11 -08:00
..
act_api.c net_sched: cleanups 2011-01-19 23:31:12 -08:00
act_csum.c net_sched: cleanups 2011-01-19 23:31:12 -08:00
act_gact.c net_sched: cleanups 2011-01-19 23:31:12 -08:00
act_ipt.c net_sched: cleanups 2011-01-19 23:31:12 -08:00
act_mirred.c net_sched: cleanups 2011-01-19 23:31:12 -08:00
act_nat.c net_sched: cleanups 2011-01-19 23:31:12 -08:00
act_pedit.c net_sched: cleanups 2011-01-19 23:31:12 -08:00
act_police.c net_sched: cleanups 2011-01-19 23:31:12 -08:00
act_simple.c net_sched: cleanups 2011-01-19 23:31:12 -08:00
act_skbedit.c net_sched: cleanups 2011-01-19 23:31:12 -08:00
cls_api.c net_sched: cleanups 2011-01-19 23:31:12 -08:00
cls_basic.c net_sched: cleanups 2011-01-19 23:31:12 -08:00
cls_cgroup.c net_sched: cleanups 2011-01-19 23:31:12 -08:00
cls_flow.c Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-next-2.6 2011-01-20 00:06:15 -08:00
cls_fw.c net_sched: cleanups 2011-01-19 23:31:12 -08:00
cls_route.c net_sched: cleanups 2011-01-19 23:31:12 -08:00
cls_rsvp6.c [NET_SCHED]: Remove unnecessary includes 2007-07-10 22:16:41 -07:00
cls_rsvp.c [NET_SCHED]: Remove unnecessary includes 2007-07-10 22:16:41 -07:00
cls_rsvp.h net_sched: cleanups 2011-01-19 23:31:12 -08:00
cls_tcindex.c net_sched: cleanups 2011-01-19 23:31:12 -08:00
cls_u32.c cls_u32: fix sparse warnings 2011-02-22 11:22:33 -08:00
em_cmp.c net_sched: cleanups 2011-01-19 23:31:12 -08:00
em_meta.c Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-next-2.6 2011-01-20 00:06:15 -08:00
em_nbyte.c net_sched: cleanups 2011-01-19 23:31:12 -08:00
em_text.c net_sched: cleanups 2011-01-19 23:31:12 -08:00
em_u32.c net_sched: cleanups 2011-01-19 23:31:12 -08:00
ematch.c net_sched: cleanups 2011-01-19 23:31:12 -08:00
Kconfig net_sched: SFB flow scheduler 2011-02-23 14:05:11 -08:00
Makefile net_sched: SFB flow scheduler 2011-02-23 14:05:11 -08:00
sch_api.c net_sched: RCU conversion of stab 2011-01-20 16:59:32 -08:00
sch_atm.c net_sched: cleanups 2011-01-19 23:31:12 -08:00
sch_blackhole.c pkt_sched: Add qdisc->ops->peek() implementation. 2008-10-31 00:45:55 -07:00
sch_cbq.c Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2011-01-24 14:09:35 -08:00
sch_choke.c sch_choke: Need linux/vmalloc.h 2011-02-02 23:06:31 -08:00
sch_drr.c net_sched: accurate bytes/packets stats/rates 2011-01-20 23:31:33 -08:00
sch_dsmark.c Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2011-01-24 14:09:35 -08:00
sch_fifo.c Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2011-01-24 14:09:35 -08:00
sch_generic.c net_sched: TCQ_F_CAN_BYPASS generalization 2011-01-21 16:26:09 -08:00
sch_gred.c net_sched: cleanups 2011-01-19 23:31:12 -08:00
sch_hfsc.c Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2011-01-24 14:09:35 -08:00
sch_htb.c Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2011-01-24 14:09:35 -08:00
sch_ingress.c net_sched: factorize qdisc stats handling 2011-01-10 16:07:54 -08:00
sch_mq.c net_sched: TCQ_F_CAN_BYPASS generalization 2011-01-21 16:26:09 -08:00
sch_mqprio.c sch_mqprio: Always set num_tc to 0 in mqprio_destroy() 2011-02-14 19:07:58 +00:00
sch_multiq.c Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2011-01-24 14:09:35 -08:00
sch_netem.c Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2011-01-24 14:09:35 -08:00
sch_prio.c Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2011-01-24 14:09:35 -08:00
sch_red.c Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2011-01-24 14:09:35 -08:00
sch_sfb.c net_sched: SFB flow scheduler 2011-02-23 14:05:11 -08:00
sch_sfq.c sfq: deadlock in error path 2011-02-02 20:51:20 -08:00
sch_tbf.c Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2011-01-24 14:09:35 -08:00
sch_teql.c Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2011-01-24 14:09:35 -08:00