From: Wei Yongjun <yjwei@nanjing-fnst.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] Bug in pskb_trim_rcsum()
Date: Mon, 17 Jul 2006 22:26:06 -0400 [thread overview]
Message-ID: <1153189567.3226.3.camel@LINE> (raw)
On Monday 17 July 2006 08:17, Herbert Xu wrote:
> Wei Yongjun <yjwei@nanjing-fnst.com> wrote:
> > So if I want to trim a skb, I think I must do a checksum even if
the
> > skb->ip_summed is CHECKSUM_UNNECESSARY.
>
> Nope. CHECKSUM_UNNECESSARY means that the hardware has already
> verified the checksum to be correct for the given protocol.
> Trimming a packet does not affect it.
Yes, you are right. hardware has already verified the checksum to be
correct.
But I think hardware do this:
1) calculate a checksum for the given protocol.(as the same as the
hardware which does not support verified the checksum)
2) verified the checksum.(compare protocol checksum of packet with
calculated checksum)
If that is true, Trimming a packet also affect CHECKSUM_UNNECESSARY.
And in my test, UDP under IPv4 maybe do that.
My UDP packet is:
packet1:
___________________________________
| Source Port | Dest Port |
|_________________|_________________|
| Length = 16 | Checksum(*1) |
|_________________|_________________|
| payload24 |
|___________________________________|
correct is :
___________________________________
| Source Port | Dest Port |
|_________________|_________________|
| Length = 32 | Checksum |
|_________________|_________________|
| payload24 |
|___________________________________|
Checksum(*1) is the checksum of payload24, not only the first 8 byte
of payload24.
When I send packet1 to echo-udp(target used e1000 inferface), echo-
reply can be reply. When I send packet1 to echo-udp(target used e100
inferface), echo-reply can not be reply.
In e1000, when packet1 with checksum(*1) , skb->ip_summed is set to
CHECKSUM_UNNECESSARY. And when other, skb->ip_summed is set to
CHECKSUM_HW. So I think my guess is correct. Patch is necessary.
Regards
next reply other threads:[~2006-07-18 1:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-18 2:26 Wei Yongjun [this message]
-- strict thread matches above, loose matches on Subject: below --
2006-07-17 3:53 [PATCH] Bug in pskb_trim_rcsum() Wei Yongjun
2006-07-17 12:17 ` Herbert Xu
[not found] ` <006201c6aa06$d51581c0$6004a8c0@WeiYongjun>
2006-07-18 11:32 ` Herbert Xu
2006-07-18 12:54 ` Alexey Kuznetsov
2006-07-18 13:04 ` Herbert Xu
2006-07-25 6:36 ` David Miller
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=1153189567.3226.3.camel@LINE \
--to=yjwei@nanjing-fnst.com \
--cc=herbert@gondor.apana.org.au \
--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).