net: fec: Don't clear IPV6 header checksum field when IP accelerator enable
authorFugang Duan <b38611@freescale.com>
Wed, 18 Jun 2014 00:33:52 +0000 (08:33 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 18 Jun 2014 04:58:35 +0000 (21:58 -0700)
commit62a02c98ce03bb214009509a4802b7b63f59621c
tree04d83ba341ba35715e6438df9e7bbf48e6b62fa6
parentbc56151d07eab55437ff7b47c4cb3278d476ea6b
net: fec: Don't clear IPV6 header checksum field when IP accelerator enable

The commit 96c50caa5148 (net: fec: Enable IP header hardware checksum)
enable HW IP header checksum for IPV4 and IPV6, which causes IPV6 TCP/UDP
cannot work. (The issue is reported by Russell King)

For FEC IP header checksum function: Insert IP header checksum. This "IINS"
bit is written by the user. If set, IP accelerator calculates the IP header
checksum and overwrites the IINS corresponding header field with the calculated
value. The checksum field must be cleared by user, otherwise the checksum
always is 0xFFFF.

So the previous patch clear IP header checksum field regardless of IP frame
type.

In fact, IP HW detect the packet as IPV6 type, even if the "IINS" bit is set,
the IP accelerator is not triggered to calculates IPV6 header checksum because
IPV6 frame format don't have checksum.

So this results in the IPV6 frame being corrupted.

The patch just add software detect the current packet type, if it is IPV6
frame, it don't clear IP header checksum field.

Cc: Russell King <linux@arm.linux.org.uk>
Reported-and-tested-by: Russell King <linux@arm.linux.org.uk>
Signed-off-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/fec_main.c