summaryrefslogtreecommitdiff
path: root/lib/Vyatta/Qos
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2009-06-09 11:08:38 -0700
committerStephen Hemminger <shemminger@lenny.localdomain>2009-10-01 13:51:19 -0700
commit6cf4217e392eb4c0956804b1ba66874de68fbd5e (patch)
tree8e70ebca83711fe654c2736c80ab57295fb2a68f /lib/Vyatta/Qos
parent5e0d337e371773e81059f5f2513c6f430c3d8e4c (diff)
downloadvyatta-cfg-qos-6cf4217e392eb4c0956804b1ba66874de68fbd5e.tar.gz
vyatta-cfg-qos-6cf4217e392eb4c0956804b1ba66874de68fbd5e.zip
Allow setting queue limit and average packet size
Two more (optional) parameters for random detect precedence groups. Bug 4518,4519 (cherry picked from commit 8104da09f5da338c6ce0813c367262de4e417598)
Diffstat (limited to 'lib/Vyatta/Qos')
-rw-r--r--lib/Vyatta/Qos/RandomDetect.pm29
1 files changed, 18 insertions, 11 deletions
diff --git a/lib/Vyatta/Qos/RandomDetect.pm b/lib/Vyatta/Qos/RandomDetect.pm
index 1918711..663abc2 100644
--- a/lib/Vyatta/Qos/RandomDetect.pm
+++ b/lib/Vyatta/Qos/RandomDetect.pm
@@ -31,14 +31,14 @@ use Vyatta::Qos::Util qw/getRate getAutoRate getTime/;
# default values for different precedence levels
my @default_fields = (
- { 'min-threshold' => 9, 'max-threshold' => 18, 'mark-probability' => 1/2 },
- { 'min-threshold' => 10, 'max-threshold' => 18, 'mark-probability' => 5/9 },
- { 'min-threshold' => 11, 'max-threshold' => 18, 'mark-probability' => .1 },
- { 'min-threshold' => 12, 'max-threshold' => 18, 'mark-probability' => 2/3 },
- { 'min-threshold' => 13, 'max-threshold' => 18, 'mark-probability' => .1 },
- { 'min-threshold' => 14, 'max-threshold' => 18, 'mark-probability' => 7/9 },
- { 'min-threshold' => 15, 'max-threshold' => 18, 'mark-probability' => 5/6 },
- { 'min-threshold' => 16, 'max-threshold' => 18, 'mark-probability' => 8/9 },
+ { 'min-threshold' => 9, 'mark-probability' => 1/2 },
+ { 'min-threshold' => 10, 'mark-probability' => 5/9 },
+ { 'min-threshold' => 11, 'mark-probability' => .1 },
+ { 'min-threshold' => 12, 'mark-probability' => 2/3 },
+ { 'min-threshold' => 13, 'mark-probability' => .1 },
+ { 'min-threshold' => 14, 'mark-probability' => 7/9 },
+ { 'min-threshold' => 15, 'mark-probability' => 5/6 },
+ { 'min-threshold' => 16, 'mark-probability' => 8/9 },
);
# Create a new instance based on config information
@@ -69,8 +69,8 @@ sub getPrecedence {
my $defaults = $default_fields[$i];
my %param;
- $config->setLevel("$level precedence $i");
- foreach my $field (keys %$defaults) {
+ foreach my $field (qw(max-threshold average-packet queue-limit),
+ keys %$defaults) {
my $val = $config->returnValue($field);
if ( !defined $val ) {
@@ -116,10 +116,17 @@ sub commands {
my $param = $precedence->[$i];
my $qmin = $param->{'min-threshold'};
my $qmax = $param->{'max-threshold'};
+ my $qlimit = $param->{'queue-limit'};
+ my $avgpkt = $param->{'average-packet'};
my $prob = $param->{'mark-probability'};
+ $qmax = 18 unless $qmax;
+ $avgpkt = 1024 unless $avgpkt;
+ $qlimit = 4 * $qmax unless $qlimit;
+
printf "qdisc change dev %s handle %x:0 gred", $dev, $root+1, $i;
- printf " limit %dK min %dK max %dK avpkt 1K", 4 * $qmax, $qmin, $qmax;
+ printf " limit %d min %d max %d avpkt %d",
+ $qlimit * $avgpkt, $qmin * $avgpkt, $qmax * $avgpkt, $avgpkt;
printf " burst %d bandwidth %d probability %f DP %d prio %d\n",
( 2 * $qmin + $qmax ) / 3, $rate, $prob, $i, 8-$i;
}