Project

General

Profile

Bug #12003 » shaper-v3.patch

Anonymous, 06/11/2021 12:36 PM

View differences:

/etc/inc/shaper.inc 2021-06-11 10:51:24.623538000 -0500
),
"fq_pie" => array(
"name" => "FQ_PIE",
"parameter_format" => "type fq_pie target %sms tupdate %sms alpha %s beta %s max_burst %s max_ecnth %s",
"parameter_format" => "type fq_pie target %sms tupdate %sms alpha %s beta %s max_burst %s max_ecnth %s quantum %s limit %s flows %s",
"description" => "Fair Queue Proportional Integral controller Enhanced AQM (FQ_PIE) is similar to FQ_CODEL but uses a slightly different algorithm.",
"parameters" => array(
"target" => array("name" => "Target Delay (ms)", "type" => "number", "default" => intval(get_single_sysctl("net.inet.ip.dummynet.fqpie.target")) / 1000),
"tupdate" => array("name" => "Interval (ms)", "type" => "number", "default" => intval(get_single_sysctl("net.inet.ip.dummynet.fqpie.tupdate")) / 1000),
"alpha" => array("name" => "alpha", "type" => "number", "default" => get_single_sysctl("net.inet.ip.dummynet.fqpie.alpha")),
"beta" => array("name" => "beta", "type" => "number", "default" => get_single_sysctl("net.inet.ip.dummynet.fqpie.beta")),
"max_burst" => array("name" => "max_burst", "type" => "number", "default" => get_single_sysctl("net.inet.ip.dummynet.fqpie.max_burst")),
"max_ecnth" => array("name" => "max_ecnth", "type" => "number", "default" => get_single_sysctl("net.inet.ip.dummynet.fqpie.max_ecnth"))
"alpha" => array("name" => "alpha", "type" => "number step=any", "default" => intval(get_single_sysctl("net.inet.ip.dummynet.fqpie.alpha")) / 1000),
"beta" => array("name" => "beta", "type" => "number step=any", "default" => intval(get_single_sysctl("net.inet.ip.dummynet.fqpie.beta")) / 1000),
"max_burst" => array("name" => "max_burst", "type" => "number", "default" => intval(get_single_sysctl("net.inet.ip.dummynet.fqpie.max_burst")) / 1000),
"max_ecnth" => array("name" => "max_ecnth", "type" => "number step=any", "default" => intval(get_single_sysctl("net.inet.ip.dummynet.fqpie.max_ecnth")) / 1000),
"quantum" => array("name" => "quantum", "type" => "number", "default" => get_single_sysctl("net.inet.ip.dummynet.fqpie.quantum")),
"limit" => array("name" => "limit", "type" => "number", "default" => get_single_sysctl("net.inet.ip.dummynet.fqpie.limit")),
"flows" => array("name" => "flows", "type" => "number", "default" => get_single_sysctl("net.inet.ip.dummynet.fqpie.flows"))
),
"ecn" => true
"ecn" => true,
"pie_onoff" => true,
"pie_capdrop" => true,
"pie_qdelay" => true,
"pie_pderand" => true
)
);
}
......
"parameters" => array(
"target" => array("name" => "Target Delay (ms)", "type" => "number", "default" => intval(get_single_sysctl("net.inet.ip.dummynet.fqpie.target")) / 1000),
"tupdate" => array("name" => "Interval (ms)", "type" => "number", "default" => intval(get_single_sysctl("net.inet.ip.dummynet.fqpie.tupdate")) / 1000),
"alpha" => array("name" => "alpha", "type" => "number", "default" => get_single_sysctl("net.inet.ip.dummynet.fqpie.alpha")),
"beta" => array("name" => "beta", "type" => "number", "default" => get_single_sysctl("net.inet.ip.dummynet.fqpie.beta")),
"max_burst" => array("name" => "max_burst", "type" => "number", "default" => get_single_sysctl("net.inet.ip.dummynet.fqpie.max_burst")),
"max_ecnth" => array("name" => "max_ecnth", "type" => "number", "default" => get_single_sysctl("net.inet.ip.dummynet.fqpie.max_ecnth"))
"alpha" => array("name" => "alpha", "type" => "number step=any", "default" => intval(get_single_sysctl("net.inet.ip.dummynet.fqpie.alpha")) / 1000),
"beta" => array("name" => "beta", "type" => "number step=any", "default" => intval(get_single_sysctl("net.inet.ip.dummynet.fqpie.beta")) / 1000),
"max_burst" => array("name" => "max_burst", "type" => "number", "default" => intval(get_single_sysctl("net.inet.ip.dummynet.fqpie.max_burst")) / 1000),
"max_ecnth" => array("name" => "max_ecnth", "type" => "number step=any", "default" => intval(get_single_sysctl("net.inet.ip.dummynet.fqpie.max_ecnth")) / 1000)
),
"ecn" => true
"ecn" => true,
"pie_onoff" => true,
"pie_capdrop" => true,
"pie_qdelay" => true,
"pie_pderand" => true
),
"red" => array(
"name" => "Random Early Detection (RED)",
......
// get current value, or default.
$currentValue = $params[$key];
if (!$currentValue || $currentValue == '') {
$currentValue = $value["default"]; // default to default
// check if param key is set. allows the param key to be zero.
if (! isset($currentValue)) {
if (!$currentValue || $currentValue == '') {
$currentValue = $value["default"]; // default to default
}
}
$form .= "<td class=\"col-xs-4\">" . htmlspecialchars($key) . "</td>";
......
/* Limiter queue patch */
var $ecn; // ecn 'on' or 'off'
var $pie_onoff;
var $pie_capdrop;
var $pie_qdelay;
var $pie_pderand;
var $aqm; // key to aqm_map
var $aqm_params = array(); // AQM params
var $scheduler; // key to scheduler_map
......
function SetECN($ecn) {
$this->ecn = $ecn;
}
function GetPIE_ONOFF() {
return $this->pie_onoff;
}
function SetPIE_ONOFF($pie_onoff) {
$this->pie_onoff = $pie_onoff;
}
function GetPIE_CAPDROP() {
return $this->pie_capdrop;
}
function SetPIE_CAPDROP($pie_capdrop) {
$this->pie_capdrop = $pie_capdrop;
}
function GetPIE_QDELAY() {
return $this->pie_qdelay;
}
function SetPIE_QDELAY($pie_qdelay) {
$this->pie_qdelay = $pie_qdelay;
}
function GetPIE_PDERAND() {
return $this->pie_pderand;
}
function SetPIE_PDERAND($pie_pderand) {
$this->pie_pderand = $pie_pderand;
}
function GetScheduler() {
return $this->scheduler;
}
......
// ecn flag
$this->SetECN($q['ecn']);
// PIE Flags.
$this->SetPIE_ONOFF($q['pie_onoff']);
$this->SetPIE_CAPDROP($q['pie_capdrop']);
$this->SetPIE_QDELAY($q['pie_qdelay']);
$this->SetPIE_PDERAND($q['pie_pderand']);
/* End limiter patch */
}
......
$pfq_rule .= ' noecn';
}
}
if ($selectedScheduler["pie_onoff"]) {
if ($this->getPIE_ONOFF() == 'on') {
$pfq_rule .= 'onoff';
} else {
$pfq_rule .= '';
}
}
if ($selectedScheduler["pie_capdrop"]) {
if ($this->getPIE_CAPDROP() == 'on') {
$pfq_rule .= ' capdrop';
} else {
$pfq_rule .= ' nocapdrop';
}
}
if ($selectedScheduler["pie_qdelay"]) {
if ($this->getPIE_QDELAY() == 'on') {
$pfq_rule .= ' dre';
} else {
$pfq_rule .= ' ts';
}
}
if ($selectedScheduler["pie_pderand"]) {
if ($this->getPIE_PDERAND() == 'on') {
$pfq_rule .= ' derand';
} else {
$pfq_rule .= ' noderand';
}
}
}
$pfq_rule .= "\n";
/* End patch */
......
))->setHelp('Specifies the length of the limiter\'s queue, which the scheduler and AQM are responsible for. ' .
'This field may be left empty.');
$section->addInput(new Form_Checkbox(
'ecn',
'ECN',
'Enable Explicit Congestion Notification (ECN)',
($this->GetECN() == "on"),
'on'
))->setHelp('ECN sets a reserved TCP flag when the queue is nearing or exceeding capacity. Not all AQMs or schedulers support this.');
$selectedScheduler = getSchedulers()[$this->getScheduler()];
if ($selectedScheduler["ecn"]) {
$section->addInput(new Form_Checkbox(
'ecn',
'ECN',
'Enable Explicit Congestion Notification (ECN)',
($this->GetECN() == "on"),
'on'
))->setHelp('ECN sets a reserved TCP flag when the queue is nearing or exceeding capacity. Not all AQMs or schedulers support this.');
}
if ($selectedScheduler["pie_onoff"]) {
$section->addInput(new Form_Checkbox(
'pie_onoff',
'ONOFF',
'Enable Onoff (onoff,)',
($this->GetPIE_ONOFF() == "on"),
'on'
))->setHelp('Enable turning PIE on and off depending on queue load.');
}
if ($selectedScheduler["pie_capdrop"]) {
$section->addInput(new Form_Checkbox(
'pie_capdrop',
'CAPDROP',
'Enable Capdrop (capdrop,nocapdrop)',
($this->GetPIE_CAPDROP() == "on"),
'on'
))->setHelp('Enable cap drop adjustment.');
}
if ($selectedScheduler["pie_qdelay"]) {
$section->addInput(new Form_Checkbox(
'pie_qdelay',
'QUEUE DELAY TYPE',
'Enable Type Of Qdelay (dre,ts)',
($this->GetPIE_QDELAY() == "on"),
'on'
))->setHelp('Calculate queue delay using departure rate estimation (checked) or timestamps (unchecked).');
}
if ($selectedScheduler["pie_pderand"]) {
$section->addInput(new Form_Checkbox(
'pie_pderand',
'PROB DERAND',
'Enable Drop Probability De-randomisation (derand,noderand)',
($this->GetPIE_PDERAND() == "on"),
'on'
))->setHelp('Enable (checked) or disable (unchecked) drop probability de-randomisation.');
}
$sform->add($section);
/* End limiter patch */
......
$cflink[$config_key] = $this->GetAQMParameter($key);
}
$cflink['ecn'] = $this->GetECN();
$cflink['pie_onoff'] = $this->GetPIE_ONOFF();
$cflink['pie_capdrop'] = $this->GetPIE_CAPDROP();
$cflink['pie_qdelay'] = $this->GetPIE_QDELAY();
$cflink['pie_pderand'] = $this->GetPIE_PDERAND();
/* End limiter queue patch */
}
......
var $weight;
/* Limiter queue patch */
var $ecn; // ecn 'on' or 'off'
var $pie_onoff;
var $pie_capdrop;
var $pie_qdelay;
var $pie_pderand;
var $aqm; // key to aqm_map
var $aqm_params = array(); // AQM params
function GetAQM() {
......
function SetECN($ecn) {
$this->ecn = $ecn;
}
function GetPIE_ONOFF() {
return $this->pie_onoff;
}
function SetPIE_ONOFF($pie_onoff) {
$this->pie_onoff = $pie_onoff;
}
function GetPIE_CAPDROP() {
return $this->pie_capdrop;
}
function SetPIE_CAPDROP($pie_capdrop) {
$this->pie_capdrop = $pie_capdrop;
}
function GetPIE_QDELAY() {
return $this->pie_qdelay;
}
function SetPIE_QDELAY($pie_qdelay) {
$this->pie_qdelay = $pie_qdelay;
}
function GetPIE_PDERAND() {
return $this->pie_pderand;
}
function SetPIE_PDERAND($pie_pderand) {
$this->pie_pderand = $pie_pderand;
}
/* End limiter queue patch */
function GetWeight() {
......
// ecn flag
$this->SetECN($q['ecn']);
// PIE Flags.
$this->SetPIE_ONOFF($q['pie_onoff']);
$this->SetPIE_CAPDROP($q['pie_capdrop']);
$this->SetPIE_QDELAY($q['pie_qdelay']);
$this->SetPIE_PDERAND($q['pie_pderand']);
/* End limiter patch */
}
......
$pfq_rule .= ' noecn';
}
}
if ($selectedAQM["pie_onoff"]) {
if ($this->getPIE_ONOFF() == 'on') {
$pfq_rule .= 'onoff';
} else {
$pfq_rule .= '';
}
}
if ($selectedAQM["pie_capdrop"]) {
if ($this->getPIE_CAPDROP() == 'on') {
$pfq_rule .= ' capdrop';
} else {
$pfq_rule .= ' nocapdrop';
}
}
if ($selectedAQM["pie_qdelay"]) {
if ($this->getPIE_QDELAY() == 'on') {
$pfq_rule .= ' dre';
} else {
$pfq_rule .= ' ts';
}
}
if ($selectedAQM["pie_pderand"]) {
if ($this->getPIE_PDERAND() == 'on') {
$pfq_rule .= ' derand';
} else {
$pfq_rule .= ' noderand';
}
}
}
/* End patch */
......
$this->GetQlimit()
))->setHelp('Specifies the length of this queue, which the AQM is responsible for. This field may be left empty.');
$section->addInput(new Form_Checkbox(
'ecn',
'ECN',
'Enable Explicit Congestion Notification (ECN)',
($this->GetECN() == "on"),
'on'
))->setHelp('ECN sets a reserved TCP flag when the queue is nearing or exceeding capacity. Not all AQMs or schedulers support this.');
$selectedAQM = getAQMs()[$this->getAQM()];
if ($selectedAQM["ecn"]) {
$section->addInput(new Form_Checkbox(
'ecn',
'ECN',
'Enable Explicit Congestion Notification (ECN)',
($this->GetECN() == "on"),
'on'
))->setHelp('ECN sets a reserved TCP flag when the queue is nearing or exceeding capacity. Not all AQMs or schedulers support this.');
}
if ($selectedAQM["pie_onoff"]) {
$section->addInput(new Form_Checkbox(
'pie_onoff',
'ONOFF',
'Enable Onoff (onoff,)',
($this->GetPIE_ONOFF() == "on"),
'on'
))->setHelp('Enable turning PIE on and off depending on queue load.');
}
if ($selectedAQM["pie_capdrop"]) {
$section->addInput(new Form_Checkbox(
'pie_capdrop',
'CAPDROP',
'Enable Capdrop (capdrop,nocapdrop)',
($this->GetPIE_CAPDROP() == "on"),
'on'
))->setHelp('Enable cap drop adjustment.');
}
if ($selectedAQM["pie_qdelay"]) {
$section->addInput(new Form_Checkbox(
'pie_qdelay',
'QUEUE DELAY TYPE',
'Enable Type Of Qdelay (dre,ts)',
($this->GetPIE_QDELAY() == "on"),
'on'
))->setHelp('Calculate queue delay using departure rate estimation (checked) or timestamps (unchecked).');
}
if ($selectedAQM["pie_pderand"]) {
$section->addInput(new Form_Checkbox(
'pie_pderand',
'PROB DERAND',
'Enable Drop Probability De-randomisation (derand,noderand)',
($this->GetPIE_PDERAND() == "on"),
'on'
))->setHelp('Enable (checked) or disable (unchecked) drop probability de-randomisation.');
}
$sform->add($section);
/* End limiter patch */
......
$cflink[$config_key] = $this->GetAQMParameter($key);
}
$cflink['ecn'] = $this->GetECN();
$cflink['pie_onoff'] = $this->GetPIE_ONOFF();
$cflink['pie_capdrop'] = $this->GetPIE_CAPDROP();
$cflink['pie_qdelay'] = $this->GetPIE_QDELAY();
$cflink['pie_pderand'] = $this->GetPIE_PDERAND();
/* End limiter queue patch */
}
}
(3-3/8)