<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/net/sched/Makefile, branch linux-3.12.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.12.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.12.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2013-08-30T01:38:31Z</updated>
<entry>
<title>pkt_sched: fq: Fair Queue packet scheduler</title>
<updated>2013-08-30T01:38:31Z</updated>
<author>
<name>Eric Dumazet</name>
</author>
<published>2013-08-29T22:49:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=afe4fd062416b158a8a8538b23adc1930a9b88dc'/>
<id>urn:sha1:afe4fd062416b158a8a8538b23adc1930a9b88dc</id>
<content type='text'>
- Uses perfect flow match (not stochastic hash like SFQ/FQ_codel)
- Uses the new_flow/old_flow separation from FQ_codel
- New flows get an initial credit allowing IW10 without added delay.
- Special FIFO queue for high prio packets (no need for PRIO + FQ)
- Uses a hash table of RB trees to locate the flows at enqueue() time
- Smart on demand gc (at enqueue() time, RB tree lookup evicts old
  unused flows)
- Dynamic memory allocations.
- Designed to allow millions of concurrent flows per Qdisc.
- Small memory footprint : ~8K per Qdisc, and 104 bytes per flow.
- Single high resolution timer for throttled flows (if any).
- One RB tree to link throttled flows.
- Ability to have a max rate per flow. We might add a socket option
  to add per socket limitation.

Attempts have been made to add TCP pacing in TCP stack, but this
seems to add complex code to an already complex stack.

TCP pacing is welcomed for flows having idle times, as the cwnd
permits TCP stack to queue a possibly large number of packets.

This removes the 'slow start after idle' choice, hitting badly
large BDP flows, and applications delivering chunks of data
as video streams.

Nicely spaced packets :
Here interface is 10Gbit, but flow bottleneck is ~20Mbit

cwin is big, yet FQ avoids the typical bursts generated by TCP
(as in netperf TCP_RR -- -r 100000,100000)

