1234567891011121314151617181920212223242526272829303132333435363738 |
- From 50340b55bb7af7c12259d3bce5da6ba969c58e00 Mon Sep 17 00:00:00 2001
- From: Dave Stevenson <[email protected]>
- Date: Wed, 4 Apr 2018 16:34:24 +0100
- Subject: [PATCH 265/454] net: lan78xx: Allow for VLAN headers in timeout.
- The frame abort timeout being set by lan78xx_set_rx_max_frame_length
- didn't account for any VLAN headers, resulting in very low
- throughput if used with tagged VLANs.
- Use VLAN_ETH_HLEN instead of ETH_HLEN to correct for this.
- See https://github.com/raspberrypi/linux/issues/2458
- Signed-off-by: Dave Stevenson <[email protected]>
- ---
- drivers/net/usb/lan78xx.c | 5 +++--
- 1 file changed, 3 insertions(+), 2 deletions(-)
- --- a/drivers/net/usb/lan78xx.c
- +++ b/drivers/net/usb/lan78xx.c
- @@ -2194,7 +2194,7 @@ static int lan78xx_change_mtu(struct net
- if ((ll_mtu % dev->maxpacket) == 0)
- return -EDOM;
-
- - ret = lan78xx_set_rx_max_frame_length(dev, new_mtu + ETH_HLEN);
- + ret = lan78xx_set_rx_max_frame_length(dev, new_mtu + VLAN_ETH_HLEN);
-
- netdev->mtu = new_mtu;
-
- @@ -2487,7 +2487,8 @@ static int lan78xx_reset(struct lan78xx_
- buf |= FCT_TX_CTL_EN_;
- ret = lan78xx_write_reg(dev, FCT_TX_CTL, buf);
-
- - ret = lan78xx_set_rx_max_frame_length(dev, dev->net->mtu + ETH_HLEN);
- + ret = lan78xx_set_rx_max_frame_length(dev,
- + dev->net->mtu + VLAN_ETH_HLEN);
-
- ret = lan78xx_read_reg(dev, MAC_RX, &buf);
- buf |= MAC_RX_RXEN_;
|