diff options
author | Ermal <eri@pfsense.org> | 2010-08-19 12:45:14 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2010-08-19 12:45:14 +0000 |
commit | 9a4c3eed1841f2ebd118875acc8cdbc1d14e8b7c (patch) | |
tree | 758a133f364ad803cedb9b8e0a2e89cdc18d82c9 /etc/inc | |
parent | 7b87710838513521a0008228fe04b6362aea63b3 (diff) | |
download | pfsense-9a4c3eed1841f2ebd118875acc8cdbc1d14e8b7c.zip pfsense-9a4c3eed1841f2ebd118875acc8cdbc1d14e8b7c.tar.gz |
Setup polling per interface rather only at bootup. This is a proper fix and a optimization on large interface cases. Also setup_microcode and polling defaults before configuring interfaces.
Diffstat (limited to 'etc/inc')
-rw-r--r-- | etc/inc/interfaces.inc | 11 | ||||
-rw-r--r-- | etc/inc/pfsense-utils.inc | 38 |
2 files changed, 15 insertions, 34 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index f576458..213936d 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -2372,9 +2372,16 @@ function interface_configure($interface = "wan", $reloadall = false) { if (!empty($wancfg['mtu'])) pfSense_interface_mtu($realif, $wancfg['mtu']); + $options = pfSense_get_interface_addresses($realif); + if (is_array($options) && isset($options['caps']['polling'])) { + if (isset($config['system']['polling'])) + pfSense_interface_capabilities($realif, IFCAP_POLLING); + else + pfSense_interface_capabilities($realif, -IFCAP_POLLING); + } + /* skip vlans for checksumming and polling */ - if (!stristr($realif, "vlan")) { - $options = pfSense_get_interface_addresses($realif); + if (!stristr($realif, "vlan") && is_array($options)) { $flags = 0; if(isset($config['system']['disablechecksumoffloading'])) { if (isset($options['encaps']['txcsum'])) diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index 62e5e6f..3146306 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -275,26 +275,6 @@ function is_schedule_inuse($schedule) { return false; } -/****f* pfsense-utils/setup_polling_defaults - * NAME - * sets up sysctls for polling - * INPUTS - * - * RESULT - * null - * NOTES - * - ******/ -function setup_polling_defaults() { - global $g, $config; - if($config['system']['polling_each_burst']) - mwexec("sysctl kern.polling.each_burst={$config['system']['polling_each_burst']}"); - if($config['system']['polling_burst_max']) - mwexec("sysctl kern.polling.burst_max={$config['system']['polling_burst_max']}"); - if($config['system']['polling_user_frac']) - mwexec("sysctl kern.polling.user_frac={$config['system']['polling_user_frac']}"); -} - /****f* pfsense-utils/setup_polling * NAME * sets up polling @@ -315,18 +295,12 @@ function setup_polling() { else mwexec("/sbin/sysctl kern.polling.idle_poll=0"); - /* if list */ - $iflist = get_configured_interface_list(); - - foreach ($iflist as $ifent => $ifname) { - $real_interface = get_real_interface($ifname); - if (interface_supports_polling($real_interface)) { - if (isset($config['system']['polling'])) - pfSense_interface_capabilities($real_interface, IFCAP_POLLING); - else - pfSense_interface_capabilities($real_interface, -IFCAP_POLLING); - } - } + if($config['system']['polling_each_burst']) + mwexec("/sbin/sysctl kern.polling.each_burst={$config['system']['polling_each_burst']}"); + if($config['system']['polling_burst_max']) + mwexec("/sbin/sysctl kern.polling.burst_max={$config['system']['polling_burst_max']}"); + if($config['system']['polling_user_frac']) + mwexec("/sbin/sysctl kern.polling.user_frac={$config['system']['polling_user_frac']}"); } /****f* pfsense-utils/setup_microcode |