Skip to content

Commit

Permalink
net: lan78xx: Disable TCP Segmentation Offload (TSO)
Browse files Browse the repository at this point in the history
commit 6fa07a5a10e7724c34d51b12187a138e85775433 from
https://github.com/raspberrypi/linux.git rpi-6.6.y

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.

raspberrypi/linux#2449
raspberrypi/linux#2482

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
Signed-off-by: Rajeshkumar Ramasamy <rajeshkumar.ramasamy@windriver.com>
  • Loading branch information
6by9 authored and rajeshkumarwr committed Aug 10, 2024
1 parent 0dcadac commit b1e7eeb
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions drivers/net/usb/lan78xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,15 @@ static int lan78xx_alloc_tx_resources(struct lan78xx_net *dev)
dev->n_tx_urbs, dev->tx_urb_size, dev);
}

/* 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;
Expand Down Expand Up @@ -3471,8 +3480,14 @@ static int lan78xx_bind(struct lan78xx_net *dev, struct usb_interface *intf)
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;
Expand Down

0 comments on commit b1e7eeb

Please sign in to comment.