summaryrefslogtreecommitdiff
path: root/lib/Vyatta/Qos/RoundRobin.pm
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2010-07-20 09:22:40 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2010-07-20 09:22:40 -0700
commitba5cad5145b11345fb195b79c806a02d9545bf0b (patch)
treebc6e3393ad75b04c9352539447436a537331a6c5 /lib/Vyatta/Qos/RoundRobin.pm
parent97c6b53404e71fe1b6ccb617dafea346f8211ee4 (diff)
downloadvyatta-cfg-qos-ba5cad5145b11345fb195b79c806a02d9545bf0b.tar.gz
vyatta-cfg-qos-ba5cad5145b11345fb195b79c806a02d9545bf0b.zip
Allow larger queue size for sub-queues in Shaper and RoundRobin
For queue-type (other than fair-queue), it is allowable to have larger queue size. Move validation into class checking.
Diffstat (limited to 'lib/Vyatta/Qos/RoundRobin.pm')
-rw-r--r--lib/Vyatta/Qos/RoundRobin.pm20
1 files changed, 19 insertions, 1 deletions
diff --git a/lib/Vyatta/Qos/RoundRobin.pm b/lib/Vyatta/Qos/RoundRobin.pm
index b7d72b2..d9e90e9 100644
--- a/lib/Vyatta/Qos/RoundRobin.pm
+++ b/lib/Vyatta/Qos/RoundRobin.pm
@@ -26,8 +26,10 @@ require Vyatta::Qos::ShaperClass;
# Create a new instance based on config information
sub new {
my ( $that, $config, $name ) = @_;
-
my @classes = _getClasses( $config->setLevel() );
+
+ _checkClasses( @classes );
+
my $self = {};
my $class = ref($that) || $that;
bless $self, $class;
@@ -36,6 +38,22 @@ sub new {
return $self;
}
+# Check constraints on sub queues
+sub _checkClasses {
+ my $level = shift;
+
+ foreach my $class (@_) {
+ my $level = $class->{level};
+ my $qtype = $class->{_qdisc};
+ my $qlimit = $class->{_limit};
+
+ if ($qtype eq 'random-detect' && defined($qlimit) && $qlimit >= 128) {
+ print STDERR "Configuration error in: $level\n";
+ die "queue limit must be between 1 and 127 for random-detect\n";
+ }
+ }
+}
+
sub _getClasses {
my $level = shift;
my @classes;