15:01:23.545279 IP A &gt; B: . 78193:81089(2896) ack 65248 win 3125 &lt;nop,nop,timestamp 1115 11597805&gt;
15:01:23.545394 IP B &gt; A: . ack 81089 win 3668 &lt;nop,nop,timestamp 11597985 1115&gt;
15:01:23.546488 IP A &gt; B: . 81089:83985(2896) ack 65248 win 3125 &lt;nop,nop,timestamp 1115 11597805&gt;
15:01:23.546565 IP B &gt; A: . ack 83985 win 3668 &lt;nop,nop,timestamp 11597986 1115&gt;
15:01:23.547713 IP A &gt; B: . 83985:86881(2896) ack 65248 win 3125 &lt;nop,nop,timestamp 1115 11597805&gt;
15:01:23.547778 IP B &gt; A: . ack 86881 win 3668 &lt;nop,nop,timestamp 11597987 1115&gt;
15:01:23.548911 IP A &gt; B: . 86881:89777(2896) ack 65248 win 3125 &lt;nop,nop,timestamp 1115 11597805&gt;
15:01:23.548949 IP B &gt; A: . ack 89777 win 3668 &lt;nop,nop,timestamp 11597988 1115&gt;
15:01:23.550116 IP A &gt; B: . 89777:92673(2896) ack 65248 win 3125 &lt;nop,nop,timestamp 1115 11597805&gt;
15:01:23.550182 IP B &gt; A: . ack 92673 win 3668 &lt;nop,nop,timestamp 11597989 1115&gt;
15:01:23.551333 IP A &gt; B: . 92673:95569(2896) ack 65248 win 3125 &lt;nop,nop,timestamp 1115 11597805&gt;
15:01:23.551406 IP B &gt; A: . ack 95569 win 3668 &lt;nop,nop,timestamp 11597991 1115&gt;
15:01:23.552539 IP A &gt; B: . 95569:98465(2896) ack 65248 win 3125 &lt;nop,nop,timestamp 1115 11597805&gt;
15:01:23.552576 IP B &gt; A: . ack 98465 win 3668 &lt;nop,nop,timestamp 11597992 1115&gt;
15:01:23.553756 IP A &gt; B: . 98465:99913(1448) ack 65248 win 3125 &lt;nop,nop,timestamp 1115 11597805&gt;
15:01:23.554138 IP A &gt; B: P 99913:100001(88) ack 65248 win 3125 &lt;nop,nop,timestamp 1115 11597805&gt;
15:01:23.554204 IP B &gt; A: . ack 100001 win 3668 &lt;nop,nop,timestamp 11597993 1115&gt;
15:01:23.554234 IP B &gt; A: . 65248:68144(2896) ack 100001 win 3668 &lt;nop,nop,timestamp 11597993 1115&gt;
15:01:23.555620 IP B &gt; A: . 68144:71040(2896) ack 100001 win 3668 &lt;nop,nop,timestamp 11597993 1115&gt;
15:01:23.557005 IP B &gt; A: . 71040:73936(2896) ack 100001 win 3668 &lt;nop,nop,timestamp 11597993 1115&gt;
15:01:23.558390 IP B &gt; A: . 73936:76832(2896) ack 100001 win 3668 &lt;nop,nop,timestamp 11597993 1115&gt;
15:01:23.559773 IP B &gt; A: . 76832:79728(2896) ack 100001 win 3668 &lt;nop,nop,timestamp 11597993 1115&gt;
15:01:23.561158 IP B &gt; A: . 79728:82624(2896) ack 100001 win 3668 &lt;nop,nop,timestamp 11597994 1115&gt;
15:01:23.562543 IP B &gt; A: . 82624:85520(2896) ack 100001 win 3668 &lt;nop,nop,timestamp 11597994 1115&gt;
15:01:23.563928 IP B &gt; A: . 85520:88416(2896) ack 100001 win 3668 &lt;nop,nop,timestamp 11597994 1115&gt;
15:01:23.565313 IP B &gt; A: . 88416:91312(2896) ack 100001 win 3668 &lt;nop,nop,timestamp 11597994 1115&gt;
15:01:23.566698 IP B &gt; A: . 91312:94208(2896) ack 100001 win 3668 &lt;nop,nop,timestamp 11597994 1115&gt;
15:01:23.568083 IP B &gt; A: . 94208:97104(2896) ack 100001 win 3668 &lt;nop,nop,timestamp 11597994 1115&gt;
15:01:23.569467 IP B &gt; A: . 97104:100000(2896) ack 100001 win 3668 &lt;nop,nop,timestamp 11597994 1115&gt;
15:01:23.570852 IP B &gt; A: . 100000:102896(2896) ack 100001 win 3668 &lt;nop,nop,timestamp 11597994 1115&gt;
15:01:23.572237 IP B &gt; A: . 102896:105792(2896) ack 100001 win 3668 &lt;nop,nop,timestamp 11597994 1115&gt;
15:01:23.573639 IP B &gt; A: . 105792:108688(2896) ack 100001 win 3668 &lt;nop,nop,timestamp 11597994 1115&gt;
15:01:23.575024 IP B &gt; A: . 108688:111584(2896) ack 100001 win 3668 &lt;nop,nop,timestamp 11597994 1115&gt;
15:01:23.576408 IP B &gt; A: . 111584:114480(2896) ack 100001 win 3668 &lt;nop,nop,timestamp 11597994 1115&gt;
15:01:23.577793 IP B &gt; A: . 114480:117376(2896) ack 100001 win 3668 &lt;nop,nop,timestamp 11597994 1115&gt;

TCP timestamps show that most packets from B were queued in the same ms
timeframe (TSval 1159799{3,4}), but FQ managed to send them right
in time to avoid a big burst.

In slow start or steady state, very few packets are throttled [1]

