TXCSUM forced on at boot which breaks wireless bridging
When you have a wireless interface bridged to a wired interface, txcsum needs to be disabled on the wired NIC in order for it to properly pass out traffic for non-local hosts across the bridge. It seems to contact the pfsense box itself OK, but nothing beyond.
On boot, txcsum is being forced on (Lines 939-942 of etc/inc/pfsense-utils.inc) which breaks the bridge at boot. Once the system is fully booted, you can go to Interfaces > OPT1 (or whatever the wireless interface is), then click Apply, and once the bridge is set back up, txcsum is disabled on the card.
I tried explicitly setting -txcsum in the code for the bridge setup, but apparently the code from pfsense-utils.inc happens after that point since it seemed to have no effect. Only when I commented out the above mentioned lines in pfsense-utils.inc was I able to get a working bridge on reboot.
Not sure if that check in pfsense-utils.inc needs to be "bridge-aware" or if it's even really necessary.
How to reproduce:
Add ath0 as an OPT, enable, bridge to LAN, add firewall rules, and reboot. Bridge doesn't work. Check ifconfig output, txcsum is present. Either Apply on the interface config page or run "ifconfig <LAN int> -txcsum", bridge works.
Disable checksum offloading on wired interfaces when a wireless interface is bridged.
Ticket #88. Add checks to disable txcsum when needed for wirless interfaces so it does not break bridging when teh interface itself is reconfigured.
Ticket #88. Correctly use the parameter returned from link_interface_to_bridge to actually set the flags on the interface being configured the same as the bridge. While here simplify gre/gif handling too.
Get the real flags set on the interface to make code below work properly! Ticket #88.
Ticket #88. When creating the bridge find the common flags needed related to rxcsum/txcsum so that the bridge actually works.
Fixes #88. Actually fix all the mess that was caused by setup_microcode() which overwrote the whole decisions being made on boot from other code. Solve this by moving the setting of all interface capabilities to interface_configure() and just leaving microcode setup to setup_microcode. Also optimize and make more readble the polling setup if activated/deactivated. This also fixes the ticket issue because the settings are now kept after booting up and not overwritten by other code.
#2 Updated by Jim Pingle almost 10 years ago
We may need to find out what other hardware people are using then, it is a problem with vr0+ath0 at least. Not sure when it started either.
There is one other report of turning off txcsum helping:
#3 Updated by Chris Buechler almost 10 years ago
- Target version changed from 1.2.3 to 2.0
- Affected Version changed from 1.2.3 to 2.0
Leaving open for 2.0, and did not commit this to mainline, as we need to revisit on FreeBSD 8. This appears to be vr(4) specific, and may no longer be an issue in 8.
#4 Updated by Jim Pingle almost 10 years ago
That patch won't help at boot, unfortunately. The bridge is setup and that code is evaluated before the settings check for Enable/Disable hardware checksums (Lines 939-942 of etc/inc/pfsense-utils.inc). If hardware checksums are not disabled, they are forced on by enable_hardware_offloading().
If you reinitialize the bridge after boot, the checksums were already turned off, even without being explicitly turned off.
#5 Updated by Chris Buechler almost 10 years ago
additional commit to fix at boot time.
#6 Updated by Jim Pingle almost 10 years ago
Looks like that last patch may have had some unintended side effects on vlans:
#7 Updated by Chris Buechler almost 10 years ago
At a glance it looked like it just made a different bug apparent where VLANs shouldn't have that set, but that code actually does properly skip VLANs. The errors came from interfaces_vlan_configure which wasn't touched, and I'm not sure how that change made it start spitting its errors out onto the console, but it's fixed now.
#8 Updated by Ben Eisenbraun almost 10 years ago
I have this problem running on an Alix2d2 with an Atheros card, so it's also a vr0+ath0 combo. 'ifconfig vr0 -txcsum' resolves the problem.
It looks like they are disabling txcsum on m0n0 in some situations due to the same issue:
#12 Updated by Dainel Spisak about 9 years ago
I am experiencing this problem under Pfsense 2.0 Mon May 24 01:39:17 EDT 2010 on my ALIX2c3. This worked correctly under 1.2.3-release for me. Under 2.0 if I go and reapply my WLAN interface settings TXCSUM is still set. But if I delete Bridge0 and recreate the WLAN <-> LAN bridge TXCSUM does get removed from my vr0 interface properly and WiFi traffic will start to work again.