Skip to content

Commit

Permalink
net: lan78xx: Reduce s/w csum check on VLANs
Browse files Browse the repository at this point in the history
With HW_VLAN_CTAG_RX enabled we don't observe the checksum
issue, so amend the workaround to only drop back to s/w
checksums if VLAN offload is disabled.

See #2458.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
  • Loading branch information
6by9 authored and popcornmix committed Aug 14, 2018
1 parent 4e411be commit bbce83e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/net/usb/lan78xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -2997,12 +2997,13 @@ static void lan78xx_rx_csum_offload(struct lan78xx_net *dev,
struct sk_buff *skb,
u32 rx_cmd_a, u32 rx_cmd_b)
{
/* Checksum offload appears to be flawed if used with VLANs.
* Elect for sw checksum check instead.
/* HW Checksum offload appears to be flawed if used when not stripping
* VLAN headers.
*/
if (!(dev->net->features & NETIF_F_RXCSUM) ||
unlikely(rx_cmd_a & RX_CMD_A_ICSM_) ||
(rx_cmd_a & RX_CMD_A_FVTG_)) {
((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 bbce83e

Please sign in to comment.