netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andi Kleen <ak@suse.de>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: netdev@oss.sgi.com
Subject: Re: reasons for dev_alloc_skb +16?
Date: Wed, 9 Jul 2003 18:13:24 +0200	[thread overview]
Message-ID: <20030709181324.16ed0c1d.ak@suse.de> (raw)
In-Reply-To: <20030709160657.GD15293@gtf.org>

On Wed, 9 Jul 2003 12:06:57 -0400
Jeff Garzik <jgarzik@pobox.com> wrote:

> On Wed, Jul 09, 2003 at 05:53:55PM +0200, Andi Kleen wrote:
> > On Wed, 9 Jul 2003 11:25:53 -0400
> > Jeff Garzik <jgarzik@pobox.com> wrote:
> > 
> > > I knew this at one time, but have forgotten it :)
> > > 
> > > What is the reason for adding 16 to the dev_alloc_skb length?
> > > (and skb_reserve of the same length)
> > 
> > For the skb_reserve alignment to align the IP header. 
> > 
> > But it's not clear it is still a good idea because it leads to cache line 
> > misalignment of the beginning of the packet, forcing the card to do a
> > costly Read-Modify-Write cycle.
> 
> Exactly.  Ben H is running into this, and pondering direct use of
> alloc_skb for precisely this reason.

Problem with changing it is that the payload ends up misaligned.
And user space usually aligns the buffer passed to recvmsg. This
means csum_copy_to_user has to csum-copy unaligned->aligned, which will
be likely very slow. 

Related problem is that the TCP/IP headers are unaligned, but if your CPU
has fast enough misalignment handling it shouldn't be too bad.

-Andi

  reply	other threads:[~2003-07-09 16:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-09 15:25 reasons for dev_alloc_skb +16? Jeff Garzik
2003-07-09 15:53 ` Andi Kleen
2003-07-09 16:06   ` Jeff Garzik
2003-07-09 16:13     ` Andi Kleen [this message]
2003-07-10  0:20   ` David S. Miller
  -- strict thread matches above, loose matches on Subject: below --
2003-07-09 15:35 Hen, Shmulik

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=20030709181324.16ed0c1d.ak@suse.de \
    --to=ak@suse.de \
    --cc=jgarzik@pobox.com \
    --cc=netdev@oss.sgi.com \
    /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).