FQ gets a bunch of tunables as :

  limit : max number of packets on whole Qdisc (default 10000)

  flow_limit : max number of packets per flow (default 100)

  quantum : the credit per RR round (default is 2 MTU)

  initial_quantum : initial credit for new flows (default is 10 MTU)

  maxrate : max per flow rate (default : unlimited)

  buckets : number of RB trees (default : 1024) in hash table.
               (consumes 8 bytes per bucket)

  [no]pacing : disable/enable pacing (default is enable)

All of them can be changed on a live qdisc.

$ tc qd add dev eth0 root fq help
Usage: ... fq [ limit PACKETS ] [ flow_limit PACKETS ]
              [ quantum BYTES ] [ initial_quantum BYTES ]
              [ maxrate RATE  ] [ buckets NUMBER ]
              [ [no]pacing ]

$ tc -s -d qd
qdisc fq 8002: dev eth0 root refcnt 32 limit 10000p flow_limit 100p buckets 256 quantum 3028 initial_quantum 15140
 Sent 216532416 bytes 148395 pkt (dropped 0, overlimits 0 requeues 14)
 backlog 0b 0p requeues 14
  511 flows, 511 inactive, 0 throttled
  110 gc, 0 highprio, 0 retrans, 1143 throttled, 0 flows_plimit

[1] Except if initial srtt is overestimated, as if using
cached srtt in tcp metrics. We'll provide a fix for this issue.

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Cc: Yuchung Cheng &lt;ycheng@google.com&gt;
Cc: Neal Cardwell &lt;ncardwell@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: sched: add ipset ematch</title>
<updated>2012-07-12T14:54:46Z</updated>
<author>
<name>Florian Westphal</name>
</author>
<published>2012-07-11T10:56:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6d4fa852a023080101f1665ea189dd1844c87fef'/>
<id>urn:sha1:6d4fa852a023080101f1665ea189dd1844c87fef</id>
<content type='text'>
Can be used to match packets against netfilter ip sets created via ipset(8).
skb-&gt;sk_iif is used as 'incoming interface', skb-&gt;dev is 'outgoing interface'.

