aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/sch_netem.c
diff options
context:
space:
mode:
authorHagen Paul Pfeifer <hagen@jauu.net>2013-10-22 17:27:06 -0400
committerDavid S. Miller <davem@davemloft.net>2013-10-25 19:03:39 -0400
commit4a3ad7b3eade08ad1c760aaa4fe06a36f2584939 (patch)
tree0006fbd7b270176d09bd80e6c7095e380c693571 /net/sched/sch_netem.c
parentb45bd46decd947eaa3497699d450e0851d247534 (diff)
netem: markov loss model transition fix
The transition from markov state "3 => lost packets within a burst period" to "1 => successfully transmitted packets within a gap period" has no *additional* loss event. The loss already happen for transition from 1 -> 3, this additional loss will make things go wild. E.g. transition probabilities: p13: 10% p31: 100% Expected: Ploss = p13 / (p13 + p31) Ploss = ~9.09% ... but it isn't. Even worse: we get a double loss - each time. So simple don't return true to indicate loss, rather break and return false. Signed-off-by: Hagen Paul Pfeifer <hagen@jauu.net> Cc: Stephen Hemminger <stephen@networkplumber.org> Cc: Eric Dumazet <edumazet@google.com> Cc: Stefano Salsano <stefano.salsano@uniroma2.it> Cc: Fabio Ludovici <fabio.ludovici@yahoo.it> Signed-off-by: Hagen Paul Pfeifer <hagen@jauu.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_netem.c')
-rw-r--r--net/sched/sch_netem.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c
index b87e83d07478..75c94e59a3bd 100644
--- a/net/sched/sch_netem.c
+++ b/net/sched/sch_netem.c
@@ -235,7 +235,6 @@ static bool loss_4state(struct netem_sched_data *q)
235 clg->state = 2; 235 clg->state = 2;
236 else if (clg->a3 < rnd && rnd < clg->a2 + clg->a3) { 236 else if (clg->a3 < rnd && rnd < clg->a2 + clg->a3) {
237 clg->state = 1; 237 clg->state = 1;
238 return true;
239 } else if (clg->a2 + clg->a3 < rnd) { 238 } else if (clg->a2 + clg->a3 < rnd) {
240 clg->state = 3; 239 clg->state = 3;
241 return true; 240 return true;