New user's registration have been closed due to high spamming and low trafic on this forum. Please contact forum admins directly if you need an account. Thanks !

B3 with kernel 3.16+: Marvell ethernet issue + workaround

Discuss development on Bubba
Post Reply
sakaki
Posts: 172
Joined: 15 Aug 2014, 11:20

B3 with kernel 3.16+: Marvell ethernet issue + workaround

Post by sakaki »

Hello,

if you are using kernel 3.16+ on your B3, you may run into an issue with data corruption during large file transfers on the Ethernet ports. This affects e.g. distcc, causing intermittent remote compilation failures with no apparent underlying cause (same gcc versions on client and server etc.). It can also affect Samba and similar services.

The problem turns out to be caused by TCP segmentation offload (tso), introduced in a 3.16 Marvell ethernet driver. See this archlinuxarm post, and the prior post it links to. The relevant file is drivers/net/ethernet/marvell/mv643xx_eth.c.

You can patch the kernel to address this, but a simpler way is just to ensure you have ethtool installed, and then use a udev rule like the following: (add to e.g. /etc/udev/rules.d/50-marvell-fix-tso.rules):

Code: Select all

# Disable Marvell TCP segmentation offload due to bugs
# See e.g. http://archlinuxarm.org/forum/viewtopic.php?f=9&t=7692&start=20
ACTION=="add", SUBSYSTEM=="net", KERNEL=="eth[0-1]", RUN+="/usr/sbin/ethtool -K %k tso off"
You can check that it has taken effect after a reboot with:

Code: Select all

b3 ~ # ethtool -k eth0 | grep tcp
tcp-segmentation-offload: off
... further output omitted ...
b3 ~ # ethtool -k eth1 | grep tcp
tcp-segmentation-offload: off
... further output omitted ...
I have used ethtool at the command line to toggle tso on and off, and been able to observe remote compilation of a fairly large package (boost) switch between unreliable and reliable state, using 3.17.1.

If investigation shows this still to be an issue in 3.18.5, the above udev rule will be included the 1.3.0 Gentoo live USB.
Post Reply