Skip to content

Commit 6f33251

Browse files
6by9popcornmix
authored andcommitted
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 #2458 Signed-off-by: Dave Stevenson <[email protected]>
1 parent 75f7f0c commit 6f33251

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/net/usb/lan78xx.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2016,7 +2016,7 @@ static int lan78xx_change_mtu(struct net_device *netdev, int new_mtu)
20162016
if ((ll_mtu % dev->maxpacket) == 0)
20172017
return -EDOM;
20182018

2019-
ret = lan78xx_set_rx_max_frame_length(dev, new_mtu + ETH_HLEN);
2019+
ret = lan78xx_set_rx_max_frame_length(dev, new_mtu + VLAN_ETH_HLEN);
20202020

20212021
netdev->mtu = new_mtu;
20222022

@@ -2307,7 +2307,8 @@ static int lan78xx_reset(struct lan78xx_net *dev)
23072307
buf |= FCT_TX_CTL_EN_;
23082308
ret = lan78xx_write_reg(dev, FCT_TX_CTL, buf);
23092309

2310-
ret = lan78xx_set_rx_max_frame_length(dev, dev->net->mtu + ETH_HLEN);
2310+
ret = lan78xx_set_rx_max_frame_length(dev,
2311+
dev->net->mtu + VLAN_ETH_HLEN);
23112312

23122313
ret = lan78xx_read_reg(dev, MAC_RX, &buf);
23132314
buf |= MAC_RX_RXEN_;

0 commit comments

Comments
 (0)