Skip to content

Commit b9a321b

Browse files
Mark Lorddavem330
authored andcommitted
r8152: Fix broken RX checksums.
The r8152 driver has been broken since (approx) 3.16.xx when support was added for hardware RX checksums on newer chip versions. Symptoms include random segfaults and silent data corruption over NFS. The hardware checksum logig does not work on the VER_02 dongles I have here when used with a slow embedded system CPU. Google reveals others reporting similar issues on Raspberry Pi. So, disable hardware RX checksum support for VER_02, and fix an obvious coding error for IPV6 checksums in the same function. Because this bug results in silent data corruption, it is a good candidate for back-porting to -stable >= 3.16.xx. Signed-off-by: Mark Lord <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 2a26d99 commit b9a321b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/usb/r8152.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1730,7 +1730,7 @@ static u8 r8152_rx_csum(struct r8152 *tp, struct rx_desc *rx_desc)
17301730
u8 checksum = CHECKSUM_NONE;
17311731
u32 opts2, opts3;
17321732

1733-
if (tp->version == RTL_VER_01)
1733+
if (tp->version == RTL_VER_01 || tp->version == RTL_VER_02)
17341734
goto return_result;
17351735

17361736
opts2 = le32_to_cpu(rx_desc->opts2);
@@ -1745,7 +1745,7 @@ static u8 r8152_rx_csum(struct r8152 *tp, struct rx_desc *rx_desc)
17451745
checksum = CHECKSUM_NONE;
17461746
else
17471747
checksum = CHECKSUM_UNNECESSARY;
1748-
} else if (RD_IPV6_CS) {
1748+
} else if (opts2 & RD_IPV6_CS) {
17491749
if ((opts2 & RD_UDP_CS) && !(opts3 & UDPF))
17501750
checksum = CHECKSUM_UNNECESSARY;
17511751
else if ((opts2 & RD_TCP_CS) && !(opts3 & TCPF))

0 commit comments

Comments
 (0)