summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scripts/VyattaQosTrafficLimiter.pm13
-rw-r--r--templates/qos-policy/traffic-limiter/node.tag/class/node.tag/burst/node.def7
2 files changed, 13 insertions, 7 deletions
diff --git a/scripts/VyattaQosTrafficLimiter.pm b/scripts/VyattaQosTrafficLimiter.pm
index 2907590..649fb17 100644
--- a/scripts/VyattaQosTrafficLimiter.pm
+++ b/scripts/VyattaQosTrafficLimiter.pm
@@ -26,6 +26,7 @@
my %fields = (
id => undef,
priority => undef,
+ burst => undef,
rate => undef,
_match => undef,
);
@@ -51,7 +52,8 @@
defined $rate or die "bandwidth must be defined for $level\n";
$self->{rate} = VyattaQosUtil::getRate($rate);
-
+ $self->{burst} = $config->returnValue("burst");
+ defined $self->{burst} or die "burst must be defined for $level\n";
$self->{priority} = $config->returnValue("priority");
foreach my $match ( $config->listNodes("match") ) {
@@ -134,13 +136,10 @@ sub commands {
printf {$out} "qdisc add dev %s handle %x: ingress\n", $dev, $parent;
foreach my $class (@$classes) {
- my $id = $class->{id};
- my $rate = $class->{rate};
- my $priority = $class->{priority};
-
foreach my $match ( $class->matchRules() ) {
- $match->filter( $out, $dev, $parent, $priority );
- printf {$out} " police avrate %s drop flowid :%x\n", $rate, $id;
+ $match->filter( $out, $dev, $parent, $class->{priority} );
+ printf {$out} " police rate %s burst %s drop flowid :%x\n",
+ $class->{rate}, $class->{burst}, $class->{id};
}
}
}
diff --git a/templates/qos-policy/traffic-limiter/node.tag/class/node.tag/burst/node.def b/templates/qos-policy/traffic-limiter/node.tag/class/node.tag/burst/node.def
new file mode 100644
index 0000000..54ae4f3
--- /dev/null
+++ b/templates/qos-policy/traffic-limiter/node.tag/class/node.tag/burst/node.def
@@ -0,0 +1,7 @@
+type: txt
+help: Set the burst size for this class (default: 15kb)
+default: "15k"
+syntax:expression: exec "/opt/vyatta/sbin/vyatta-qos-util.pl --burst \"$VAR(@)\""
+comp_help: Allowed values:
+ <number> Burst size in bytes
+ <number><suffix> Size with scaling suffix (kb, mb, gb)