* [PATCH net 1/3] netem: missing break in ge loss generator
@ 2013-11-29 19:02 Stephen Hemminger
2013-11-29 19:03 ` [PATCH net 2/3] netem: fix loss 4 state model Stephen Hemminger
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Stephen Hemminger @ 2013-11-29 19:02 UTC (permalink / raw)
To: David Miller, Martin Burri, Hagen Paul Pfeifer; +Cc: netdev
There is a missing break statement in the Gilbert Elliot loss model
generator which makes state machine behave incorrectly.
Reported-by: Martin Burri <martin.burri@ch.abb.com
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
--- a/net/sched/sch_netem.c 2013-11-29 10:40:59.687678738 -0800
+++ b/net/sched/sch_netem.c 2013-11-29 10:46:33.972003879 -0800
@@ -268,6 +268,7 @@ static bool loss_gilb_ell(struct netem_s
clg->state = 2;
if (net_random() < clg->a4)
return true;
+ break;
case 2:
if (net_random() < clg->a2)
clg->state = 1;
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH net 2/3] netem: fix loss 4 state model
2013-11-29 19:02 [PATCH net 1/3] netem: missing break in ge loss generator Stephen Hemminger
@ 2013-11-29 19:03 ` Stephen Hemminger
2013-11-30 17:50 ` David Miller
2013-11-29 19:04 ` [PATCH net 3/3] netem: fix gemodel loss generator Stephen Hemminger
2013-11-30 17:49 ` [PATCH net 1/3] netem: missing break in ge " David Miller
2 siblings, 1 reply; 6+ messages in thread
From: Stephen Hemminger @ 2013-11-29 19:03 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: David Miller, Martin Burri, Hagen Paul Pfeifer, netdev
Patch from developers of the alternative loss models, downloaded from:
http://netgroup.uniroma2.it/twiki/bin/view.cgi/Main/NetemCLG
"In the case 1 of the switch statement in the if conditions we
need to add clg->a4 to clg->a1, according to the model."
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
--- a/net/sched/sch_netem.c 2013-11-29 10:55:30.591077393 -0800
+++ b/net/sched/sch_netem.c 2013-11-29 10:58:49.441419081 -0800
@@ -215,10 +215,10 @@ static bool loss_4state(struct netem_sch
if (rnd < clg->a4) {
clg->state = 4;
return true;
- } else if (clg->a4 < rnd && rnd < clg->a1) {
+ } else if (clg->a4 < rnd && rnd < clg->a1 + clg->a4) {
clg->state = 3;
return true;
- } else if (clg->a1 < rnd)
+ } else if (clg->a1 + clg->a4 < rnd)
clg->state = 1;
break;
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH net 3/3] netem: fix gemodel loss generator
2013-11-29 19:02 [PATCH net 1/3] netem: missing break in ge loss generator Stephen Hemminger
2013-11-29 19:03 ` [PATCH net 2/3] netem: fix loss 4 state model Stephen Hemminger
@ 2013-11-29 19:04 ` Stephen Hemminger
2013-11-30 17:50 ` David Miller
2013-11-30 17:49 ` [PATCH net 1/3] netem: missing break in ge " David Miller
2 siblings, 1 reply; 6+ messages in thread
From: Stephen Hemminger @ 2013-11-29 19:04 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: David Miller, Martin Burri, Hagen Paul Pfeifer, netdev
Patch from developers of the alternative loss models, downloaded from:
http://netgroup.uniroma2.it/twiki/bin/view.cgi/Main/NetemCLG
"in case 2, of the switch we change the direction of the inequality to
net_random()>clg->a3, because clg->a3 is h in the GE model and when h
is 0 all packets will be lost."
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
--- a/net/sched/sch_netem.c 2013-11-29 10:58:49.441419081 -0800
+++ b/net/sched/sch_netem.c 2013-11-29 10:58:55.313369015 -0800
@@ -272,7 +272,7 @@ static bool loss_gilb_ell(struct netem_s
case 2:
if (net_random() < clg->a2)
clg->state = 1;
- if (clg->a3 > net_random())
+ if (net_random() > clg->a3)
return true;
}
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net 1/3] netem: missing break in ge loss generator
2013-11-29 19:02 [PATCH net 1/3] netem: missing break in ge loss generator Stephen Hemminger
2013-11-29 19:03 ` [PATCH net 2/3] netem: fix loss 4 state model Stephen Hemminger
2013-11-29 19:04 ` [PATCH net 3/3] netem: fix gemodel loss generator Stephen Hemminger
@ 2013-11-30 17:49 ` David Miller
2 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2013-11-30 17:49 UTC (permalink / raw)
To: stephen; +Cc: martin.burri, hagen, netdev
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Fri, 29 Nov 2013 11:02:43 -0800
> There is a missing break statement in the Gilbert Elliot loss model
> generator which makes state machine behave incorrectly.
>
> Reported-by: Martin Burri <martin.burri@ch.abb.com
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Applied.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net 2/3] netem: fix loss 4 state model
2013-11-29 19:03 ` [PATCH net 2/3] netem: fix loss 4 state model Stephen Hemminger
@ 2013-11-30 17:50 ` David Miller
0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2013-11-30 17:50 UTC (permalink / raw)
To: stephen; +Cc: martin.burri, hagen, netdev
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Fri, 29 Nov 2013 11:03:35 -0800
> Patch from developers of the alternative loss models, downloaded from:
> http://netgroup.uniroma2.it/twiki/bin/view.cgi/Main/NetemCLG
>
> "In the case 1 of the switch statement in the if conditions we
> need to add clg->a4 to clg->a1, according to the model."
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Applied.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net 3/3] netem: fix gemodel loss generator
2013-11-29 19:04 ` [PATCH net 3/3] netem: fix gemodel loss generator Stephen Hemminger
@ 2013-11-30 17:50 ` David Miller
0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2013-11-30 17:50 UTC (permalink / raw)
To: stephen; +Cc: martin.burri, hagen, netdev
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Fri, 29 Nov 2013 11:04:26 -0800
> Patch from developers of the alternative loss models, downloaded from:
> http://netgroup.uniroma2.it/twiki/bin/view.cgi/Main/NetemCLG
>
> "in case 2, of the switch we change the direction of the inequality to
> net_random()>clg->a3, because clg->a3 is h in the GE model and when h
> is 0 all packets will be lost."
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Applied.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-11-30 17:50 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-29 19:02 [PATCH net 1/3] netem: missing break in ge loss generator Stephen Hemminger
2013-11-29 19:03 ` [PATCH net 2/3] netem: fix loss 4 state model Stephen Hemminger
2013-11-30 17:50 ` David Miller
2013-11-29 19:04 ` [PATCH net 3/3] netem: fix gemodel loss generator Stephen Hemminger
2013-11-30 17:50 ` David Miller
2013-11-30 17:49 ` [PATCH net 1/3] netem: missing break in ge " David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).