diff options
author | John Southworth <john.southworth@vyatta.com> | 2012-08-17 15:49:34 -0700 |
---|---|---|
committer | John Southworth <john.southworth@vyatta.com> | 2012-08-17 15:49:34 -0700 |
commit | 2085e8ee6bfe075026c16809adfacbb0926b57a8 (patch) | |
tree | 643d238dfddcdfeda59b5b374f683a1cb733770a /lib | |
parent | 02ca79fdd845d20a62b5a30cd489312758894687 (diff) | |
download | vyatta-cfg-qos-2085e8ee6bfe075026c16809adfacbb0926b57a8.tar.gz vyatta-cfg-qos-2085e8ee6bfe075026c16809adfacbb0926b57a8.zip |
Fix a few priority-queue problems
Priority queue automatically creates classes 1:[1-7] so we have to
use these as our classes.
Default class needs to be in the priomap (this is ugly, but it works
there must be a better way)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Vyatta/Qos/Priority.pm | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/lib/Vyatta/Qos/Priority.pm b/lib/Vyatta/Qos/Priority.pm index b148b1c..4b7654d 100644 --- a/lib/Vyatta/Qos/Priority.pm +++ b/lib/Vyatta/Qos/Priority.pm @@ -85,29 +85,27 @@ sub commands { # find largest class id $maxid = $class->{id} if ( defined $class->{id} && $class->{id} > $maxid ); - - # find largest priority - my $prio = $class->{_priority}; - - $bands = $prio + 1 - if ( defined $prio && $prio >= $bands); } # fill in id of default $default->{id} = ++$maxid; + $bands = $default->{id}; unshift @$classes, $default; my $parent = 1; my $root = "root"; + my $def_prio = $bands - 1; # Since we use filters to set priority - printf "qdisc add dev %s %s handle %x: prio bands %d\n", - $dev, $root, $parent, $bands; + printf "qdisc add dev %s %s handle %x: prio bands %d priomap %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d\n", + $dev, $root, $parent, $bands, + $def_prio, $def_prio, $def_prio, $def_prio, $def_prio, $def_prio, $def_prio, + $def_prio, $def_prio, $def_prio, $def_prio, $def_prio, $def_prio, $def_prio, + $def_prio, $def_prio, $def_prio; # prio is not really classful! foreach my $class (@$classes) { - $class->gen_leaf( $dev, $parent ); - + $class->gen_leaf( $dev, $parent ); my $prio = 1; foreach my $match ( $class->matchRules() ) { $match->filter( $dev, $parent, $class->{id}, $prio++ ); |