Since ipset is usually called from netfilter, the ematch
initializes a fake xt_action_param, pulls the ip header into the
linear area and also sets skb-&gt;data to the IP header (otherwise
matching Layer 4 set types doesn't work).

Tested-by: Mr Dash Four &lt;mr.dash.four@googlemail.com&gt;
Signed-off-by: Florian Westphal &lt;fw@strlen.de&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: em_canid: Ematch rule to match CAN frames according to their identifiers</title>
<updated>2012-07-04T11:07:05Z</updated>
<author>
<name>Rostislav Lisovy</name>
</author>
<published>2012-07-04T03:32:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f057bbb6f9ed0fb61ea11105c9ef0ed5ac1a354d'/>
<id>urn:sha1:f057bbb6f9ed0fb61ea11105c9ef0ed5ac1a354d</id>
<content type='text'>
This ematch makes it possible to classify CAN frames (AF_CAN) according
to their identifiers. This functionality can not be easily achieved with
existing classifiers, such as u32, because CAN identifier is always stored
in native endianness, whereas u32 expects Network byte order.

Signed-off-by: Rostislav Lisovy &lt;lisovy@gmail.com&gt;
Signed-off-by: Oliver Hartkopp &lt;socketcan@hartkopp.net&gt;
Signed-off-by: Marc Kleine-Budde &lt;mkl@pengutronix.de&gt;
</content>
</entry>
<entry>
<title>fq_codel: Fair Queue Codel AQM</title>
<updated>2012-05-12T19:53:42Z</updated>
<author>
<name>Eric Dumazet</name>
</author>
<published>2012-05-11T09:30:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4b549a2ef4bef9965d97cbd992ba67930cd3e0fe'/>
<id>urn:sha1:4b549a2ef4bef9965d97cbd992ba67930cd3e0fe</id>
<content type='text'>
Fair Queue Codel packet scheduler

Principles :

- Packets are classified (internal classifier or external) on flows.
- This is a Stochastic model (as we use a hash, several flows might
                              be hashed on same slot)
- Each flow has a CoDel managed queue.
- Flows are linked onto two (Round Robin) lists,
  so that new flows have priority on old ones.

- For a given flow, packets are not reordered (CoDel uses a FIFO)
- head drops only.
- ECN capability is on by default.
- Very low memory footprint (64 bytes per flow)

tc qdisc ... fq_codel [ limit PACKETS ] [ flows number ]
                      [ target TIME ] [ interval TIME ] [ noecn ]
                      [ quantum BYTES ]

defaults : 1024 flows, 10240 packets limit, quantum : device MTU
           target : 5ms (CoDel default)
           interval : 100ms (CoDel default)

Impressive results on load :

class htb 1:1 root leaf 10: prio 0 quantum 1514 rate 200000Kbit ceil 200000Kbit burst 1475b/8 mpu 0b overhead 0b cburst 1475b/8 mpu 0b overhead 0b level 0
 Sent 43304920109 bytes 33063109 pkt (dropped 0, overlimits 0 requeues 0)
 rate 201691Kbit 28595pps backlog 0b 312p requeues 0
 lended: 33063109 borrowed: 0 giants: 0
 tokens: -912 ctokens: -912

class fq_codel 10:1735 parent 10:
 (dropped 1292, overlimits 0 requeues 0)
 backlog 15140b 10p requeues 0
  deficit 1514 count 1 lastcount 1 ldelay 7.1ms
class fq_codel 10:4524 parent 10:
 (dropped 1291, overlimits 0 requeues 0)
 backlog 16654b 11p requeues 0
  deficit 1514 count 1 lastcount 1 ldelay 7.1ms
class fq_codel 10:4e74 parent 10:
 (dropped 1290, overlimits 0 requeues 0)
 backlog 6056b 4p requeues 0
  deficit 1514 count 1 lastcount 1 ldelay 6.4ms dropping drop_next 92.0ms
class fq_codel 10:628a parent 10:
 (dropped 1289, overlimits 0 requeues 0)
 backlog 7570b 5p requeues 0
  deficit 1514 count 1 lastcount 1 ldelay 5.4ms dropping drop_next 90.9ms
class fq_codel 10:a4b3 parent 10:
 (dropped 302, overlimits 0 requeues 0)
 backlog 16654b 11p requeues 0
  deficit 1514 count 1 lastcount 1 ldelay 7.1ms
class fq_codel 10:c3c2 parent 10:
 (dropped 1284, overlimits 0 requeues 0)
 backlog 13626b 9p requeues 0
  deficit 1514 count 1 lastcount 1 ldelay 5.9ms
class fq_codel 10:d331 parent 10:
 (dropped 299, overlimits 0 requeues 0)
 backlog 15140b 10p requeues 0
  deficit 1514 count 1 lastcount 1 ldelay 7.0ms
class fq_codel 10:d526 parent 10:
 (dropped 12160, overlimits 0 requeues 0)
 backlog 35870b 211p requeues 0
  deficit 1508 count 12160 lastcount 1 ldelay 15.3ms dropping drop_next 247us
class fq_codel 10:e2c6 parent 10:
 (dropped 1288, overlimits 0 requeues 0)
 backlog 15140b 10p requeues 0
  deficit 1514 count 1 lastcount 1 ldelay 7.1ms
class fq_codel 10:eab5 parent 10:
 (dropped 1285, overlimits 0 requeues 0)
 backlog 16654b 11p requeues 0
  deficit 1514 count 1 lastcount 1 ldelay 5.9ms
class fq_codel 10:f220 parent 10:
 (dropped 1289, overlimits 0 requeues 0)
 backlog 15140b 10p requeues 0
  deficit 1514 count 1 lastcount 1 ldelay 7.1ms

qdisc htb 1: root refcnt 6 r2q 10 default 1 direct_packets_stat 0 ver 3.17
 Sent 43331086547 bytes 33092812 pkt (dropped 0, overlimits 66063544 requeues 71)
 rate 201697Kbit 28602pps backlog 0b 260p requeues 71
qdisc fq_codel 10: parent 1:1 limit 10240p flows 65536 target 5.0ms interval 100.0ms ecn
 Sent 43331086547 bytes 33092812 pkt (dropped 949359, overlimits 0 requeues 0)
 rate 201697Kbit 28602pps backlog 189352b 260p requeues 0
  maxpacket 1514 drop_overlimit 0 new_flow_count 5582 ecn_mark 125593
  new_flows_len 0 old_flows_len 11

PING 172.30.42.18 (172.30.42.18) 56(84) bytes of data.
64 bytes from 172.30.42.18: icmp_req=1 ttl=64 time=0.227 ms
64 bytes from 172.30.42.18: icmp_req=2 ttl=64 time=0.165 ms
64 bytes from 172.30.42.18: icmp_req=3 ttl=64 time=0.166 ms
64 bytes from 172.30.42.18: icmp_req=4 ttl=64 time=0.151 ms
64 bytes from 172.30.42.18: icmp_req=5 ttl=64 time=0.164 ms
64 bytes from 172.30.42.18: icmp_req=6 ttl=64 time=0.172 ms
64 bytes from 172.30.42.18: icmp_req=7 ttl=64 time=0.175 ms
64 bytes from 172.30.42.18: icmp_req=8 ttl=64 time=0.183 ms
64 bytes from 172.30.42.18: icmp_req=9 ttl=64 time=0.158 ms
64 bytes from 172.30.42.18: icmp_req=10 ttl=64 time=0.200 ms

10 packets transmitted, 10 received, 0% packet loss, time 8999ms
rtt min/avg/max/mdev = 0.151/0.176/0.227/0.022 ms

Much better than SFQ because of priority given to new flows, and fast
path dirtying less cache lines.

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>codel: Controlled Delay AQM</title>
<updated>2012-05-11T03:35:02Z</updated>
<author>
<name>Eric Dumazet</name>
</author>
<published>2012-05-10T07:51:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=76e3cc126bb223013a6b9a0e2a51238d1ef2e409'/>
<id>urn:sha1:76e3cc126bb223013a6b9a0e2a51238d1ef2e409</id>
<content type='text'>
An implementation of CoDel AQM, from Kathleen Nichols and Van Jacobson.

http://queue.acm.org/detail.cfm?id=2209336

This AQM main input is no longer queue size in bytes or packets, but the
delay packets stay in (FIFO) queue.

As we don't have infinite memory, we still can drop packets in enqueue()
in case of massive load, but mean of CoDel is to drop packets in
dequeue(), using a control law based on two simple parameters :

target : target sojourn time (default 5ms)
interval : width of moving time window (default 100ms)

Based on initial work from Dave Taht.

Refactored to help future codel inclusion as a plugin for other linux
qdisc (FQ_CODEL, ...), like RED.

include/net/codel.h contains codel algorithm as close as possible than
Kathleen reference.

net/sched/sch_codel.c contains the linux qdisc specific glue.

Separate structures permit a memory efficient implementation of fq_codel
(to be sent as a separate work) : Each flow has its own struct
codel_vars.

timestamps are taken at enqueue() time with 1024 ns precision, allowing
a range of 2199 seconds in queue, and 100Gb links support. iproute2 uses
usec as base unit.

Selected packets are dropped, unless ECN is enabled and packets can get
ECN mark instead.

Tested from 2Mb to 10Gb speeds with no particular problems, on ixgbe and
tg3 drivers (BQL enabled).

Usage: tc qdisc ... codel [ limit PACKETS ] [ target TIME ]
                          [ interval TIME ] [ ecn ]

qdisc codel 10: parent 1:1 limit 2000p target 3.0ms interval 60.0ms ecn
 Sent 13347099587 bytes 8815805 pkt (dropped 0, overlimits 0 requeues 0)
 rate 202365Kbit 16708pps backlog 113550b 75p requeues 0
  count 116 lastcount 98 ldelay 4.3ms dropping drop_next 816us
  maxpacket 1514 ecn_mark 84399 drop_overlimit 0

CoDel must be seen as a base module, and should be used keeping in mind
there is still a FIFO queue. So a typical setup will probably need a
hierarchy of several qdiscs and packet classifiers to be able to meet
whatever constraints a user might have.

One possible example would be to use fq_codel, which combines Fair
Queueing and CoDel, in replacement of sfq / sfq_red.

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: Dave Taht &lt;dave.taht@bufferbloat.net&gt;
Cc: Kathleen Nichols &lt;nichols@pollere.com&gt;
Cc: Van Jacobson &lt;van@pollere.net&gt;
Cc: Tom Herbert &lt;therbert@google.com&gt;
Cc: Matt Mathis &lt;mattmathis@google.com&gt;
Cc: Yuchung Cheng &lt;ycheng@google.com&gt;
Cc: Stephen Hemminger &lt;shemminger@vyatta.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net/sched: sch_plug - Queue traffic until an explicit release command</title>
<updated>2012-02-07T17:54:56Z</updated>
<author>
<name>Shriram Rajagopalan</name>
</author>
<published>2012-02-05T13:51:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c3059be16c9ef29c05f0876a9df5fea21f29724f'/>
<id>urn:sha1:c3059be16c9ef29c05f0876a9df5fea21f29724f</id>
<content type='text'>
The qdisc supports two operations - plug and unplug. When the
qdisc receives a plug command via netlink request, packets arriving
henceforth are buffered until a corresponding unplug command is received.
Depending on the type of unplug command, the queue can be unplugged
indefinitely or selectively.

This qdisc can be used to implement output buffering, an essential
functionality required for consistent recovery in checkpoint based
fault-tolerance systems. Output buffering enables speculative execution
by allowing generated network traffic to be rolled back. It is used to
provide network protection for Xen Guests in the Remus high availability
project, available as part of Xen.

This module is generic enough to be used by any other system that wishes
to add speculative execution and output buffering to its applications.

This module was originally available in the linux 2.6.32 PV-OPS tree,
used as dom0 for Xen.

For more information, please refer to http://nss.cs.ubc.ca/remus/
and http://wiki.xensource.com/xenwiki/Remus

Changes in V3:
  * Removed debug output (printk) on queue overflow
  * Added TCQ_PLUG_RELEASE_INDEFINITE - that allows the user to
    use this qdisc, for simple plug/unplug operations.
  * Use of packet counts instead of pointers to keep track of
    the buffers in the queue.

Signed-off-by: Shriram Rajagopalan &lt;rshriram@cs.ubc.ca&gt;
Signed-off-by: Brendan Cully &lt;brendan@cs.ubc.ca&gt;
[author of the code in the linux 2.6.32 pvops tree]
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>pkt_sched: QFQ - quick fair queue scheduler</title>
<updated>2011-04-04T18:10:24Z</updated>
<author>
<name>stephen hemminger</name>
</author>
<published>2011-04-04T05:30:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0545a3037773512d3448557ba048cebb73b3e4af'/>
<id>urn:sha1:0545a3037773512d3448557ba048cebb73b3e4af</id>
<content type='text'>
This is an implementation of the Quick Fair Queue scheduler developed
by Fabio Checconi. The same algorithm is already implemented in ipfw
in FreeBSD. Fabio had an earlier version developed on Linux, I just
cleaned it up.  Thanks to Eric Dumazet for testing this under load.

Signed-off-by: Stephen Hemminger &lt;shemminger@vyatta.com&gt;
Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net_sched: SFB flow scheduler</title>
<updated>2011-02-23T22:05:11Z</updated>
<author>
<name>Eric Dumazet</name>
</author>
<published>2011-02-23T10:56:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e13e02a3c68d899169c78d9a18689bd73491d59a'/>
<id>urn:sha1:e13e02a3c68d899169c78d9a18689bd73491d59a</id>
<content type='text'>
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 &gt; 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 &amp; Andi Kleen

Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
CC: Juliusz Chroboczek &lt;Juliusz.Chroboczek@pps.jussieu.fr&gt;
CC: Stephen Hemminger &lt;shemminger@vyatta.com&gt;
CC: Patrick McHardy &lt;kaber@trash.net&gt;
CC: Andi Kleen &lt;andi@firstfloor.org&gt;
CC: John W. Linville &lt;linville@tuxdriver.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>sched: CHOKe flow scheduler</title>
<updated>2011-02-03T04:52:42Z</updated>
<author>
<name>stephen hemminger</name>
</author>
<published>2011-02-02T15:21:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=45e144339ac59971eb44be32e1282760aaabe861'/>
<id>urn:sha1:45e144339ac59971eb44be32e1282760aaabe861</id>
<content type='text'>
CHOKe ("CHOose and Kill" or "CHOose and Keep") is an alternative
packet scheduler based on the Random Exponential Drop (RED) algorithm.

The core idea is:
  For every packet arrival:
  	Calculate Qave
	if (Qave &lt; minth)
	     Queue the new packet
	else
	     Select randomly a packet from the queue
	     if (both packets from same flow)
	     then Drop both the packets
	     else if (Qave &gt; maxth)
	          Drop packet
	     else
	       	  Admit packet with proability p (same as RED)

See also:
  Rong Pan, Balaji Prabhakar, Konstantinos Psounis, "CHOKe: a stateless active
   queue management scheme for approximating fair bandwidth allocation",
  Proceeding of INFOCOM'2000, March 2000.

Help from:
     Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
     Patrick McHardy &lt;kaber@trash.net&gt;

Signed-off-by: Stephen Hemminger &lt;shemminger@vyatta.com&gt;
Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net_sched: implement a root container qdisc sch_mqprio</title>
<updated>2011-01-20T07:31:11Z</updated>
<author>
<name>John Fastabend</name>
</author>
<published>2011-01-17T08:06:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b8970f0bfc78103cb74c66055de7379b15097840'/>
<id>urn:sha1:b8970f0bfc78103cb74c66055de7379b15097840</id>
<content type='text'>
This implements a mqprio queueing discipline that by default creates
a pfifo_fast qdisc per tx queue and provides the needed configuration
interface.

Using the mqprio qdisc the number of tcs currently in use along
with the range of queues alloted to each class can be configured. By
default skbs are mapped to traffic classes using the skb priority.
This mapping is configurable.

Configurable parameters,

struct tc_mqprio_qopt {
	__u8    num_tc;
	__u8    prio_tc_map[TC_BITMASK + 1];
	__u8    hw;
	__u16   count[TC_MAX_QUEUE];
	__u16   offset[TC_MAX_QUEUE];
};

Here the count/offset pairing give the queue alignment and the
prio_tc_map gives the mapping from skb-&gt;priority to tc.

The hw bit determines if the hardware should configure the count
and offset values. If the hardware bit is set then the operation
will fail if the hardware does not implement the ndo_setup_tc
operation. This is to avoid undetermined states where the hardware
may or may not control the queue mapping. Also minimal bounds
checking is done on the count/offset to verify a queue does not
exceed num_tx_queues and that queue ranges do not overlap. Otherwise
it is left to user policy or hardware configuration to create
useful mappings.

It is expected that hardware QOS schemes can be implemented by
creating appropriate mappings of queues in ndo_tc_setup().

One expected use case is drivers will use the ndo_setup_tc to map
queue ranges onto 802.1Q traffic classes. This provides a generic
mechanism to map network traffic onto these traffic classes and
removes the need for lower layer drivers to know specifics about
traffic types.

Signed-off-by: John Fastabend &lt;john.r.fastabend@intel.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
