summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Southworth <john.southworth@vyatta.com>2012-08-17 15:49:34 -0700
committerJohn Southworth <john.southworth@vyatta.com>2012-08-17 15:49:34 -0700
commit2085e8ee6bfe075026c16809adfacbb0926b57a8 (patch)
tree643d238dfddcdfeda59b5b374f683a1cb733770a
parent02ca79fdd845d20a62b5a30cd489312758894687 (diff)
downloadvyatta-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)
-rw-r--r--lib/Vyatta/Qos/Priority.pm18
-rw-r--r--templates/traffic-policy/priority-queue/node.tag/class/node.def6
-rw-r--r--templates/traffic-policy/priority-queue/node.tag/class/node.tag/priority/node.def5
-rw-r--r--templates/traffic-policy/priority-queue/node.tag/class/node.tag/queue-type/node.def2
-rw-r--r--templates/traffic-policy/priority-queue/node.tag/default/priority/node.def5
-rw-r--r--templates/traffic-policy/priority-queue/node.tag/default/queue-type/node.def2
6 files changed, 13 insertions, 25 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++ );
diff --git a/templates/traffic-policy/priority-queue/node.tag/class/node.def b/templates/traffic-policy/priority-queue/node.tag/class/node.def
index 1e9ae0b..41e60bb 100644
--- a/templates/traffic-policy/priority-queue/node.tag/class/node.def
+++ b/templates/traffic-policy/priority-queue/node.tag/class/node.def
@@ -1,6 +1,6 @@
tag:
type: u32
help: Class handle
-syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 4095; \
- "Class identifier must be between 1 and 4095"
-val_help: u32:1-4095; Class identifier
+syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 7; \
+ "Priority value must be between 1 and 7"
+val_help: u32:1-7; Priority
diff --git a/templates/traffic-policy/priority-queue/node.tag/class/node.tag/priority/node.def b/templates/traffic-policy/priority-queue/node.tag/class/node.tag/priority/node.def
deleted file mode 100644
index 6cacb22..0000000
--- a/templates/traffic-policy/priority-queue/node.tag/class/node.tag/priority/node.def
+++ /dev/null
@@ -1,5 +0,0 @@
-type: u32
-help: Priority for usage of excess bandwidth
-syntax:expression: $VAR(@) >= 0 && $VAR(@) <= 7 ;\
- "priority must be between 0 than 7"
-val_help: u32:0-7; Priority order for bandwidth pool
diff --git a/templates/traffic-policy/priority-queue/node.tag/class/node.tag/queue-type/node.def b/templates/traffic-policy/priority-queue/node.tag/class/node.tag/queue-type/node.def
index 6b44648..53f09ad 100644
--- a/templates/traffic-policy/priority-queue/node.tag/class/node.tag/queue-type/node.def
+++ b/templates/traffic-policy/priority-queue/node.tag/class/node.tag/queue-type/node.def
@@ -1,5 +1,5 @@
type: txt
-default: "fair-queue"
+default: "drop-tail"
syntax:expression: $VAR(@) in "fair-queue", "priority", "drop-tail", "random-detect";\
"Unknown queue-type"
help: Queue type for this class
diff --git a/templates/traffic-policy/priority-queue/node.tag/default/priority/node.def b/templates/traffic-policy/priority-queue/node.tag/default/priority/node.def
deleted file mode 100644
index c46ee3e..0000000
--- a/templates/traffic-policy/priority-queue/node.tag/default/priority/node.def
+++ /dev/null
@@ -1,5 +0,0 @@
-type: u32
-help: Priority for this queue
-syntax:expression: $VAR(@) >= 0 && $VAR(@) <= 7 ;\
- "priority must be between 0 than 7"
-val_help: u32:0-7; Priority
diff --git a/templates/traffic-policy/priority-queue/node.tag/default/queue-type/node.def b/templates/traffic-policy/priority-queue/node.tag/default/queue-type/node.def
index e4283ab..2f06d8c 100644
--- a/templates/traffic-policy/priority-queue/node.tag/default/queue-type/node.def
+++ b/templates/traffic-policy/priority-queue/node.tag/default/queue-type/node.def
@@ -1,5 +1,5 @@
type: txt
-default: "fair-queue"
+default: "drop-tail"
syntax:expression: $VAR(@) in "fair-queue", "priority", "drop-tail", "random-detect";\
"Unknown queue-type"
help: Queue type for default traffic