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 | |
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.
-rw-r--r-- | etc/inc/interfaces.inc | 11 | ||||
-rw-r--r-- | etc/inc/pfsense-utils.inc | 38 | ||||
-rwxr-xr-x | etc/rc.bootup | 18 |
3 files changed, 25 insertions, 42 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 diff --git a/etc/rc.bootup b/etc/rc.bootup index 0cd201a..d355c08 100755 --- a/etc/rc.bootup +++ b/etc/rc.bootup @@ -208,6 +208,16 @@ echo "Starting Secure Shell Services..."; mwexec_bg("/etc/sshd"); echo "done.\n"; +/* setup polling */ +echo "Setting up polling defaults..."; +setup_polling(); +echo "done.\n"; + +/* setup interface microcode which improves tcp/ip speed */ +echo "Setting up microcode and tx/rx offloading..."; +setup_microcode(); +echo "done.\n"; + /* set up interfaces */ if(!$debugging) mute_kernel_msgs(); @@ -306,14 +316,6 @@ voucher_configure(); /* run any shell commands specified in config.xml */ system_do_shell_commands(); -/* setup polling */ -setup_polling(); - -/* setup interface microcode which improves tcp/ip speed */ -echo "Setting up microcode and tx/rx offloading..."; -setup_microcode(); -echo "done.\n"; - /* start IPsec tunnels */ vpn_ipsec_configure(); |