diff options
author | Eric Dumazet <edumazet@google.com> | 2012-07-29 16:52:21 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-08-10 19:52:54 -0400 |
commit | 2359a47671fc4fb0fe5e9945f76c2cb10792c0f8 (patch) | |
tree | 2ff0ca201a2797f26414dcfe5df90ededb94375b /include | |
parent | 55461ddbcb0b36d1575e01fb4f130c609ca1cfee (diff) |
codel: refine one condition to avoid a nul rec_inv_sqrt
One condition before codel_Newton_step() was not good if
we never left the dropping state for a flow. As a result
rec_inv_sqrt was 0, instead of the ~0 initial value.
codel control law was then set to a very aggressive mode, dropping
many packets before reaching 'target' and recovering from this problem.
To keep codel_vars_init() as efficient as possible, refine
the condition to make sure rec_inv_sqrt initial value is correct
Many thanks to Anton Mich for discovering the issue and suggesting
a fix.
Reported-by: Anton Mich <lp2s1h@gmail.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/codel.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/include/net/codel.h b/include/net/codel.h index 550debfc2403..389cf621161d 100644 --- a/include/net/codel.h +++ b/include/net/codel.h | |||
@@ -305,6 +305,8 @@ static struct sk_buff *codel_dequeue(struct Qdisc *sch, | |||
305 | } | 305 | } |
306 | } | 306 | } |
307 | } else if (drop) { | 307 | } else if (drop) { |
308 | u32 delta; | ||
309 | |||
308 | if (params->ecn && INET_ECN_set_ce(skb)) { | 310 | if (params->ecn && INET_ECN_set_ce(skb)) { |
309 | stats->ecn_mark++; | 311 | stats->ecn_mark++; |
310 | } else { | 312 | } else { |
@@ -320,9 +322,11 @@ static struct sk_buff *codel_dequeue(struct Qdisc *sch, | |||
320 | * assume that the drop rate that controlled the queue on the | 322 | * assume that the drop rate that controlled the queue on the |
321 | * last cycle is a good starting point to control it now. | 323 | * last cycle is a good starting point to control it now. |
322 | */ | 324 | */ |
323 | if (codel_time_before(now - vars->drop_next, | 325 | delta = vars->count - vars->lastcount; |
326 | if (delta > 1 && | ||
327 | codel_time_before(now - vars->drop_next, | ||
324 | 16 * params->interval)) { | 328 | 16 * params->interval)) { |
325 | vars->count = (vars->count - vars->lastcount) | 1; | 329 | vars->count = delta; |
326 | /* we dont care if rec_inv_sqrt approximation | 330 | /* we dont care if rec_inv_sqrt approximation |
327 | * is not very precise : | 331 | * is not very precise : |
328 | * Next Newton steps will correct it quadratically. | 332 | * Next Newton steps will correct it quadratically. |