summaryrefslogtreecommitdiff
path: root/lib/Vyatta/Qos
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2010-08-17 16:56:43 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2010-08-17 17:04:12 -0700
commit6348298f5acd634158eb749a4775965b2d705d48 (patch)
treeda6a06d7c5b9ed28bdfa4a6a18dcb480058d97dd /lib/Vyatta/Qos
parent45d1bc301a1231e6879e3d30a9054c0a16b3e939 (diff)
downloadvyatta-cfg-qos-6348298f5acd634158eb749a4775965b2d705d48.tar.gz
vyatta-cfg-qos-6348298f5acd634158eb749a4775965b2d705d48.zip
Fix shaper class queue calculations for random-detect
Need to handle queue-limit better (confusion between bytes and packets) Bug 5872 (cherry picked from commit 94ea365fc966a16807a2086db05ea2877e9b00fa)
Diffstat (limited to 'lib/Vyatta/Qos')
-rw-r--r--lib/Vyatta/Qos/ShaperClass.pm9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/Vyatta/Qos/ShaperClass.pm b/lib/Vyatta/Qos/ShaperClass.pm
index b84b057..cc42f44 100644
--- a/lib/Vyatta/Qos/ShaperClass.pm
+++ b/lib/Vyatta/Qos/ShaperClass.pm
@@ -123,7 +123,7 @@ sub sfqValidate {
if ( defined $limit && $limit > 127 ) {
print STDERR "Configuration error in: $level\n";
- die "queue limit must be between 1 and 127 for random-detect\n";
+ die "queue limit must be between 1 and 127 for queue-type fair-queue\n";
}
}
@@ -173,8 +173,9 @@ sub redQdisc {
sub redValidate {
my ( $self, $level, $rate ) = @_;
- my $limit = $self->{_limit};
- my $qmax = int((redQsize($rate) + AVGPKT - 1) / AVGPKT);
+ my $limit = $self->{_limit}; # packets
+ my $thresh = redQsize($rate); # bytes
+ my $qmax = POSIX::ceil($thresh / AVGPKT); # packets
if ( defined($limit) && $limit < $qmax ) {
print STDERR "Configuration error in: $level\n";
@@ -184,7 +185,7 @@ sub redValidate {
exit 1;
}
- if ( $qmax < 3 * AVGPKT ) {
+ if ( $qmax < 3 ) {
my $minbw = ( 3 * AVGPKT * 8 ) / LATENCY;
print STDERR "Configuration error in: $level\n";