From: Hagen Paul Pfeifer Date: Tue, 22 Oct 2013 21:27:06 +0000 (+0200) Subject: netem: markov loss model transition fix X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4a3ad7b3eade08ad1c760aaa4fe06a36f2584939;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Cc: Stephen Hemminger Cc: Eric Dumazet Cc: Stefano Salsano Cc: Fabio Ludovici Signed-off-by: Hagen Paul Pfeifer Signed-off-by: David S. Miller --- 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) clg->state = 2; else if (clg->a3 < rnd && rnd < clg->a2 + clg->a3) { clg->state = 1; - return true; } else if (clg->a2 + clg->a3 < rnd) { clg->state = 3; return true;