From: David Miller <davem@davemloft.net>
To: herbert@gondor.apana.org.au
Cc: guichaz@yahoo.fr, netdev@vger.kernel.org
Subject: Re: [NET]: Avoid copying TCP packets unnecessarily
Date: Mon, 15 Oct 2007 01:47:28 -0700 (PDT) [thread overview]
Message-ID: <20071015.014728.78750651.davem@davemloft.net> (raw)
In-Reply-To: <20071015055457.GA28799@gondor.apana.org.au>
From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Mon, 15 Oct 2007 13:54:57 +0800
> On Mon, Oct 15, 2007 at 12:57:23PM +0800, Herbert Xu wrote:
> >
> > However, the fact that you're triggering this code at all tells
> > us that there is another bug further up the chain that's causing
> > us to generate partial checksums even though the NIC doesn't
> > support it. Can you please give me the output of
>
> Nevermind, tcp_fragment can generate such packets out of
> convenience.
>
> Here's a little optimisation to avoid copying the packet in
> this case.
>
> [NET]: Avoid copying TCP packets unnecessarily
>
> TCP packets all have writable heads, that is, even though it's cloned, it is
> writable up to the end of the TCP header. This patch makes skb_checksum_help
> aware of this fact by using skb_clone_writable and avoiding a copy for TCP.
>
> I've also modified the BUG_ON tests to be unsigned. The only case where this
> makes a difference is if csum_start points to a location before skb->data.
> Since skb->data should always include the header where the checksum field
> is (and all currently callers adhere to that), this change is safe and may
> uncover bugs later.
>
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Applied, thanks Herbert!
next prev parent reply other threads:[~2007-10-15 8:47 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-06 12:15 kernel BUG at net/core/dev.c:1383 skb_checksum_help: BUG_ON(offset > (int)skb->len) Guillaume Chazarain
2007-10-14 17:26 ` Guillaume Chazarain
2007-10-14 20:20 ` Guillaume Chazarain
2007-10-15 4:57 ` [NET]: Fix csum_start update in pskb_expand_head Herbert Xu
2007-10-15 5:54 ` [NET]: Avoid copying TCP packets unnecessarily Herbert Xu
2007-10-15 8:47 ` David Miller [this message]
2007-10-15 8:46 ` [NET]: Fix csum_start update in pskb_expand_head David Miller
2007-10-15 9:21 ` Guillaume Chazarain
2007-10-15 10:08 ` kernel BUG at net/core/dev.c:1383 skb_checksum_help: BUG_ON(offset > (int)skb->len) Ilpo Järvinen
2007-10-15 10:15 ` Ilpo Järvinen
2007-10-15 10:18 ` Guillaume Chazarain
2007-10-15 10:54 ` Ilpo Järvinen
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=20071015.014728.78750651.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=guichaz@yahoo.fr \
--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).