diff mbox series

[net-next,v0,1/1] net: mv643xx_eth: disable IP tx checksum with jumbo frames for Armada 310

Message ID 20241113110040.24181-1-qingtao.cao@digi.com (mailing list archive)
State New
Delegated to: Netdev Maintainers
Headers show
Series [net-next,v0,1/1] net: mv643xx_eth: disable IP tx checksum with jumbo frames for Armada 310 | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 3 this patch: 3
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 6 of 6 maintainers
netdev/build_clang success Errors and warnings before: 3 this patch: 3
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 10 this patch: 10
netdev/checkpatch warning WARNING: From:/Signed-off-by: email address mismatch: 'From: Qingtao Cao <qingtao.cao.au@gmail.com>' != 'Signed-off-by: Qingtao Cao <qingtao.cao@digi.com>'
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-11-14--03-00 (tests: 782)

Commit Message

Qingtao Cao Nov. 13, 2024, 11 a.m. UTC
The Ethernet controller found in Armada 310 doesn't support TCP/IP checksum
with frame sizes larger than its TX checksum offload limit

Disable the features NETIF_F_IP_CSUM and NETIF_F_TSO when the MTU is set to
a value larger than this limit, to prevent the software TSO generating GSO
packets that are not suitable to offload to the Ethernet controller, which
would be calculated by the IP stack instead.

Signed-off-by: Qingtao Cao <qingtao.cao@digi.com>
---
 drivers/net/ethernet/marvell/mv643xx_eth.c | 7 +++++++
 1 file changed, 7 insertions(+)
diff mbox series

Patch

diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
index 9e80899546d9..34d464f0be1b 100644
--- a/drivers/net/ethernet/marvell/mv643xx_eth.c
+++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
@@ -2563,6 +2563,13 @@  static int mv643xx_eth_change_mtu(struct net_device *dev, int new_mtu)
 	struct mv643xx_eth_private *mp = netdev_priv(dev);
 
 	WRITE_ONCE(dev->mtu, new_mtu);
+	if (mp->shared->tx_csum_limit &&
+	    dev->mtu > mp->shared->tx_csum_limit) {
+		dev->features &= ~(NETIF_F_IP_CSUM | NETIF_F_TSO);
+		netdev_info(dev,
+			    "Disable IP tx csum offload and software TSO for MTU larger than %dB\n",
+			    mp->shared->tx_csum_limit);
+	}
 	mv643xx_eth_recalc_skb_size(mp);
 	tx_set_rate(mp, 1000000000, 16777216);