summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2015-03-30 17:14:08 +0500
committerDaniil Baturin <daniil@baturin.org>2015-03-30 17:14:08 +0500
commit6d096bb0a49c2d833a52e8889fa6301ee242f83e (patch)
tree60370870c22772236e2cd7102aee564f791a9b48
parent6ac211677f1053d1b79c00f102202942c5878445 (diff)
parent8f519389d86f5ec14431208713df2b16383e9fac (diff)
downloadvyatta-cfg-qos-6d096bb0a49c2d833a52e8889fa6301ee242f83e.tar.gz
vyatta-cfg-qos-6d096bb0a49c2d833a52e8889fa6301ee242f83e.zip
Merge pull request #4 from kouak/bug446
Bug #446: fq_codel patch from Carl Byington
-rw-r--r--Makefile.am1
-rw-r--r--lib/Vyatta/Qos/FairQueueCodel.pm66
-rw-r--r--lib/Vyatta/Qos/ShaperClass.pm38
-rw-r--r--lib/Vyatta/Qos/Shared.pm13
-rwxr-xr-xscripts/vyatta-qos.pl1
-rw-r--r--templates/traffic-policy/fq-codel/node.def8
-rw-r--r--templates/traffic-policy/fq-codel/node.tag/codel-quantum/node.def2
-rw-r--r--templates/traffic-policy/fq-codel/node.tag/description/node.def2
-rw-r--r--templates/traffic-policy/fq-codel/node.tag/flows/node.def2
-rw-r--r--templates/traffic-policy/fq-codel/node.tag/interval/node.def2
-rw-r--r--templates/traffic-policy/fq-codel/node.tag/queue-limit/node.def5
-rw-r--r--templates/traffic-policy/fq-codel/node.tag/target/node.def3
-rw-r--r--templates/traffic-policy/priority-queue/node.tag/class/node.tag/codel-quantum/node.def2
-rw-r--r--templates/traffic-policy/priority-queue/node.tag/class/node.tag/flows/node.def2
-rw-r--r--templates/traffic-policy/priority-queue/node.tag/class/node.tag/interval/node.def2
-rw-r--r--templates/traffic-policy/priority-queue/node.tag/class/node.tag/queue-type/node.def3
-rw-r--r--templates/traffic-policy/priority-queue/node.tag/class/node.tag/target/node.def3
-rw-r--r--templates/traffic-policy/priority-queue/node.tag/default/codel-quantum/node.def2
-rw-r--r--templates/traffic-policy/priority-queue/node.tag/default/flows/node.def2
-rw-r--r--templates/traffic-policy/priority-queue/node.tag/default/interval/node.def2
-rw-r--r--templates/traffic-policy/priority-queue/node.tag/default/queue-type/node.def3
-rw-r--r--templates/traffic-policy/priority-queue/node.tag/default/target/node.def3
-rw-r--r--templates/traffic-policy/round-robin/node.tag/class/node.tag/codel-quantum/node.def2
-rw-r--r--templates/traffic-policy/round-robin/node.tag/class/node.tag/flows/node.def2
-rw-r--r--templates/traffic-policy/round-robin/node.tag/class/node.tag/interval/node.def2
-rw-r--r--templates/traffic-policy/round-robin/node.tag/class/node.tag/queue-type/node.def3
-rw-r--r--templates/traffic-policy/round-robin/node.tag/class/node.tag/target/node.def3
-rw-r--r--templates/traffic-policy/round-robin/node.tag/default/codel-quantum/node.def2
-rw-r--r--templates/traffic-policy/round-robin/node.tag/default/flows/node.def2
-rw-r--r--templates/traffic-policy/round-robin/node.tag/default/interval/node.def2
-rw-r--r--templates/traffic-policy/round-robin/node.tag/default/queue-type/node.def3
-rw-r--r--templates/traffic-policy/round-robin/node.tag/default/target/node.def3
-rw-r--r--templates/traffic-policy/shaper/node.tag/class/node.tag/codel-quantum/node.def2
-rw-r--r--templates/traffic-policy/shaper/node.tag/class/node.tag/flows/node.def2
-rw-r--r--templates/traffic-policy/shaper/node.tag/class/node.tag/interval/node.def2
-rw-r--r--templates/traffic-policy/shaper/node.tag/class/node.tag/queue-type/node.def3
-rw-r--r--templates/traffic-policy/shaper/node.tag/class/node.tag/target/node.def3
-rw-r--r--templates/traffic-policy/shaper/node.tag/default/codel-quantum/node.def2
-rw-r--r--templates/traffic-policy/shaper/node.tag/default/flows/node.def2
-rw-r--r--templates/traffic-policy/shaper/node.tag/default/interval/node.def2
-rw-r--r--templates/traffic-policy/shaper/node.tag/default/queue-type/node.def3
-rw-r--r--templates/traffic-policy/shaper/node.tag/default/target/node.def3
42 files changed, 194 insertions, 21 deletions
diff --git a/Makefile.am b/Makefile.am
index c18e814..8723c03 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -22,6 +22,7 @@ share_perl5_DATA += lib/Vyatta/Qos/Priority.pm
share_perl5_DATA += lib/Vyatta/Qos/Shared.pm
share_perl5_DATA += lib/Vyatta/Qos/HFSCClass.pm
share_perl5_DATA += lib/Vyatta/Qos/HFSCShaper.pm
+share_perl5_DATA += lib/Vyatta/Qos/FairQueueCodel.pm
etcdir = /etc
etc_SCRIPTS =
diff --git a/lib/Vyatta/Qos/FairQueueCodel.pm b/lib/Vyatta/Qos/FairQueueCodel.pm
new file mode 100644
index 0000000..a6f4220
--- /dev/null
+++ b/lib/Vyatta/Qos/FairQueueCodel.pm
@@ -0,0 +1,66 @@
+# This is a wrapper around fq_codel queue discipline
+#
+#
+# **** License ****
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# This code was originally developed by Vyatta, Inc.
+# Portions created by Vyatta are Copyright (C) 2008 Vyatta, Inc.
+# All Rights Reserved.
+# **** End License ****
+
+package Vyatta::Qos::FairQueueCodel;
+
+use strict;
+use warnings;
+
+require Vyatta::Config;
+
+# Fair Queue Codel
+# Uses fq_codel
+
+my %fields = (
+ _limit => undef,
+ _flows => undef,
+ _target => undef,
+ _interval => undef,
+ _quantum => undef,
+);
+
+sub new {
+ my ( $that, $config ) = @_;
+ my $class = ref($that) || $that;
+ my $self = {%fields};
+
+ $self->{_limit} = $config->returnValue('queue-limit');
+ $self->{_flows} = $config->returnValue('flows');
+ $self->{_target} = $config->returnValue('target');
+ $self->{_interval} = $config->returnValue('interval');
+ $self->{_cquantum} = $config->returnValue('codel-quantum');
+
+ if ( $self->{_target} ) { $self->{_target} *= 1000; }
+ if ( $self->{_interval} ) { $self->{_interval} *= 1000; }
+
+ return bless $self, $class;
+}
+
+sub commands {
+ my ( $self, $dev ) = @_;
+
+ print "qdisc add dev $dev root fq_codel";
+ print " limit $self->{_limit}" if ( $self->{_limit} );
+ print " flows $self->{_flows}" if ( $self->{_flows} );
+ print " target $self->{_target}" if ( $self->{_target} );
+ print " interval $self->{_interval}" if ( $self->{_interval} );
+ print " quantum $self->{_cquantum}" if ( $self->{_cquantum} );
+ print " noecn\n";
+}
+
+1;
diff --git a/lib/Vyatta/Qos/ShaperClass.pm b/lib/Vyatta/Qos/ShaperClass.pm
index 4d3cf33..b0d6343 100644
--- a/lib/Vyatta/Qos/ShaperClass.pm
+++ b/lib/Vyatta/Qos/ShaperClass.pm
@@ -51,7 +51,14 @@ 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->{_quantum} = $config->returnValue("quantum");
+ $self->{_flows} = $config->returnValue('flows');
+ $self->{_target} = $config->returnValue('target');
+ $self->{_interval} = $config->returnValue('interval');
+ $self->{_cquantum} = $config->returnValue('codel-quantum');
+
+ if ( $self->{_target} ) { $self->{_target} *= 1000; }
+ if ( $self->{_interval} ) { $self->{_interval} *= 1000; }
$self->{dsmark} = getDsfield( $config->returnValue("set-dscp") );
my @matches = _getMatch("$level match");
@@ -94,7 +101,7 @@ sub _getPercentRate {
}
return ( $percent * $speed ) / 100.;
- }
+ }
return getRate($rate);
}
@@ -122,6 +129,18 @@ sub sfqQdisc {
print "\n";
}
+sub codelQdisc {
+ my ( $self, $dev, $rate ) = @_;
+
+ print "fq_codel";
+ print " limit $self->{_limit}" if ( $self->{_limit} );
+ print " flows $self->{_flows}" if ( $self->{_flows} );
+ print " target $self->{_target}" if ( $self->{_target} );
+ print " interval $self->{_interval}" if ( $self->{_interval} );
+ print " quantum $self->{_cquantum}" if ( $self->{_cquantum} );
+ print " noecn\n";
+}
+
sub sfqValidate {
my ( $self, $level ) = @_;
my $limit = $self->{_limit};
@@ -178,15 +197,15 @@ sub redQdisc {
sub redValidate {
my ( $self, $level, $rate ) = @_;
- my $limit = $self->{_limit}; # packets
- my $thresh = redQsize($rate); # bytes
+ my $limit = $self->{_limit}; # packets
+ my $thresh = redQsize($rate); # bytes
my $qmax = POSIX::ceil($thresh / AVGPKT); # packets
if ( defined($limit) && $limit < $qmax ) {
print STDERR "Configuration error in: $level\n";
printf STDERR
"The queue limit (%d) is too small, must be %d or more when using random-detect\n",
- $limit, $qmax;
+ $limit, $qmax;
exit 1;
}
@@ -194,16 +213,17 @@ sub redValidate {
my $minbw = ( 3 * AVGPKT * 8 ) / LATENCY;
print STDERR "Configuration error in: $level\n";
- printf STDERR
+ printf STDERR
"Random-detect queue type requires effective bandwidth of %d Kbit/sec or greater\n",
$minbw;
- exit 1;
+ exit 1;
}
}
my %qdiscOptions = (
'priority' => \&prioQdisc,
'fair-queue' => \&sfqQdisc,
+ 'fq-codel' => \&codelQdisc,
'random-detect' => \&redQdisc,
'drop-tail' => \&fifoQdisc,
);
@@ -264,7 +284,7 @@ sub gen_class {
# Hack to avoid kernel HTB message if quantum is small.
# Only occurs if link speed is high and offered bandwidth is small.
if ( defined($r2q) && !defined($quantum) && ($rate / 8) / $r2q < MINQUANTUM ) {
- $quantum = MINQUANTUM;
+ $quantum = MINQUANTUM;
}
printf "class add dev %s parent %x:1 classid %x:%x %s",
@@ -272,7 +292,7 @@ sub gen_class {
print " rate $rate" if ($rate);
print " ceil $ceil" if ($ceil);
- print " quantum $quantum" if ($quantum);
+ print " quantum $quantum" if ($quantum);
print " burst $self->{_burst}" if ( $self->{_burst} );
print " prio $self->{_priority}" if ( $self->{_priority} );
diff --git a/lib/Vyatta/Qos/Shared.pm b/lib/Vyatta/Qos/Shared.pm
index 2a0fc3d..2b13b04 100644
--- a/lib/Vyatta/Qos/Shared.pm
+++ b/lib/Vyatta/Qos/Shared.pm
@@ -28,21 +28,22 @@ our @EXPORT =
qw(find_policy interfaces_using get_policy_names list_policy %policies);
use base qw(Exporter);
-our %policies = (
+our %policies = (
'out' => {
'shaper-hfsc' => 'HFSCShaper',
'shaper' => 'TrafficShaper',
'fair-queue' => 'FairQueue',
+ 'fq-codel' => 'FairQueueCodel',
'rate-control' => 'RateLimiter',
'drop-tail' => 'DropTail',
'network-emulator' => 'NetworkEmulator',
'round-robin' => 'RoundRobin',
'priority-queue' => 'Priority',
'random-detect' => 'RandomDetect',
- },
+ },
'in' => {
'limiter' => 'TrafficLimiter',
- }
+ }
);
# find policy for name - also check for duplicates
@@ -106,12 +107,12 @@ sub get_policy_names {
$config->setLevel('traffic-policy');
- foreach my $direction ( @args ) {
+ foreach my $direction ( @args ) {
my @qos = grep { $policies{$direction}{$_} } $config->$listNodes();
foreach my $type (@qos) {
my @n = $config->$listNodes($type);
- push @names, @n;
- }
+ push @names, @n;
+ }
}
return @names;
}
diff --git a/scripts/vyatta-qos.pl b/scripts/vyatta-qos.pl
index c88bf0e..b8b1779 100755
--- a/scripts/vyatta-qos.pl
+++ b/scripts/vyatta-qos.pl
@@ -29,6 +29,7 @@ my %policies = (
'out' => {
'shaper-hfsc' => 'HFSCShaper',
'shaper' => 'TrafficShaper',
+ 'fq-codel' => 'FairQueueCodel',
'fair-queue' => 'FairQueue',
'rate-control' => 'RateLimiter',
'drop-tail' => 'DropTail',
diff --git a/templates/traffic-policy/fq-codel/node.def b/templates/traffic-policy/fq-codel/node.def
new file mode 100644
index 0000000..0d42087
--- /dev/null
+++ b/templates/traffic-policy/fq-codel/node.def
@@ -0,0 +1,8 @@
+tag:
+type: txt
+help: Fair queuing controlled delay policy name
+syntax:expression: pattern $VAR(@) "^[[:alnum:]][-_[:alnum:]]*$"
+ ; "only alpha-numeric policy name allowed"
+create: /opt/vyatta/sbin/vyatta-qos.pl --create-policy $VAR(.) $VAR(@)
+delete: /opt/vyatta/sbin/vyatta-qos.pl --delete-policy $VAR(@)
+end: /opt/vyatta/sbin/vyatta-qos.pl --apply-policy $VAR(@)
diff --git a/templates/traffic-policy/fq-codel/node.tag/codel-quantum/node.def b/templates/traffic-policy/fq-codel/node.tag/codel-quantum/node.def
new file mode 100644
index 0000000..cb1efe3
--- /dev/null
+++ b/templates/traffic-policy/fq-codel/node.tag/codel-quantum/node.def
@@ -0,0 +1,2 @@
+type: u32
+help: fq-codel - Number of bytes used as 'deficit' (default 1514)
diff --git a/templates/traffic-policy/fq-codel/node.tag/description/node.def b/templates/traffic-policy/fq-codel/node.tag/description/node.def
new file mode 100644
index 0000000..1da9e34
--- /dev/null
+++ b/templates/traffic-policy/fq-codel/node.tag/description/node.def
@@ -0,0 +1,2 @@
+type: txt
+help: Description for this queuing policy
diff --git a/templates/traffic-policy/fq-codel/node.tag/flows/node.def b/templates/traffic-policy/fq-codel/node.tag/flows/node.def
new file mode 100644
index 0000000..aff7f29
--- /dev/null
+++ b/templates/traffic-policy/fq-codel/node.tag/flows/node.def
@@ -0,0 +1,2 @@
+type: u32
+help: fq-codel - Number of flows (default 1024)
diff --git a/templates/traffic-policy/fq-codel/node.tag/interval/node.def b/templates/traffic-policy/fq-codel/node.tag/interval/node.def
new file mode 100644
index 0000000..a7d28b1
--- /dev/null
+++ b/templates/traffic-policy/fq-codel/node.tag/interval/node.def
@@ -0,0 +1,2 @@
+type: u32
+help: fq-codel - Interval (milliseconds) used to measure the delay (default 100)
diff --git a/templates/traffic-policy/fq-codel/node.tag/queue-limit/node.def b/templates/traffic-policy/fq-codel/node.tag/queue-limit/node.def
new file mode 100644
index 0000000..f47b18b
--- /dev/null
+++ b/templates/traffic-policy/fq-codel/node.tag/queue-limit/node.def
@@ -0,0 +1,5 @@
+type: u32
+help: Maximum queue size (packets)
+syntax:expression: $VAR(@) > 1 && $VAR(@) < 11000;\
+ "Queue limit must greater than 1 and less than 11000"
+val_help: u32:1-11000; Queue size in packets (default 10240)
diff --git a/templates/traffic-policy/fq-codel/node.tag/target/node.def b/templates/traffic-policy/fq-codel/node.tag/target/node.def
new file mode 100644
index 0000000..d9b4196
--- /dev/null
+++ b/templates/traffic-policy/fq-codel/node.tag/target/node.def
@@ -0,0 +1,3 @@
+type: u32
+help: fq-codel - Acceptable minimum queue delay (milliseconds)
+
diff --git a/templates/traffic-policy/priority-queue/node.tag/class/node.tag/codel-quantum/node.def b/templates/traffic-policy/priority-queue/node.tag/class/node.tag/codel-quantum/node.def
new file mode 100644
index 0000000..cb1efe3
--- /dev/null
+++ b/templates/traffic-policy/priority-queue/node.tag/class/node.tag/codel-quantum/node.def
@@ -0,0 +1,2 @@
+type: u32
+help: fq-codel - Number of bytes used as 'deficit' (default 1514)
diff --git a/templates/traffic-policy/priority-queue/node.tag/class/node.tag/flows/node.def b/templates/traffic-policy/priority-queue/node.tag/class/node.tag/flows/node.def
new file mode 100644
index 0000000..aff7f29
--- /dev/null
+++ b/templates/traffic-policy/priority-queue/node.tag/class/node.tag/flows/node.def
@@ -0,0 +1,2 @@
+type: u32
+help: fq-codel - Number of flows (default 1024)
diff --git a/templates/traffic-policy/priority-queue/node.tag/class/node.tag/interval/node.def b/templates/traffic-policy/priority-queue/node.tag/class/node.tag/interval/node.def
new file mode 100644
index 0000000..a7d28b1
--- /dev/null
+++ b/templates/traffic-policy/priority-queue/node.tag/class/node.tag/interval/node.def
@@ -0,0 +1,2 @@
+type: u32
+help: fq-codel - Interval (milliseconds) used to measure the delay (default 100)
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 53f09ad..f7cb32d 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,9 +1,10 @@
type: txt
default: "drop-tail"
-syntax:expression: $VAR(@) in "fair-queue", "priority", "drop-tail", "random-detect";\
+syntax:expression: $VAR(@) in "fq-codel", "fair-queue", "priority", "drop-tail", "random-detect";\
"Unknown queue-type"
help: Queue type for this class
+val_help: fq-codel; Fair Queue Codel
val_help: fair-queue; Stochastic Fair Queue (SFQ)
val_help: drop-tail; First-In-First-Out (FIFO)
val_help: priority; Priority queueing based on DSCP
diff --git a/templates/traffic-policy/priority-queue/node.tag/class/node.tag/target/node.def b/templates/traffic-policy/priority-queue/node.tag/class/node.tag/target/node.def
new file mode 100644
index 0000000..d9b4196
--- /dev/null
+++ b/templates/traffic-policy/priority-queue/node.tag/class/node.tag/target/node.def
@@ -0,0 +1,3 @@
+type: u32
+help: fq-codel - Acceptable minimum queue delay (milliseconds)
+
diff --git a/templates/traffic-policy/priority-queue/node.tag/default/codel-quantum/node.def b/templates/traffic-policy/priority-queue/node.tag/default/codel-quantum/node.def
new file mode 100644
index 0000000..cb1efe3
--- /dev/null
+++ b/templates/traffic-policy/priority-queue/node.tag/default/codel-quantum/node.def
@@ -0,0 +1,2 @@
+type: u32
+help: fq-codel - Number of bytes used as 'deficit' (default 1514)
diff --git a/templates/traffic-policy/priority-queue/node.tag/default/flows/node.def b/templates/traffic-policy/priority-queue/node.tag/default/flows/node.def
new file mode 100644
index 0000000..aff7f29
--- /dev/null
+++ b/templates/traffic-policy/priority-queue/node.tag/default/flows/node.def
@@ -0,0 +1,2 @@
+type: u32
+help: fq-codel - Number of flows (default 1024)
diff --git a/templates/traffic-policy/priority-queue/node.tag/default/interval/node.def b/templates/traffic-policy/priority-queue/node.tag/default/interval/node.def
new file mode 100644
index 0000000..a7d28b1
--- /dev/null
+++ b/templates/traffic-policy/priority-queue/node.tag/default/interval/node.def
@@ -0,0 +1,2 @@
+type: u32
+help: fq-codel - Interval (milliseconds) used to measure the delay (default 100)
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 2f06d8c..1ea0c89 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,8 +1,9 @@
type: txt
default: "drop-tail"
-syntax:expression: $VAR(@) in "fair-queue", "priority", "drop-tail", "random-detect";\
+syntax:expression: $VAR(@) in "fq-codel", "fair-queue", "priority", "drop-tail", "random-detect";\
"Unknown queue-type"
help: Queue type for default traffic
+val_help: fq-codel; Fair Queue Codel
val_help: fair-queue; Stochastic Fair Queue (SFQ)
val_help: drop-tail; First-In-First-Out (FIFO)
val_help: random-detect; Random Early Detection (RED)
diff --git a/templates/traffic-policy/priority-queue/node.tag/default/target/node.def b/templates/traffic-policy/priority-queue/node.tag/default/target/node.def
new file mode 100644
index 0000000..d9b4196
--- /dev/null
+++ b/templates/traffic-policy/priority-queue/node.tag/default/target/node.def
@@ -0,0 +1,3 @@
+type: u32
+help: fq-codel - Acceptable minimum queue delay (milliseconds)
+
diff --git a/templates/traffic-policy/round-robin/node.tag/class/node.tag/codel-quantum/node.def b/templates/traffic-policy/round-robin/node.tag/class/node.tag/codel-quantum/node.def
new file mode 100644
index 0000000..cb1efe3
--- /dev/null
+++ b/templates/traffic-policy/round-robin/node.tag/class/node.tag/codel-quantum/node.def
@@ -0,0 +1,2 @@
+type: u32
+help: fq-codel - Number of bytes used as 'deficit' (default 1514)
diff --git a/templates/traffic-policy/round-robin/node.tag/class/node.tag/flows/node.def b/templates/traffic-policy/round-robin/node.tag/class/node.tag/flows/node.def
new file mode 100644
index 0000000..aff7f29
--- /dev/null
+++ b/templates/traffic-policy/round-robin/node.tag/class/node.tag/flows/node.def
@@ -0,0 +1,2 @@
+type: u32
+help: fq-codel - Number of flows (default 1024)
diff --git a/templates/traffic-policy/round-robin/node.tag/class/node.tag/interval/node.def b/templates/traffic-policy/round-robin/node.tag/class/node.tag/interval/node.def
new file mode 100644
index 0000000..a7d28b1
--- /dev/null
+++ b/templates/traffic-policy/round-robin/node.tag/class/node.tag/interval/node.def
@@ -0,0 +1,2 @@
+type: u32
+help: fq-codel - Interval (milliseconds) used to measure the delay (default 100)
diff --git a/templates/traffic-policy/round-robin/node.tag/class/node.tag/queue-type/node.def b/templates/traffic-policy/round-robin/node.tag/class/node.tag/queue-type/node.def
index 5768fdd..36bfffb 100644
--- a/templates/traffic-policy/round-robin/node.tag/class/node.tag/queue-type/node.def
+++ b/templates/traffic-policy/round-robin/node.tag/class/node.tag/queue-type/node.def
@@ -1,8 +1,9 @@
type: txt
default: "drop-tail"
-syntax:expression: $VAR(@) in "fair-queue", "priority", "drop-tail"; \
+syntax:expression: $VAR(@) in "fq-codel", "fair-queue", "priority", "drop-tail"; \
"Unknown queue-type"
help: Queue type for this class
+val_help: fq-codel; Fair Queue Codel
val_help: fair-queue; Stochastic Fair Queue (SFQ)
val_help: drop-tail; First-In-First-Out (FIFO)
val_help: priority; Priority queueing based on DSCP
diff --git a/templates/traffic-policy/round-robin/node.tag/class/node.tag/target/node.def b/templates/traffic-policy/round-robin/node.tag/class/node.tag/target/node.def
new file mode 100644
index 0000000..d9b4196
--- /dev/null
+++ b/templates/traffic-policy/round-robin/node.tag/class/node.tag/target/node.def
@@ -0,0 +1,3 @@
+type: u32
+help: fq-codel - Acceptable minimum queue delay (milliseconds)
+
diff --git a/templates/traffic-policy/round-robin/node.tag/default/codel-quantum/node.def b/templates/traffic-policy/round-robin/node.tag/default/codel-quantum/node.def
new file mode 100644
index 0000000..cb1efe3
--- /dev/null
+++ b/templates/traffic-policy/round-robin/node.tag/default/codel-quantum/node.def
@@ -0,0 +1,2 @@
+type: u32
+help: fq-codel - Number of bytes used as 'deficit' (default 1514)
diff --git a/templates/traffic-policy/round-robin/node.tag/default/flows/node.def b/templates/traffic-policy/round-robin/node.tag/default/flows/node.def
new file mode 100644
index 0000000..aff7f29
--- /dev/null
+++ b/templates/traffic-policy/round-robin/node.tag/default/flows/node.def
@@ -0,0 +1,2 @@
+type: u32
+help: fq-codel - Number of flows (default 1024)
diff --git a/templates/traffic-policy/round-robin/node.tag/default/interval/node.def b/templates/traffic-policy/round-robin/node.tag/default/interval/node.def
new file mode 100644
index 0000000..a7d28b1
--- /dev/null
+++ b/templates/traffic-policy/round-robin/node.tag/default/interval/node.def
@@ -0,0 +1,2 @@
+type: u32
+help: fq-codel - Interval (milliseconds) used to measure the delay (default 100)
diff --git a/templates/traffic-policy/round-robin/node.tag/default/queue-type/node.def b/templates/traffic-policy/round-robin/node.tag/default/queue-type/node.def
index ec3d4a2..f895d94 100644
--- a/templates/traffic-policy/round-robin/node.tag/default/queue-type/node.def
+++ b/templates/traffic-policy/round-robin/node.tag/default/queue-type/node.def
@@ -1,8 +1,9 @@
type: txt
default: "fair-queue"
-syntax:expression: $VAR(@) in "fair-queue", "priority", "drop-tail";\
+syntax:expression: $VAR(@) in "fq-codel", "fair-queue", "priority", "drop-tail";\
"Unknown queue-type"
help: Queue type for this class
+val_help: fq-codel; Fair Queue Codel
val_help: fair-queue; Stochastic Fair Queue (SFQ)
val_help: drop-tail; First-In-First-Out (FIFO)
val_help: priority; Priority queueing based on DSCP
diff --git a/templates/traffic-policy/round-robin/node.tag/default/target/node.def b/templates/traffic-policy/round-robin/node.tag/default/target/node.def
new file mode 100644
index 0000000..d9b4196
--- /dev/null
+++ b/templates/traffic-policy/round-robin/node.tag/default/target/node.def
@@ -0,0 +1,3 @@
+type: u32
+help: fq-codel - Acceptable minimum queue delay (milliseconds)
+
diff --git a/templates/traffic-policy/shaper/node.tag/class/node.tag/codel-quantum/node.def b/templates/traffic-policy/shaper/node.tag/class/node.tag/codel-quantum/node.def
new file mode 100644
index 0000000..cb1efe3
--- /dev/null
+++ b/templates/traffic-policy/shaper/node.tag/class/node.tag/codel-quantum/node.def
@@ -0,0 +1,2 @@
+type: u32
+help: fq-codel - Number of bytes used as 'deficit' (default 1514)
diff --git a/templates/traffic-policy/shaper/node.tag/class/node.tag/flows/node.def b/templates/traffic-policy/shaper/node.tag/class/node.tag/flows/node.def
new file mode 100644
index 0000000..aff7f29
--- /dev/null
+++ b/templates/traffic-policy/shaper/node.tag/class/node.tag/flows/node.def
@@ -0,0 +1,2 @@
+type: u32
+help: fq-codel - Number of flows (default 1024)
diff --git a/templates/traffic-policy/shaper/node.tag/class/node.tag/interval/node.def b/templates/traffic-policy/shaper/node.tag/class/node.tag/interval/node.def
new file mode 100644
index 0000000..a7d28b1
--- /dev/null
+++ b/templates/traffic-policy/shaper/node.tag/class/node.tag/interval/node.def
@@ -0,0 +1,2 @@
+type: u32
+help: fq-codel - Interval (milliseconds) used to measure the delay (default 100)
diff --git a/templates/traffic-policy/shaper/node.tag/class/node.tag/queue-type/node.def b/templates/traffic-policy/shaper/node.tag/class/node.tag/queue-type/node.def
index 6b44648..ce84eff 100644
--- a/templates/traffic-policy/shaper/node.tag/class/node.tag/queue-type/node.def
+++ b/templates/traffic-policy/shaper/node.tag/class/node.tag/queue-type/node.def
@@ -1,9 +1,10 @@
type: txt
default: "fair-queue"
-syntax:expression: $VAR(@) in "fair-queue", "priority", "drop-tail", "random-detect";\
+syntax:expression: $VAR(@) in "fq-codel", "fair-queue", "priority", "drop-tail", "random-detect";\
"Unknown queue-type"
help: Queue type for this class
+val_help: fq-codel; Fair Queue Codel
val_help: fair-queue; Stochastic Fair Queue (SFQ)
val_help: drop-tail; First-In-First-Out (FIFO)
val_help: priority; Priority queueing based on DSCP
diff --git a/templates/traffic-policy/shaper/node.tag/class/node.tag/target/node.def b/templates/traffic-policy/shaper/node.tag/class/node.tag/target/node.def
new file mode 100644
index 0000000..d9b4196
--- /dev/null
+++ b/templates/traffic-policy/shaper/node.tag/class/node.tag/target/node.def
@@ -0,0 +1,3 @@
+type: u32
+help: fq-codel - Acceptable minimum queue delay (milliseconds)
+
diff --git a/templates/traffic-policy/shaper/node.tag/default/codel-quantum/node.def b/templates/traffic-policy/shaper/node.tag/default/codel-quantum/node.def
new file mode 100644
index 0000000..cb1efe3
--- /dev/null
+++ b/templates/traffic-policy/shaper/node.tag/default/codel-quantum/node.def
@@ -0,0 +1,2 @@
+type: u32
+help: fq-codel - Number of bytes used as 'deficit' (default 1514)
diff --git a/templates/traffic-policy/shaper/node.tag/default/flows/node.def b/templates/traffic-policy/shaper/node.tag/default/flows/node.def
new file mode 100644
index 0000000..aff7f29
--- /dev/null
+++ b/templates/traffic-policy/shaper/node.tag/default/flows/node.def
@@ -0,0 +1,2 @@
+type: u32
+help: fq-codel - Number of flows (default 1024)
diff --git a/templates/traffic-policy/shaper/node.tag/default/interval/node.def b/templates/traffic-policy/shaper/node.tag/default/interval/node.def
new file mode 100644
index 0000000..a7d28b1
--- /dev/null
+++ b/templates/traffic-policy/shaper/node.tag/default/interval/node.def
@@ -0,0 +1,2 @@
+type: u32
+help: fq-codel - Interval (milliseconds) used to measure the delay (default 100)
diff --git a/templates/traffic-policy/shaper/node.tag/default/queue-type/node.def b/templates/traffic-policy/shaper/node.tag/default/queue-type/node.def
index caf6818..f5e2c0a 100644
--- a/templates/traffic-policy/shaper/node.tag/default/queue-type/node.def
+++ b/templates/traffic-policy/shaper/node.tag/default/queue-type/node.def
@@ -1,8 +1,9 @@
type: txt
default: "fair-queue"
-syntax:expression: $VAR(@) in "fair-queue", "priority", "drop-tail", "random-detect";\
+syntax:expression: $VAR(@) in "fq-codel", "fair-queue", "priority", "drop-tail", "random-detect";\
"Unknown queue-type"
help: Queue type for default traffic
+val_help: fq-codel; Fair Queue Codel
val_help: fair-queue; Stochastic Fair Queue (SFQ)
val_help: drop-tail; First-In-First-Out (FIFO)
val_help: priority; Priority queueing based on DSCP
diff --git a/templates/traffic-policy/shaper/node.tag/default/target/node.def b/templates/traffic-policy/shaper/node.tag/default/target/node.def
new file mode 100644
index 0000000..d9b4196
--- /dev/null
+++ b/templates/traffic-policy/shaper/node.tag/default/target/node.def
@@ -0,0 +1,3 @@
+type: u32
+help: fq-codel - Acceptable minimum queue delay (milliseconds)
+