diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2012-01-06 01:31:44 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-01-12 23:05:28 -0500 |
commit | ddecf0f4db44ef94847a62d6ecf74456b4dcc66f (patch) | |
tree | 48c49b70f83d713c7e3f594e067ee726bb70777e /include/linux/pkt_sched.h | |
parent | 72092cc45378176ba700034c91b7af2db524df26 (diff) |
net_sched: sfq: add optional RED on top of SFQ
Adds an optional Random Early Detection on each SFQ flow queue.
Traditional SFQ limits count of packets, while RED permits to also
control number of bytes per flow, and adds ECN capability as well.
1) We dont handle the idle time management in this RED implementation,
since each 'new flow' begins with a null qavg. We really want to address
backlogged flows.
2) if headdrop is selected, we try to ecn mark first packet instead of
currently enqueued packet. This gives faster feedback for tcp flows
compared to traditional RED [ marking the last packet in queue ]
Example of use :
tc qdisc add dev $DEV parent 1:1 handle 10: est 1sec 4sec sfq \
limit 3000 headdrop flows 512 divisor 16384 \
redflowlimit 100000 min 8000 max 60000 probability 0.20 ecn
qdisc sfq 10: parent 1:1 limit 3000p quantum 1514b depth 127 headdrop
flows 512/16384 divisor 16384
ewma 6 min 8000b max 60000b probability 0.2 ecn
prob_mark 0 prob_mark_head 4876 prob_drop 6131
forced_mark 0 forced_mark_head 0 forced_drop 0
Sent 1175211782 bytes 777537 pkt (dropped 6131, overlimits 11007
requeues 0)
rate 99483Kbit 8219pps backlog 689392b 456p requeues 0
In this test, with 64 netperf TCP_STREAM sessions, 50% using ECN enabled
flows, we can see number of packets CE marked is smaller than number of
drops (for non ECN flows)
If same test is run, without RED, we can check backlog is much bigger.
qdisc sfq 10: parent 1:1 limit 3000p quantum 1514b depth 127 headdrop
flows 512/16384 divisor 16384
Sent 1148683617 bytes 795006 pkt (dropped 0, overlimits 0 requeues 0)
rate 98429Kbit 8521pps backlog 1221290b 841p requeues 0
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Stephen Hemminger <shemminger@vyatta.com>
CC: Dave Taht <dave.taht@gmail.com>
Tested-by: Dave Taht <dave.taht@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/pkt_sched.h')
-rw-r--r-- | include/linux/pkt_sched.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/linux/pkt_sched.h b/include/linux/pkt_sched.h index 8f1b928f777c..0d5b79365d03 100644 --- a/include/linux/pkt_sched.h +++ b/include/linux/pkt_sched.h | |||
@@ -162,10 +162,30 @@ struct tc_sfq_qopt { | |||
162 | unsigned flows; /* Maximal number of flows */ | 162 | unsigned flows; /* Maximal number of flows */ |
163 | }; | 163 | }; |
164 | 164 | ||
165 | struct tc_sfqred_stats { | ||
166 | __u32 prob_drop; /* Early drops, below max threshold */ | ||
167 | __u32 forced_drop; /* Early drops, after max threshold */ | ||
168 | __u32 prob_mark; /* Marked packets, below max threshold */ | ||
169 | __u32 forced_mark; /* Marked packets, after max threshold */ | ||
170 | __u32 prob_mark_head; /* Marked packets, below max threshold */ | ||
171 | __u32 forced_mark_head;/* Marked packets, after max threshold */ | ||
172 | }; | ||
173 | |||
165 | struct tc_sfq_qopt_v1 { | 174 | struct tc_sfq_qopt_v1 { |
166 | struct tc_sfq_qopt v0; | 175 | struct tc_sfq_qopt v0; |
167 | unsigned int depth; /* max number of packets per flow */ | 176 | unsigned int depth; /* max number of packets per flow */ |
168 | unsigned int headdrop; | 177 | unsigned int headdrop; |
178 | /* SFQRED parameters */ | ||
179 | __u32 limit; /* HARD maximal flow queue length (bytes) */ | ||
180 | __u32 qth_min; /* Min average length threshold (bytes) */ | ||
181 | __u32 qth_max; /* Max average length threshold (bytes) */ | ||
182 | unsigned char Wlog; /* log(W) */ | ||
183 | unsigned char Plog; /* log(P_max/(qth_max-qth_min)) */ | ||
184 | unsigned char Scell_log; /* cell size for idle damping */ | ||
185 | unsigned char flags; | ||
186 | __u32 max_P; /* probability, high resolution */ | ||
187 | /* SFQRED stats */ | ||
188 | struct tc_sfqred_stats stats; | ||
169 | }; | 189 | }; |
170 | 190 | ||
171 | 191 | ||