[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <A4FD513AF09D40849B8A75C371F1D431@realtek.com.tw>
Date: Sat, 21 Jul 2012 00:01:38 +0800
From: hayeswang <hayeswang@...ltek.com>
To: 'Francois Romieu' <romieu@...zoreil.com>
CC: 'David Miller' <davem@...emloft.net>, <eric.dumazet@...il.com>,
<netdev@...r.kernel.org>
Subject: RE: [RFC] r8169 : why SG / TX checksum are default disabled
Francois Romieu [mailto:romieu@...zoreil.com]
[...]
> > I find that the total length field of IP header would be
> modified if the hw
> > checksum is enabled. Therefore, skb_padto + hw checksum
> wouldn't work.
>
> Ok, my patch completely ignored the fact that skb_padto does
> not change the
> length.
>
> However skb_padto + length adjustement + hw checksum should
> work (at least in
> theory if not in the patch below) ?
If the hw only fills in the checksum fields of IP header, UDP header, and TCP
header, the patch would work. However, the hw would also fill in the total
length field of IP header, so it causes problems. For example, I send a packet
with ethernet header 14 bytes + IP header 20 bytes + data 20 bytes = 54 bytes.
Case 1: Software checksum + pad zeroes to 60 bytes
Receiver gets this packet and finds the total length in IP header would be 40
bytes. Therefore, the receiver knows the data would be 40 - 20 (IP header) = 20
bytes.
Case 2: pad zeroes to 60 bytes + hw checksum
Receiver gets this packet and would find the total length in IP header is 40
+ (60-54) = 46 bytes, not 40 bytes. Therefore, the receiver consider the data
would be 46 - 20 = 26 bytes. However, the final 6 bytes should not be the parts
of data.
Best Regards,
Hayes
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists