2020-07-02 23:30:56 +08:00
|
|
|
From b34a93b528f08401835259c477ade49730fc1baf Mon Sep 17 00:00:00 2001
|
2019-07-16 02:39:17 -07:00
|
|
|
From: Dave Stevenson <dave.stevenson@raspberrypi.org>
|
|
|
|
Date: Wed, 13 Jun 2018 15:21:10 +0100
|
2020-01-11 23:39:11 +08:00
|
|
|
Subject: [PATCH] net: lan78xx: Disable TCP Segmentation Offload (TSO)
|
2019-07-16 02:39:17 -07:00
|
|
|
|
|
|
|
TSO seems to be having issues when packets are dropped and the
|
|
|
|
remote end uses Selective Acknowledge (SACK) to denote that
|
|
|
|
data is missing. The missing data is never resent, so the
|
|
|
|
connection eventually stalls.
|
|
|
|
|
|
|
|
There is a module parameter of enable_tso added to allow
|
|
|
|
further debugging without forcing a rebuild of the kernel.
|
|
|
|
|
|
|
|
https://github.com/raspberrypi/linux/issues/2449
|
|
|
|
https://github.com/raspberrypi/linux/issues/2482
|
|
|
|
|
|
|
|
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
|
|
|
|
---
|
|
|
|
drivers/net/usb/lan78xx.c | 19 +++++++++++++++++--
|
|
|
|
1 file changed, 17 insertions(+), 2 deletions(-)
|
|
|
|
|
|
|
|
--- a/drivers/net/usb/lan78xx.c
|
|
|
|
+++ b/drivers/net/usb/lan78xx.c
|
kernel: bump to 4.14.193, 4.19.138, 5.4.59 (#5350)
kernel: bump to 4.14.193, 4.19.138, 5.4.59 (#5350)
431fb8c mac80211: add AQL improvements
6bdd4c9 mac80211: add missing backports for building with 4.14 kernels
0106820 mac80211: add missing return code checks in AQL improvements
e7f7101 mac80211: rework encapsulation offload support
[package]
base-files: add function for generating random MAC
dnsmasq: abort dhcp_check on interface state
boot: sync upstream source code
ath10k-ct-firmware/mt76/sch_cake: update to latest git HEAD
[script]
download: add China Mirror Station
[target]
Sync: arc770, ath79, bcm63xx, kirkwood, lantiq, layerscape,
mediatek, mvebu, octeon, oxnas, pistachio, uml
Sync most of the target patches.
Run-compiled-on: ipq40xx (4.19 & 5.4), ramips
2020-08-26 11:31:50 +08:00
|
|
|
@@ -425,6 +425,15 @@ static int msg_level = -1;
|
2019-07-16 02:39:17 -07:00
|
|
|
module_param(msg_level, int, 0);
|
|
|
|
MODULE_PARM_DESC(msg_level, "Override default message level");
|
|
|
|
|
|
|
|
+/* TSO seems to be having some issue with Selective Acknowledge (SACK) that
|
|
|
|
+ * results in lost data never being retransmitted.
|
|
|
|
+ * Disable it by default now, but adds a module parameter to enable it for
|
|
|
|
+ * debug purposes (the full cause is not currently understood).
|
|
|
|
+ */
|
|
|
|
+static bool enable_tso;
|
|
|
|
+module_param(enable_tso, bool, 0644);
|
|
|
|
+MODULE_PARM_DESC(enable_tso, "Enables TCP segmentation offload");
|
|
|
|
+
|
|
|
|
static int lan78xx_read_reg(struct lan78xx_net *dev, u32 index, u32 *data)
|
|
|
|
{
|
|
|
|
u32 *buf = kmalloc(sizeof(u32), GFP_KERNEL);
|
2021-08-31 01:08:20 +08:00
|
|
|
@@ -2933,8 +2942,14 @@ static int lan78xx_bind(struct lan78xx_n
|
2019-07-16 02:39:17 -07:00
|
|
|
if (DEFAULT_RX_CSUM_ENABLE)
|
|
|
|
dev->net->features |= NETIF_F_RXCSUM;
|
|
|
|
|
|
|
|
- if (DEFAULT_TSO_CSUM_ENABLE)
|
|
|
|
- dev->net->features |= NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_SG;
|
|
|
|
+ if (DEFAULT_TSO_CSUM_ENABLE) {
|
|
|
|
+ dev->net->features |= NETIF_F_SG;
|
|
|
|
+ /* Use module parameter to control TCP segmentation offload as
|
|
|
|
+ * it appears to cause issues.
|
|
|
|
+ */
|
|
|
|
+ if (enable_tso)
|
|
|
|
+ dev->net->features |= NETIF_F_TSO | NETIF_F_TSO6;
|
|
|
|
+ }
|
|
|
|
|
|
|
|
if (DEFAULT_VLAN_RX_OFFLOAD)
|
|
|
|
dev->net->features |= NETIF_F_HW_VLAN_CTAG_RX;
|