diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-07-25 11:16:05 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-07-28 09:50:35 -0700 |
commit | 89e5660652943e59c8f687100973c37aa1113868 (patch) | |
tree | be6ce3e46c973af708a7a485f132a34708526871 | |
parent | 0da019bca9cd233d470cd8d3f82a71ae1861c379 (diff) | |
download | vyatta-cfg-qos-89e5660652943e59c8f687100973c37aa1113868.tar.gz vyatta-cfg-qos-89e5660652943e59c8f687100973c37aa1113868.zip |
Make default class work for round robin
Bug 5896
Need to insert dummy filter to match all packets
(cherry picked from commit 9f1e20193852f059afda8041192086313107b29f)
-rw-r--r-- | lib/Vyatta/Qos/RoundRobin.pm | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/lib/Vyatta/Qos/RoundRobin.pm b/lib/Vyatta/Qos/RoundRobin.pm index d9e90e9..c86bd05 100644 --- a/lib/Vyatta/Qos/RoundRobin.pm +++ b/lib/Vyatta/Qos/RoundRobin.pm @@ -61,9 +61,10 @@ sub _getClasses { $config->setLevel("$level default"); my $default = new Vyatta::Qos::ShaperClass($config); - - push @classes, $default; - $default->{id} = 1; + if ($default) { + push @classes, $default; + $default->{id} = 1; + } foreach my $id ( $config->listNodes("class") ) { $config->setLevel("$level class $id"); @@ -82,13 +83,19 @@ sub commands { print " quantum $self->{_quantum}" if ( $self->{_quantum} ); print "\n"; - foreach my $class (@$classes) { + foreach my $class (sort { $a->{id} <=> $b->{id} } @$classes) { $class->gen_class( $dev, 'drr', $parent ); $class->gen_leaf( $dev, $parent ); - my $prio = 1; + + if ($class->{id} == 1) { + printf "filter add dev %s parent %x: prio %d", + $dev, $parent, 4096; + printf " protocol all basic flowid %x:1\n", $parent; + next; + } foreach my $match ( $class->matchRules() ) { - $match->filter( $dev, $parent, $class->{id}, $prio++); + $match->filter( $dev, $parent, $class->{id}, $class->{id} - 1 ); } } } |