Commit 3e0ee5ff authored by Ad Schellevis's avatar Ad Schellevis Committed by Franco Fichtner

(traffic shaper) add Codel / FQ-CoDel support, https://github.com/opnsense/core/issues/505

(cherry picked from commit 083ca3c8)
parent d9cde465
......@@ -50,6 +50,55 @@
<advanced>true</advanced>
<help>Specify the scheduling algorithm to use</help>
</field>
<field>
<id>pipe.codel_enable</id>
<label>Enable CoDel</label>
<type>checkbox</type>
<advanced>true</advanced>
<help>Enable CoDel active queue management</help>
</field>
<field>
<id>pipe.codel_target</id>
<label>(FQ-)CoDel target</label>
<type>text</type>
<advanced>true</advanced>
<help>Minimum acceptable persistent queue delay (in ms), leave empty for default</help>
</field>
<field>
<id>pipe.codel_interval</id>
<label>(FQ-)CoDel interval</label>
<type>text</type>
<advanced>true</advanced>
<help>Interval before dropping packets (in ms), leave empty for default</help>
</field>
<field>
<id>pipe.codel_ecn_enable</id>
<label>(FQ-)CoDel ECN</label>
<type>checkbox</type>
<advanced>true</advanced>
<help>Explicit Congestion Notification</help>
</field>
<field>
<id>pipe.fqcodel_quantum</id>
<label>FQ-CoDel quantum</label>
<type>text</type>
<advanced>true</advanced>
<help>The number of bytes a queue can serve before being moved to the tail of old queues list (bytes), leave empty for defaults</help>
</field>
<field>
<id>pipe.fqcodel_limit</id>
<label>FQ-CoDel limit</label>
<type>text</type>
<advanced>true</advanced>
<help>The hard size limit of all queues managed by this instance, leave empty for defaults</help>
</field>
<field>
<id>pipe.fqcodel_flows</id>
<label>FQ-CoDel flows</label>
<type>text</type>
<advanced>true</advanced>
<help>The number of flow queues that are created and managed, leave empty for defaults</help>
</field>
<field>
<id>pipe.description</id>
<label>description</label>
......
......@@ -26,6 +26,34 @@
<li> choose source to provide all connected clients up to a maximum of this pipe configured bandwidth </li>
]]></help>
</field>
<field>
<id>queue.codel_enable</id>
<label>Enable CoDel</label>
<type>checkbox</type>
<advanced>true</advanced>
<help>Enable CoDel active queue management</help>
</field>
<field>
<id>queue.codel_target</id>
<label>(FQ-)CoDel target</label>
<type>text</type>
<advanced>true</advanced>
<help>Minimum acceptable persistent queue delay (in ms), leave empty for default</help>
</field>
<field>
<id>queue.codel_interval</id>
<label>(FQ-)CoDel interval</label>
<type>text</type>
<advanced>true</advanced>
<help>Interval before dropping packets (in ms), leave empty for default</help>
</field>
<field>
<id>queue.codel_ecn_enable</id>
<label>(FQ-)CoDel ECN</label>
<type>checkbox</type>
<advanced>true</advanced>
<help>Explicit Congestion Notification</help>
</field>
<field>
<id>queue.description</id>
<label>description</label>
......
......@@ -59,8 +59,42 @@
<fifo>FIFO</fifo>
<rr>Deficit Round Robin</rr>
<qfq>QFQ</qfq>
<fq_codel>FlowQueue-CoDel</fq_codel>
</OptionValues>
</scheduler>
<codel_enable type="BooleanField">
<default>0</default>
<Required>Y</Required>
</codel_enable>
<codel_target type="IntegerField">
<Required>N</Required>
<MinimumValue>1</MinimumValue>
<MaximumValue>10000</MaximumValue>
</codel_target>
<codel_interval type="IntegerField">
<Required>N</Required>
<MinimumValue>1</MinimumValue>
<MaximumValue>10000</MaximumValue>
</codel_interval>
<codel_ecn_enable type="BooleanField">
<default>0</default>
<Required>Y</Required>
</codel_ecn_enable>
<fqcodel_quantum type="IntegerField">
<Required>N</Required>
<MinimumValue>1</MinimumValue>
<MaximumValue>65535</MaximumValue>
</fqcodel_quantum>
<fqcodel_limit type="IntegerField">
<Required>N</Required>
<MinimumValue>1</MinimumValue>
<MaximumValue>65535</MaximumValue>
</fqcodel_limit>
<fqcodel_flows type="IntegerField">
<Required>N</Required>
<MinimumValue>1</MinimumValue>
<MaximumValue>65535</MaximumValue>
</fqcodel_flows>
<origin type="TextField">
<Required>N</Required>
<mask>/^([a-z,A-Z,1-9]){0,30}$/</mask>
......@@ -112,6 +146,24 @@
<dst-ip>destination</dst-ip>
</OptionValues>
</mask>
<codel_enable type="BooleanField">
<default>0</default>
<Required>Y</Required>
</codel_enable>
<codel_target type="IntegerField">
<Required>N</Required>
<MinimumValue>1</MinimumValue>
<MaximumValue>10000</MaximumValue>
</codel_target>
<codel_interval type="IntegerField">
<Required>N</Required>
<MinimumValue>1</MinimumValue>
<MaximumValue>10000</MaximumValue>
</codel_interval>
<codel_ecn_enable type="BooleanField">
<default>0</default>
<Required>Y</Required>
</codel_ecn_enable>
<description type="TextField">
<Required>Y</Required>
<mask>/^([\t\n\v\f\r 0-9a-zA-Z.\-,_\x{00A0}-\x{FFFF}]){1,255}$/u</mask>
......
......@@ -40,7 +40,18 @@ pipe {{ pipe.number }} config bw {{ pipe.bandwidth }}{{ pipe.bandwidthMetric }}/
if pipe.queue %} queue {{ pipe.queue }}{%
if pipe.queueMetric != 'slots' %}{{pipe.queueMetric}}{% endif %}{% endif
%}{% if pipe.mask != 'none' %} mask {{ pipe.mask }} 0xffffffff {% endif %} type {%
if pipe.scheduler|default('') != '' %}{{pipe.scheduler}}{% else %}wf2q+{% endif %}
if pipe.scheduler|default('') != '' %} {{pipe.scheduler}} {% else %} wf2q+ {% endif %}{%
if pipe.codel_enable|default('0') == '1' and pipe.scheduler != 'fq_codel' %} codel {% endif %}{%
if pipe.codel_enable|default('0') == '1' or pipe.scheduler == 'fq_codel' %}{%
if pipe.codel_target|default('') != ''%} target {{pipe.codel_target}} {% endif %}{%
if pipe.codel_interval|default('') != ''%} interval {{pipe.codel_interval}} {% endif %}{%
if pipe.codel_ecn_enable|default('0') == '1'%} ecn {% else %} noecn {% endif %} {%
if pipe.scheduler == 'fq_codel' %} {%
if pipe.fqcodel_quantum|default('') != '' %} quantum {{pipe.fqcodel_quantum}} {% endif %} {%
if pipe.fqcodel_limit|default('') != '' %} limit {{pipe.fqcodel_limit}} {% endif %} {%
if pipe.fqcodel_flows|default('') != '' %} flows {{pipe.fqcodel_flows}} {% endif %}
{% endif %}
{% endif %}
{% endfor %}
{% endif %}
......@@ -51,7 +62,13 @@ pipe {{ pipe.number }} config bw {{ pipe.bandwidth }}{{ pipe.bandwidthMetric }}/
{% if helpers.exists('OPNsense.TrafficShaper.queues.queue') %}
{% for queue in helpers.toList('OPNsense.TrafficShaper.queues.queue') %}
{% if helpers.getUUIDtag(queue.pipe) in ['pipe'] %}
queue {{ queue.number }} config pipe {{ helpers.getUUID(queue.pipe).number }} weight {{ queue.weight }}
queue {{ queue.number }} config pipe {{ helpers.getUUID(queue.pipe).number }} weight {{ queue.weight }}{%
if queue.codel_enable|default('0') == '1' %} codel {%
if queue.codel_target|default('') != ''%} target {{queue.codel_target}} {% endif %}{%
if queue.codel_interval|default('') != ''%} interval {{queue.codel_interval}} {% endif %}{%
if queue.codel_ecn_enable|default('0') == '1'%} ecn {% else %} noecn {% endif %}
{% endif %}
{% endif %}
{% endfor %}
{% endif %}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment