Skip to content

Commit

Permalink
net: lan78xx: Use s/w csum check on VLANs without tag stripping
Browse files Browse the repository at this point in the history
Observations of VLANs dropping packets due to invalid
checksums when not offloading VLAN tag receive.
With VLAN tag stripping enabled no issue is observed.

Drop back to s/w checksums if VLAN offload is disabled.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Dave Stevenson authored and David S. Miller committed Jun 26, 2018
1 parent ec21ecf commit 9343ac8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/net/usb/lan78xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -3052,8 +3052,13 @@ static void lan78xx_rx_csum_offload(struct lan78xx_net *dev,
struct sk_buff *skb,
u32 rx_cmd_a, u32 rx_cmd_b)
{
/* HW Checksum offload appears to be flawed if used when not stripping
* VLAN headers. Drop back to S/W checksums under these conditions.
*/
if (!(dev->net->features & NETIF_F_RXCSUM) ||
unlikely(rx_cmd_a & RX_CMD_A_ICSM_)) {
unlikely(rx_cmd_a & RX_CMD_A_ICSM_) ||
((rx_cmd_a & RX_CMD_A_FVTG_) &&
!(dev->net->features & NETIF_F_HW_VLAN_CTAG_RX))) {
skb->ip_summed = CHECKSUM_NONE;
} else {
skb->csum = ntohs((u16)(rx_cmd_b >> RX_CMD_B_CSUM_SHIFT_));
Expand Down

0 comments on commit 9343ac8

Please sign in to comment.