Skip to content

Commit

Permalink
net: lan78xx: Allow for VLAN headers in timeout.
Browse files Browse the repository at this point in the history
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 <dave.stevenson@raspberrypi.org>
  • Loading branch information
6by9 authored and popcornmix committed Aug 22, 2018

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 2ad43a1 commit d07d5b3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/net/usb/lan78xx.c
Original file line number Diff line number Diff line change
@@ -2216,7 +2216,7 @@ static int lan78xx_change_mtu(struct net_device *netdev, int new_mtu)
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;

@@ -2516,7 +2516,8 @@ static int lan78xx_reset(struct lan78xx_net *dev)
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_;

0 comments on commit d07d5b3

Please sign in to comment.