Skip to content

Commit abf111c

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 8fd04c6 commit abf111c

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
@@ -2997,12 +2997,13 @@ static void lan78xx_rx_csum_offload(struct lan78xx_net *dev,
29972997
struct sk_buff *skb,
29982998
u32 rx_cmd_a, u32 rx_cmd_b)
29992999
{
3000-
/* Checksum offload appears to be flawed if used with VLANs.
3001-
* Elect for sw checksum check instead.
3000+
/* HW Checksum offload appears to be flawed if used when not stripping
3001+
* VLAN headers.
30023002
*/
30033003
if (!(dev->net->features & NETIF_F_RXCSUM) ||
30043004
unlikely(rx_cmd_a & RX_CMD_A_ICSM_) ||
3005-
(rx_cmd_a & RX_CMD_A_FVTG_)) {
3005+
((rx_cmd_a & RX_CMD_A_FVTG_) &&
3006+
!(dev->net->features & NETIF_F_HW_VLAN_CTAG_RX))) {
30063007
skb->ip_summed = CHECKSUM_NONE;
30073008
} else {
30083009
skb->csum = ntohs((u16)(rx_cmd_b >> RX_CMD_B_CSUM_SHIFT_));

0 commit comments

Comments
 (0)