summaryrefslogtreecommitdiff
path: root/lib/Vyatta/Qos/WeightedRandom.pm
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2009-05-22 15:19:01 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2009-05-22 15:19:01 -0700
commita7ec99d913b0169b987a4ebdf2d26a36670b20bb (patch)
tree2d3163146d662a3b778a8cb67962c032a465a420 /lib/Vyatta/Qos/WeightedRandom.pm
parentd226558aab489fd5d5abf7ead370d713beb80656 (diff)
downloadvyatta-cfg-qos-a7ec99d913b0169b987a4ebdf2d26a36670b20bb.tar.gz
vyatta-cfg-qos-a7ec99d913b0169b987a4ebdf2d26a36670b20bb.zip
Use better RED parameters
Use recommendations from Sally Floyd.
Diffstat (limited to 'lib/Vyatta/Qos/WeightedRandom.pm')
-rw-r--r--lib/Vyatta/Qos/WeightedRandom.pm13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/Vyatta/Qos/WeightedRandom.pm b/lib/Vyatta/Qos/WeightedRandom.pm
index 99f9b9e..0b1dc37 100644
--- a/lib/Vyatta/Qos/WeightedRandom.pm
+++ b/lib/Vyatta/Qos/WeightedRandom.pm
@@ -102,7 +102,7 @@ sub commands {
# fill in id of default
$default->{id} = ++$maxid;
- unshift @$classes, $default;
+ push @$classes, $default;
print "qdisc add dev $dev handle 1: root gred";
printf " setup DPs %d default %d\n", $maxid+1, $maxid;
@@ -112,15 +112,16 @@ sub commands {
my $avg = $class->{_avgpkt};
my $latency = getTime( $class->{_latency} );
- my ( $qmin, $qmax, $burst ) = RedParam( $classbw, $latency, $avg );
+ my ( $qmin, $qmax, $burst, $maxp )
+ = RedParam( $classbw, $latency, $avg );
print "qdisc change dev $dev root gred";
- printf " limit %d min %d max %d avpkt %d",
- 4 * $qmax, $qmin, $qmax, $avg;
+ printf " prio %d", $class->{_priority} if $class->{_priority};
+ printf " limit %d min %d max %d avpkt %d probability %f",
+ 4 * $qmax, $qmin, $qmax, $avg, $maxp;
printf " burst %d bandwidth %d DP %d",
$burst, $rate, $class->{id};
- printf " prio %d", $class->{_priority} if $class->{_priority};
- print " probability 0.02\n";
+ print " probability 0.1\n";
foreach my $match ( $class->matchRules() ) {
$match->filter( $dev, 1, $class->{_priority} );