diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-07-19 15:38:47 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-07-19 15:38:47 -0700 |
commit | 15a87b2ebfcba1b9ffe9f978a41c666d22e4e631 (patch) | |
tree | 1c24fff8a836f3b114816bf555cddeb58bc0345c | |
parent | 4d2c46571d8979e317d117d1d0d969c8cf34acc1 (diff) | |
parent | e83b813fe1fba0735db2b080948144de3e337ce5 (diff) | |
download | vyatta-cfg-qos-15a87b2ebfcba1b9ffe9f978a41c666d22e4e631.tar.gz vyatta-cfg-qos-15a87b2ebfcba1b9ffe9f978a41c666d22e4e631.zip |
Merge branch 'larkspur' of vm:git/vyatta-cfg-qos into larkspur
-rw-r--r-- | lib/Vyatta/Qos/ShaperClass.pm | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/Vyatta/Qos/ShaperClass.pm b/lib/Vyatta/Qos/ShaperClass.pm index 361eb57..439e404 100644 --- a/lib/Vyatta/Qos/ShaperClass.pm +++ b/lib/Vyatta/Qos/ShaperClass.pm @@ -116,6 +116,19 @@ sub rateCheck { $rate / 1000; exit 1; } + + my $qlimit = $self->{_limit}; + if (defined($qlimit) && $self->{_qdisc} eq 'random-detect') { + my $avg = 1024; + my $qmax = ( $rate * 100 ) / 8000; + if ($qlimit * $avg < $qmax) { + print STDERR "Configuration error in: $level\n"; + printf STDERR +"The queue limit (%d) is too small, must be greater than %d when using random-detect\n", + $level, $qmax / $avg; + exit 1; + } + } } sub prioQdisc { @@ -171,6 +184,8 @@ sub redQdisc { my $avg = 1024; my $qmax = (defined $rate) ? (( $rate * 100 ) / 8000) : (18 * $avg); my $qmin = $qmax / 3; + $qmin = $avg if $qmin < $avg; + my $burst = ( 2 * $qmin + $qmax ) / (3 * $avg); my $limit = $self->{_limit}; my $qlimit = (defined $limit) ? ($limit * $avg) : (4 * $qmax); |