summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2010-07-30 11:52:27 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2010-07-30 11:52:27 -0700
commit7f42350146525544bd38db2426d6f5c7b99302c2 (patch)
treeec78a2cd37da40e15a20b6e7526a8f0eb88d4d45
parentac7353307d00a55d1740b642cf6c712a0b280181 (diff)
downloadvyatta-cfg-qos-7f42350146525544bd38db2426d6f5c7b99302c2.tar.gz
vyatta-cfg-qos-7f42350146525544bd38db2426d6f5c7b99302c2.zip
Make round-robin quantum per class
Bug 5958
-rw-r--r--lib/Vyatta/Qos/RoundRobin.pm4
-rw-r--r--lib/Vyatta/Qos/ShaperClass.pm2
-rw-r--r--templates/traffic-policy/round-robin/node.tag/class/node.tag/quantum/node.def (renamed from templates/traffic-policy/round-robin/node.tag/quantum/node.def)0
-rw-r--r--templates/traffic-policy/round-robin/node.tag/default/quantum/node.def4
4 files changed, 7 insertions, 3 deletions
diff --git a/lib/Vyatta/Qos/RoundRobin.pm b/lib/Vyatta/Qos/RoundRobin.pm
index d9cedfd..07aa8f7 100644
--- a/lib/Vyatta/Qos/RoundRobin.pm
+++ b/lib/Vyatta/Qos/RoundRobin.pm
@@ -82,9 +82,7 @@ sub commands {
my $classes = $self->{_classes};
my $parent = 1;
- printf "qdisc add dev %s root handle %x: drr", $dev, $parent;
- print " quantum $self->{_quantum}" if ( $self->{_quantum} );
- print "\n";
+ printf "qdisc add dev %s root handle %x: drr\n", $dev, $parent;
foreach my $class (sort { $a->{id} <=> $b->{id} } @$classes) {
$class->gen_class( $dev, 'drr', $parent );
diff --git a/lib/Vyatta/Qos/ShaperClass.pm b/lib/Vyatta/Qos/ShaperClass.pm
index f895239..b84b057 100644
--- a/lib/Vyatta/Qos/ShaperClass.pm
+++ b/lib/Vyatta/Qos/ShaperClass.pm
@@ -49,6 +49,7 @@ sub new {
$self->{_qdisc} = $config->returnValue("queue-type");
$self->{_avgpkt} = $config->returnValue("packet-length");
$self->{_latency} = $config->returnValue("latency");
+ $self->{_quantum} = $config->returnValue("quantum");
$self->{dsmark} = getDsfield( $config->returnValue("set-dscp") );
my @matches = _getMatch("$level match");
@@ -256,6 +257,7 @@ sub gen_class {
print " ceil $ceil" if ($ceil);
print " burst $self->{_burst}" if ( $self->{_burst} );
print " prio $self->{_priority}" if ( $self->{_priority} );
+ print " quantum $self->{_quantum}" if ( $self->{_quantum} );
print "\n";
}
diff --git a/templates/traffic-policy/round-robin/node.tag/quantum/node.def b/templates/traffic-policy/round-robin/node.tag/class/node.tag/quantum/node.def
index 7763166..7763166 100644
--- a/templates/traffic-policy/round-robin/node.tag/quantum/node.def
+++ b/templates/traffic-policy/round-robin/node.tag/class/node.tag/quantum/node.def
diff --git a/templates/traffic-policy/round-robin/node.tag/default/quantum/node.def b/templates/traffic-policy/round-robin/node.tag/default/quantum/node.def
new file mode 100644
index 0000000..7763166
--- /dev/null
+++ b/templates/traffic-policy/round-robin/node.tag/default/quantum/node.def
@@ -0,0 +1,4 @@
+type: u32
+help: Packet scheduling quantum
+syntax:expression: $VAR(@) > 0 ; "Quantum must be greater than zero"
+val_help: u32:1-4294967295; Packet scheduling quantum (bytes)