Skip to content

Commit 8dcd3e0

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 70905ad commit 8dcd3e0

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
@@ -2216,7 +2216,7 @@ static int lan78xx_change_mtu(struct net_device *netdev, int new_mtu)
22162216
if ((ll_mtu % dev->maxpacket) == 0)
22172217
return -EDOM;
22182218

2219-
ret = lan78xx_set_rx_max_frame_length(dev, new_mtu + ETH_HLEN);
2219+
ret = lan78xx_set_rx_max_frame_length(dev, new_mtu + VLAN_ETH_HLEN);
22202220

22212221
netdev->mtu = new_mtu;
22222222

@@ -2516,7 +2516,8 @@ static int lan78xx_reset(struct lan78xx_net *dev)
25162516
buf |= FCT_TX_CTL_EN_;
25172517
ret = lan78xx_write_reg(dev, FCT_TX_CTL, buf);
25182518

2519-
ret = lan78xx_set_rx_max_frame_length(dev, dev->net->mtu + ETH_HLEN);
2519+
ret = lan78xx_set_rx_max_frame_length(dev,
2520+
dev->net->mtu + VLAN_ETH_HLEN);
25202521

25212522
ret = lan78xx_read_reg(dev, MAC_RX, &buf);
25222523
buf |= MAC_RX_RXEN_;

0 commit comments

Comments
 (0)