Skip to content

Instantly share code, notes, and snippets.

@neofob
Last active October 7, 2015 11:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neofob/3158055 to your computer and use it in GitHub Desktop.
Save neofob/3158055 to your computer and use it in GitHub Desktop.
A patch for 3.5 kernel to provide jumbo frame support for CuBox from Rabeeh Khoury's 2.6.32-9 fork Update to current git diff as of Nov 8, 2013 from https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git This is against v3.12 branch.
diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
index 2c210ec..528770b 100644
--- a/drivers/net/ethernet/marvell/mv643xx_eth.c
+++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
@@ -2333,6 +2333,13 @@ static int mv643xx_eth_change_mtu(struct net_device *dev, int new_mtu)
dev->mtu = new_mtu;
mv643xx_eth_recalc_skb_size(mp);
tx_set_rate(mp, 1000000000, 16777216);
+ if (dev->mtu > 1600) {
+ dev->features &= ~NETIF_F_IP_CSUM;
+ dev->vlan_features &= ~NETIF_F_IP_CSUM;
+ } else {
+ dev->features |= NETIF_F_IP_CSUM;
+ dev->vlan_features |= NETIF_F_IP_CSUM;
+ }
if (!netif_running(dev))
return 0;
@neofob
Copy link
Author

neofob commented Nov 6, 2013

The Marvell chip on Cubox supports jumbo frame but it only supports hardware checksum offload up to 1600 mtu. That is why we need to disable hardware checksum when mtu is greater than 1600.

Interweb discussion:
https://groups.google.com/forum/#!topic/linux.debian.ports.arm/bPrwvTxRQQc
http://comments.gmane.org/gmane.linux.ports.arm.kernel/178785

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment