aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/codel.h
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2012-05-16 00:39:09 -0400
committerDavid S. Miller <davem@davemloft.net>2012-05-16 15:30:26 -0400
commit865ec5523dadbedefbc5710a68969f686a28d928 (patch)
treeb9f056cdea6922d5fc3ed035764660bb6fb152b3 /include/net/codel.h
parentc27b46e7f1cbf3be95a4cf5840c76a7b7d54b26f (diff)
fq_codel: should use qdisc backlog as threshold
codel_should_drop() logic allows a packet being not dropped if queue size is under max packet size. In fq_codel, we have two possible backlogs : The qdisc global one, and the flow local one. The meaningful one for codel_should_drop() should be the global backlog, not the per flow one, so that thin flows can have a non zero drop/mark probability. Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: Dave Taht <dave.taht@bufferbloat.net> Cc: Kathleen Nichols <nichols@pollere.com> Cc: Van Jacobson <van@pollere.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/codel.h')
-rw-r--r--include/net/codel.h15
1 files changed, 7 insertions, 8 deletions
diff --git a/include/net/codel.h b/include/net/codel.h
index 7546517326b5..550debfc2403 100644
--- a/include/net/codel.h
+++ b/include/net/codel.h
@@ -205,7 +205,7 @@ static codel_time_t codel_control_law(codel_time_t t,
205 205
206 206
207static bool codel_should_drop(const struct sk_buff *skb, 207static bool codel_should_drop(const struct sk_buff *skb,
208 unsigned int *backlog, 208 struct Qdisc *sch,
209 struct codel_vars *vars, 209 struct codel_vars *vars,
210 struct codel_params *params, 210 struct codel_params *params,
211 struct codel_stats *stats, 211 struct codel_stats *stats,
@@ -219,13 +219,13 @@ static bool codel_should_drop(const struct sk_buff *skb,
219 } 219 }
220 220
221 vars->ldelay = now - codel_get_enqueue_time(skb); 221 vars->ldelay = now - codel_get_enqueue_time(skb);
222 *backlog -= qdisc_pkt_len(skb); 222 sch->qstats.backlog -= qdisc_pkt_len(skb);
223 223
224 if (unlikely(qdisc_pkt_len(skb) > stats->maxpacket)) 224 if (unlikely(qdisc_pkt_len(skb) > stats->maxpacket))
225 stats->maxpacket = qdisc_pkt_len(skb); 225 stats->maxpacket = qdisc_pkt_len(skb);
226 226
227 if (codel_time_before(vars->ldelay, params->target) || 227 if (codel_time_before(vars->ldelay, params->target) ||
228 *backlog <= stats->maxpacket) { 228 sch->qstats.backlog <= stats->maxpacket) {
229 /* went below - stay below for at least interval */ 229 /* went below - stay below for at least interval */
230 vars->first_above_time = 0; 230 vars->first_above_time = 0;
231 return false; 231 return false;
@@ -249,8 +249,7 @@ static struct sk_buff *codel_dequeue(struct Qdisc *sch,
249 struct codel_params *params, 249 struct codel_params *params,
250 struct codel_vars *vars, 250 struct codel_vars *vars,
251 struct codel_stats *stats, 251 struct codel_stats *stats,
252 codel_skb_dequeue_t dequeue_func, 252 codel_skb_dequeue_t dequeue_func)
253 u32 *backlog)
254{ 253{
255 struct sk_buff *skb = dequeue_func(vars, sch); 254 struct sk_buff *skb = dequeue_func(vars, sch);
256 codel_time_t now; 255 codel_time_t now;
@@ -261,7 +260,7 @@ static struct sk_buff *codel_dequeue(struct Qdisc *sch,
261 return skb; 260 return skb;
262 } 261 }
263 now = codel_get_time(); 262 now = codel_get_time();
264 drop = codel_should_drop(skb, backlog, vars, params, stats, now); 263 drop = codel_should_drop(skb, sch, vars, params, stats, now);
265 if (vars->dropping) { 264 if (vars->dropping) {
266 if (!drop) { 265 if (!drop) {
267 /* sojourn time below target - leave dropping state */ 266 /* sojourn time below target - leave dropping state */
@@ -292,7 +291,7 @@ static struct sk_buff *codel_dequeue(struct Qdisc *sch,
292 qdisc_drop(skb, sch); 291 qdisc_drop(skb, sch);
293 stats->drop_count++; 292 stats->drop_count++;
294 skb = dequeue_func(vars, sch); 293 skb = dequeue_func(vars, sch);
295 if (!codel_should_drop(skb, backlog, 294 if (!codel_should_drop(skb, sch,
296 vars, params, stats, now)) { 295 vars, params, stats, now)) {
297 /* leave dropping state */ 296 /* leave dropping state */
298 vars->dropping = false; 297 vars->dropping = false;
@@ -313,7 +312,7 @@ static struct sk_buff *codel_dequeue(struct Qdisc *sch,
313 stats->drop_count++; 312 stats->drop_count++;
314 313
315 skb = dequeue_func(vars, sch); 314 skb = dequeue_func(vars, sch);
316 drop = codel_should_drop(skb, backlog, vars, params, 315 drop = codel_should_drop(skb, sch, vars, params,
317 stats, now); 316 stats, now);
318 } 317 }
319 vars->dropping = true; 318 vars->dropping = true;