kernel: bump 4.14 to 4.14.93
[openwrt/staging/chunkeey.git] / target / linux / brcm2708 / patches-4.14 / 950-0265-net-lan78xx-Allow-for-VLAN-headers-in-timeout.patch
1 From 50340b55bb7af7c12259d3bce5da6ba969c58e00 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.org>
3 Date: Wed, 4 Apr 2018 16:34:24 +0100
4 Subject: [PATCH 265/454] net: lan78xx: Allow for VLAN headers in timeout.
5
6 The frame abort timeout being set by lan78xx_set_rx_max_frame_length
7 didn't account for any VLAN headers, resulting in very low
8 throughput if used with tagged VLANs.
9 Use VLAN_ETH_HLEN instead of ETH_HLEN to correct for this.
10
11 See https://github.com/raspberrypi/linux/issues/2458
12
13 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
14 ---
15 drivers/net/usb/lan78xx.c | 5 +++--
16 1 file changed, 3 insertions(+), 2 deletions(-)
17
18 --- a/drivers/net/usb/lan78xx.c
19 +++ b/drivers/net/usb/lan78xx.c
20 @@ -2194,7 +2194,7 @@ static int lan78xx_change_mtu(struct net
21 if ((ll_mtu % dev->maxpacket) == 0)
22 return -EDOM;
23
24 - ret = lan78xx_set_rx_max_frame_length(dev, new_mtu + ETH_HLEN);
25 + ret = lan78xx_set_rx_max_frame_length(dev, new_mtu + VLAN_ETH_HLEN);
26
27 netdev->mtu = new_mtu;
28
29 @@ -2487,7 +2487,8 @@ static int lan78xx_reset(struct lan78xx_
30 buf |= FCT_TX_CTL_EN_;
31 ret = lan78xx_write_reg(dev, FCT_TX_CTL, buf);
32
33 - ret = lan78xx_set_rx_max_frame_length(dev, dev->net->mtu + ETH_HLEN);
34 + ret = lan78xx_set_rx_max_frame_length(dev,
35 + dev->net->mtu + VLAN_ETH_HLEN);
36
37 ret = lan78xx_read_reg(dev, MAC_RX, &buf);
38 buf |= MAC_RX_RXEN_;