diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-07-20 15:13:58 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-07-20 15:16:49 -0700 |
commit | d05887ea055bec73773f71edec4f88491b0b9043 (patch) | |
tree | 80a080b779c1869ea14550df97548a4361a1d4be /lib/Vyatta/Qos | |
parent | 71b9bb01926ee220b73fb3135c5e7f5de9c80023 (diff) | |
download | vyatta-cfg-qos-d05887ea055bec73773f71edec4f88491b0b9043.tar.gz vyatta-cfg-qos-d05887ea055bec73773f71edec4f88491b0b9043.zip |
Fix random-detect queue to small message
Give correct message when queue limit too small in random detect
Diffstat (limited to 'lib/Vyatta/Qos')
-rw-r--r-- | lib/Vyatta/Qos/ShaperClass.pm | 8 |
1 files changed, 4 insertions, 4 deletions
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; } |