Skip to content

Commit 9343ac8

Browse files
6by9davem330
authored andcommitted
net: lan78xx: Use s/w csum check on VLANs without tag stripping
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>
1 parent ec21ecf commit 9343ac8

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎drivers/net/usb/lan78xx.c‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3052,8 +3052,13 @@ static void lan78xx_rx_csum_offload(struct lan78xx_net *dev,
30523052
struct sk_buff *skb,
30533053
u32 rx_cmd_a, u32 rx_cmd_b)
30543054
{
3055+
/* HW Checksum offload appears to be flawed if used when not stripping
3056+
* VLAN headers. Drop back to S/W checksums under these conditions.
3057+
*/
30553058
if (!(dev->net->features & NETIF_F_RXCSUM) ||
3056-
unlikely(rx_cmd_a & RX_CMD_A_ICSM_)) {
3059+
unlikely(rx_cmd_a & RX_CMD_A_ICSM_) ||
3060+
((rx_cmd_a & RX_CMD_A_FVTG_) &&
3061+
!(dev->net->features & NETIF_F_HW_VLAN_CTAG_RX))) {
30573062
skb->ip_summed = CHECKSUM_NONE;
30583063
} else {
30593064
skb->csum = ntohs((u16)(rx_cmd_b >> RX_CMD_B_CSUM_SHIFT_));

0 commit comments

Comments
 (0)