summaryrefslogtreecommitdiffstats
path: root/etc/inc/shaper.inc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2006-01-23 04:30:53 +0000
committerScott Ullrich <sullrich@pfsense.org>2006-01-23 04:30:53 +0000
commit62a48760b38d2e1252858732298256ff008203c2 (patch)
treeccfdfb64596e6ce23d0a70a29ff0e65c66fbface /etc/inc/shaper.inc
parent49fd79aa7ef37645fc5c0f113224202c9b1acdc8 (diff)
downloadpfsense-62a48760b38d2e1252858732298256ff008203c2.zip
pfsense-62a48760b38d2e1252858732298256ff008203c2.tar.gz
MFC 9611
Ticket #792 - fix 6 month old shaper bug that caused erratic speeds and latencies. With a 10Mbit queue and 4 iperf jobs running through it in default and otherL queues, I can get an icmp through in otherH with a mere 25ms additional latency on average.
Diffstat (limited to 'etc/inc/shaper.inc')
-rw-r--r--etc/inc/shaper.inc26
1 files changed, 2 insertions, 24 deletions
diff --git a/etc/inc/shaper.inc b/etc/inc/shaper.inc
index f6e6c22..78e80b6 100644
--- a/etc/inc/shaper.inc
+++ b/etc/inc/shaper.inc
@@ -34,7 +34,6 @@ require_once("functions.inc");
require_once("pkg-utils.inc");
require_once("notices.inc");
-
function find_default_queue($interface) {
global $config, $queue_cache;
$qconfig = $config;
@@ -43,7 +42,6 @@ function find_default_queue($interface) {
if (isset($queue_cache['defq'][$interface]))
return $queue_cache['defq'][$interface];
-
if (is_array($qconfig['shaper']['queue'])) {
foreach ($qconfig['shaper']['queue'] as $queue) {
if(isset($queue['defaultqueue']) and ($queue['defaultqueue'] <> "")) {
@@ -65,7 +63,6 @@ function find_default_queue($interface) {
return null;
}
-
function get_ack_queue($interface) {
global $config, $queue_cache;
@@ -90,7 +87,6 @@ function get_ack_queue($interface) {
return null;
}
-
function filter_generate_altq_queues($altq_ints) {
global $config;
$altq_rules = "";
@@ -172,7 +168,6 @@ function is_subqueue_used_on_interface($queuename, $interface) {
return 0;
}
-
function filter_is_queue_being_used_on_interface($queuename, $interface) {
global $config;
$lconfig = $config;
@@ -185,7 +180,6 @@ function filter_is_queue_being_used_on_interface($queuename, $interface) {
return null;
}
-
function filter_setup_altq_interfaces() {
global $config;
$altq_rules = "";
@@ -226,31 +220,22 @@ function filter_setup_altq_interfaces() {
function find_root_queue($ifname) {
global $config;
- $dbg = fopen("/tmp/debug", 'a');
foreach ($config['shaper']['queue'] as $queue) {
$rule_interface = "";
$q = $queue;
- fwrite($dbg, "interface: {$ifname}\n");
- fwrite($dbg, "queue: {$q['name']} parent: {$q['parentqueue']} attached: {$q['attachtoqueue']}\n");
/* if we're a parentqueue and aren't attached to another queue we're probably a root */
if ((isset($q['parentqueue']) && $q['parentqueue'] <> "") && (!isset($q['attachtoqueue']) || $q['attachtoqueue'] == "")) {
- fwrite($dbg, "queue: {$q['name']} is a parent\n");
/* Confirm that this is a valid queue for this interface */
$rule_interface = is_subqueue_used_on_interface($q['name'], $ifname);
if ($rule_interface == 1) {
- fwrite($dbg, "queue: {$q['name']} is a parent on {$ifname}\n");
$queue_names .= " ";
$queue_names .= $q['name'];
}
}
}
- fclose($dbg);
return $queue_names;
}
-
-
-
function is_queue_attached_children($name) {
global $config;
if (!is_array($config['shaper']['queue'])) return 0;
@@ -260,7 +245,6 @@ function is_queue_attached_children($name) {
return 0;
}
-
function queue_interface_recursive($queuename) {
global $config;
foreach($config['shaper']['queue'] as $queue) {
@@ -278,7 +262,6 @@ function queue_interface_recursive($queuename) {
return null;
}
-
function is_subqueue($name) {
global $config;
$queues = $config['shaper']['queue']; /* must assign to keep from corrupting in memory $config */
@@ -289,7 +272,6 @@ function is_subqueue($name) {
return 0;
}
-
function filter_altq_get_queuename($queuenum) {
global $config;
$x=0;
@@ -302,13 +284,11 @@ function filter_altq_get_queuename($queuenum) {
return null;
}
-
function filter_generate_pf_altq_rules() {
/* I don't think we're in IPFW anymore Toto */
-
- global $config, $g, $tcpflags;
-
$i = 0;
+
+ global $config, $g, $tcpflags;
$lancfg = $config['interfaces']['lan'];
$pptpdcfg = $config['pptpd'];
@@ -392,8 +372,6 @@ function filter_generate_pf_altq_rules() {
$ispppoe = false;
}
-
-
if (strstr($rule['source']['network'], "opt")) {
if (!array_key_exists($rule['source']['network'], $optcfg)) {
$i++;
OpenPOWER on IntegriCloud