提交 1a37809d 编写于 作者: D Dave Stevenson 提交者: Zheng Zengkai

net: lan78xx: Disable TCP Segmentation Offload (TSO)

raspberrypi inclusion
category: feature
bugzilla: 50432

--------------------------------

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/2482Signed-off-by: NDave Stevenson <dave.stevenson@raspberrypi.org>
Signed-off-by: NFang Yafen <yafen@iscas.ac.cn>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 60c23ac1
......@@ -425,6 +425,15 @@ static int msg_level = -1;
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);
......@@ -2917,8 +2926,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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册