diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-08-17 16:56:43 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-08-17 17:04:12 -0700 |
commit | 6348298f5acd634158eb749a4775965b2d705d48 (patch) | |
tree | da6a06d7c5b9ed28bdfa4a6a18dcb480058d97dd /lib/Vyatta/Qos | |
parent | 45d1bc301a1231e6879e3d30a9054c0a16b3e939 (diff) | |
download | vyatta-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.pm | 9 |
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"; |