From d05887ea055bec73773f71edec4f88491b0b9043 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Tue, 20 Jul 2010 15:13:58 -0700 Subject: Fix random-detect queue to small message Give correct message when queue limit too small in random detect --- lib/Vyatta/Qos/ShaperClass.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/Vyatta/Qos') diff --git a/lib/Vyatta/Qos/ShaperClass.pm b/lib/Vyatta/Qos/ShaperClass.pm index 464c58d..a495863 100644 --- a/lib/Vyatta/Qos/ShaperClass.pm +++ b/lib/Vyatta/Qos/ShaperClass.pm @@ -173,13 +173,13 @@ sub redQdisc { sub redValidate { my ( $self, $level, $rate ) = @_; my $limit = $self->{_limit}; - my $qmax = redQsize($rate); + my $qmax = int((redQsize($rate) + AVGPKT - 1) / AVGPKT); - if ( defined($limit) && $limit * AVGPKT < $qmax ) { + if ( defined($limit) && $limit < $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 / AVGPKT; +"The queue limit (%d) is too small, must be %d or more when using random-detect\n", + $limit, $qmax; exit 1; } -- cgit v1.2.3