From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Fugang Duan <b38611@freescale.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: [PATCH] net: fec: remove HW IP header checksum for IPV6 frame
Date: Tue, 17 Jun 2014 11:20:25 +0100 [thread overview]
Message-ID: <20140617102024.GF23430@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1402993895-10955-1-git-send-email-b38611@freescale.com>
On Tue, Jun 17, 2014 at 04:31:35PM +0800, Fugang Duan wrote:
> 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)
>
> The reason is that FEC HW IP cannot detect the transmit frame type (can
> detect received frame type), and treats all packets as IPv4, overwrites
> the point in the packet which would be the IPv4 checksum field. Since IPV6
> don't have IP header checksum, so this results in the frame being corrupted.
>
> The patch just add software detect the current packet type, if it is IPV6
> frame, it don't enable IP header checksum.
I think it /can/ detect the packet type - the hardware showed no signs of
overwriting the checksum field with a non-zero value. The zeroing of the
bytes seems to come purely from the driver assuming that every partial
checksummed packet is an IPv4 packet:
> @@ -330,7 +335,8 @@ fec_enet_clear_csum(struct sk_buff *skb, struct net_device *ndev)
> if (unlikely(skb_cow_head(skb, 0)))
> return -1;
>
> - ip_hdr(skb)->check = 0;
> + if (is_ipv4_pkt(skb))
> + ip_hdr(skb)->check = 0;
> *(__sum16 *)(skb->head + skb->csum_start + skb->csum_offset) = 0;
>
> return 0;
So, I will first test whether avoiding this resolves the issue I'm
seeing before deciding whether to test the remainder of the patch.
--
FTTC broadband for 0.8mile line: now at 9.7Mbps down 460kbps up... slowly
improving, and getting towards what was expected from it.
next prev parent reply other threads:[~2014-06-17 10:20 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-17 8:31 [PATCH] net: fec: remove HW IP header checksum for IPV6 frame Fugang Duan
2014-06-17 10:20 ` Russell King - ARM Linux [this message]
2014-06-17 16:31 ` Russell King - ARM Linux
2014-06-17 22:34 ` David Miller
2014-06-17 23:21 ` Russell King - ARM Linux
2014-06-18 1:40 ` fugang.duan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140617102024.GF23430@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=b38611@freescale.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).