summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2008-11-20 22:01:06 +0000
committerScott Ullrich <sullrich@pfsense.org>2008-11-20 22:01:06 +0000
commit6a9d8cadcaf9c8c6e86a0f34f17a09dd6e05bbf7 (patch)
treef065a2fa589afe56ca7bd96a163840dad28fa681
parent11d67a3c0480bc878b512e9efbe7186492d99282 (diff)
downloadpfsense-6a9d8cadcaf9c8c6e86a0f34f17a09dd6e05bbf7.zip
pfsense-6a9d8cadcaf9c8c6e86a0f34f17a09dd6e05bbf7.tar.gz
* Honor $config['system']['polling'
* Enable / disable polling even if we are not booting.
-rw-r--r--etc/inc/pfsense-utils.inc23
1 files changed, 15 insertions, 8 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc
index 28d4de3..513443d 100644
--- a/etc/inc/pfsense-utils.inc
+++ b/etc/inc/pfsense-utils.inc
@@ -894,10 +894,10 @@ function enable_hardware_offloading($interface) {
if(stristr($interface,"lnc"))
return;
+
if(isset($config['system']['do_not_use_nic_microcode']))
return;
- if($g['booting']) {
/* translate wan, lan, opt -> real interface if needed */
$int = filter_translate_type_to_real_interface($interface);
if($int <> "") $interface = $int;
@@ -909,18 +909,26 @@ function enable_hardware_offloading($interface) {
if($config['system']['disablechecksumoffloading'])
return;
+
/* skip vlans for checksumming and polling */
- if(stristr($interface, "vlan")) {
+ if(stristr($interface, "vlan"))
return;
- }
+
if(stristr($options, "txcsum") == true)
mwexec("/sbin/ifconfig {$interface} txcsum 2>/dev/null");
+
if(stristr($options, "rxcsum") == true)
mwexec("/sbin/ifconfig {$interface} rxcsum 2>/dev/null");
- if(stristr($options, "polling") == true)
- mwexec("/sbin/ifconfig {$interface} polling 2>/dev/null");
- } else {
- mwexec("sysctl kern.polling.enable=0");
+
+ /* if the NIC supports polling *AND* it is enabled in the GUI */
+ if(stristr($options, "polling") == true) {
+ $polling = isset($config['system']['polling']);
+ if($polling) {
+ mwexec("sysctl kern.polling.enable=1");
+ mwexec("/sbin/ifconfig {$interface} polling 2>/dev/null");
+ } else {
+ mwexec("sysctl kern.polling.enable=0");
+ }
}
return;
}
@@ -3692,5 +3700,4 @@ function safe_write_file($file, $content, $force_binary) {
return true;
}
-
?> \ No newline at end of file
OpenPOWER on IntegriCloud