summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2010-07-19 16:14:50 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2010-07-19 16:14:50 -0700
commitf9588ae279118a7c600266b64df77b3ac0a3d25e (patch)
tree7dee554a1da42ab05cd1c2d3d7dd31e6d7514e73
parent15a87b2ebfcba1b9ffe9f978a41c666d22e4e631 (diff)
parent410e94afe308549e097137f4ef3241ebcf1d4ed5 (diff)
downloadvyatta-cfg-qos-f9588ae279118a7c600266b64df77b3ac0a3d25e.tar.gz
vyatta-cfg-qos-f9588ae279118a7c600266b64df77b3ac0a3d25e.zip
Merge branch 'larkspur' of vm:git/vyatta-cfg-qos into larkspur
-rw-r--r--lib/Vyatta/Qos/ShaperClass.pm17
1 files changed, 14 insertions, 3 deletions
diff --git a/lib/Vyatta/Qos/ShaperClass.pm b/lib/Vyatta/Qos/ShaperClass.pm
index 439e404..6b474e6 100644
--- a/lib/Vyatta/Qos/ShaperClass.pm
+++ b/lib/Vyatta/Qos/ShaperClass.pm
@@ -117,17 +117,28 @@ sub rateCheck {
exit 1;
}
- my $qlimit = $self->{_limit};
- if (defined($qlimit) && $self->{_qdisc} eq 'random-detect') {
+ if ($self->{_qdisc} eq 'random-detect') {
my $avg = 1024;
my $qmax = ( $rate * 100 ) / 8000;
- if ($qlimit * $avg < $qmax) {
+ my $qlimit = $self->{_limit};
+ if (defined($qlimit) && $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;
}
+
+ # The assumptions about average packet size and allowable latency
+ # result in limit on available bandwidth
+ #
+ # 2 * Avg pkt = (BW * Latency) / 8 bit/byte
+ # 16K bits = BW * .1 sec
+ if ($qmax < $avg) {
+ print STDERR "Configuration error in: $level\n";
+ die
+"Random-detect queue type requires effective bandwidth of 160 Kbit/sec or greater\n";
+ }
}
}