Skip to content

Commit 69f9423

Browse files
6by9popcornmix
authored andcommitted
net: lan78xx: Reduce s/w csum check on VLANs
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 <[email protected]>
1 parent b22c118 commit 69f9423

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/net/usb/lan78xx.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2995,12 +2995,13 @@ static void lan78xx_rx_csum_offload(struct lan78xx_net *dev,
29952995
struct sk_buff *skb,
29962996
u32 rx_cmd_a, u32 rx_cmd_b)
29972997
{
2998-
/* Checksum offload appears to be flawed if used with VLANs.
2999-
* Elect for sw checksum check instead.
2998+
/* HW Checksum offload appears to be flawed if used when not stripping
2999+
* VLAN headers.
30003000
*/
30013001
if (!(dev->net->features & NETIF_F_RXCSUM) ||
30023002
unlikely(rx_cmd_a & RX_CMD_A_ICSM_) ||
3003-
(rx_cmd_a & RX_CMD_A_FVTG_)) {
3003+
((rx_cmd_a & RX_CMD_A_FVTG_) &&
3004+
!(dev->net->features & NETIF_F_HW_VLAN_CTAG_RX))) {
30043005
skb->ip_summed = CHECKSUM_NONE;
30053006
} else {
30063007
skb->csum = ntohs((u16)(rx_cmd_b >> RX_CMD_B_CSUM_SHIFT_));

0 commit comments

Comments
 (0)