summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Buechler <cmb@pfsense.org>2009-04-23 23:55:37 -0400
committerChris Buechler <cmb@pfsense.org>2009-04-23 23:55:37 -0400
commita7c6604c06ba8be40533f4e5784bca9676a34e73 (patch)
tree895c84aa6824cc7d5084ce1cee6b8683783e9fd4
parent233405d75aba8c21d375835adeb0f92d9e6814d6 (diff)
downloadpfsense-a7c6604c06ba8be40533f4e5784bca9676a34e73.zip
pfsense-a7c6604c06ba8be40533f4e5784bca9676a34e73.tar.gz
Fix "disable checksum offloading", and some other bugs with certain combinations of options while here.
-rw-r--r--etc/inc/pfsense-utils.inc34
-rw-r--r--usr/local/www/system_advanced_network.php6
2 files changed, 24 insertions, 16 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc
index 2f7c8bf..883b8ad 100644
--- a/etc/inc/pfsense-utils.inc
+++ b/etc/inc/pfsense-utils.inc
@@ -866,34 +866,40 @@ function enable_hardware_offloading($interface) {
if(stristr($interface,"lnc"))
return;
- if(isset($config['system']['do_not_use_nic_microcode']))
- return;
-
/* translate wan, lan, opt -> real interface if needed */
$int = filter_translate_type_to_real_interface($interface);
- if($int <> "")
- $interface = $int;
+ if($int <> "") $interface = $int;
$int_family = preg_split("/[0-9]+/", $int);
- $options = strtolower(`/sbin/ifconfig {$interface} | grep options`);
+ $options = strtolower(`/sbin/ifconfig -m {$interface} | grep capabilities`);
$supported_ints = array('fxp');
- if (in_array($int_family, $supported_ints))
+ if (in_array($int_family, $supported_ints)) {
+ if(isset($config['system']['do_not_use_nic_microcode']))
+ continue;
mwexec("/sbin/ifconfig {$interface} link0");
+ }
- if($config['system']['disablechecksumoffloading'])
+ /* skip vlans for checksumming and polling */
+ 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($config['system']['disablechecksumoffloading']) {
+ 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");
+ } else {
+ 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 the NIC supports polling *AND* it is enabled in the GUI */
if(interface_supports_polling($interface)) {
$polling = isset($config['system']['polling']);
if($polling) {
mwexec("sysctl kern.polling.enable=1");
- mwexec("/sbin/ifconfig {$interface} polling 2>/dev/null");
+ mwexec("/sbin/ifconfig {$interface} polling 2>/dev/null");
} else {
mwexec("sysctl kern.polling.enable=0");
}
diff --git a/usr/local/www/system_advanced_network.php b/usr/local/www/system_advanced_network.php
index 8919dce..ffb003c 100644
--- a/usr/local/www/system_advanced_network.php
+++ b/usr/local/www/system_advanced_network.php
@@ -98,8 +98,10 @@ if ($_POST) {
if($_POST['disablechecksumoffloading'] == "yes") {
$config['system']['disablechecksumoffloading'] = $_POST['disablechecksumoffloading'];
+ setup_microcode();
} else {
unset($config['system']['disablechecksumoffloading']);
+ setup_microcode();
}
write_config();
@@ -214,8 +216,8 @@ function enable_change(enable_over) {
<td width="22%" valign="top" class="vncell">Hardware Checksum Offloading</td>
<td width="78%" class="vtable">
<input name="disablechecksumoffloading" type="checkbox" id="disablechecksumoffloading" value="yes" <?php if (isset($config['system']['disablechecksumoffloading'])) echo "checked"; ?> />
- <strong>Disable hardware checksum offload.</strong><br>
- This option will hardware assisted checksum offloading. FreeBSD sometimes has difficulties with certain drivers.
+ <strong>Disable hardware checksum offload</strong><br>
+ Checking this option will disable hardware checksum offloading. Checksum offloading is broken in some hardware, particularly some Realtek cards. Rarely, drivers may have problems with checksum offloading and some specific NICs.
</td>
</tr>
<tr>
OpenPOWER on IntegriCloud