netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anton Blanchard <anton@samba.org>
To: Scott Feldman <sfeldma@pobox.com>
Cc: "David S. Miller" <davem@redhat.com>, netdev@oss.sgi.com
Subject: Re: Allow IP header alignment to be overriden
Date: Sat, 12 Jun 2004 00:23:37 +1000	[thread overview]
Message-ID: <20040611142336.GE27672@krispykreme> (raw)
In-Reply-To: <1086939562.3657.10.camel@sfeldma-mobl2.dsl-verizon.net>

 
Hi,

> Would replacing "2" with a macro that's defined on a per-arch basis
> work?

Nice idea. This would avoid us adding useless padding in that case, as
we currently do:

reserve_len = 2;
skb = dev_alloc_skb(adapter->rx_buffer_len + reserve_len);
skb_reserve(skb, reserve_len);

which would be nice if we are using a power of 2 buffer size. Would
creating:

/* 
 * Network drivers want to align IP headers. Since we have 14 bytes of
 * ethernet header, adding 2 bytes will align the IP header.  However
 * this will mean we do unaligned DMA so there is a trade off.
 *
 * We allow this to be overridden per arch as the unaligned DMA cost may
 * outweigh the unaligned CPU cost.
 */
#ifndef NET_IP_ALIGN
#define NET_IP_ALIGN 2
#endif

Instead of skb_align make more sense? It does have the advantage of
removing another magic number.

Anton

  reply	other threads:[~2004-06-11 14:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-11  1:27 Allow IP header alignment to be overriden Anton Blanchard
2004-06-11  1:35 ` Andi Kleen
2004-06-11  1:43   ` Anton Blanchard
2004-06-11  5:35 ` David S. Miller
2004-06-11  7:39   ` Scott Feldman
2004-06-11 14:23     ` Anton Blanchard [this message]
2004-06-12 18:12       ` David S. Miller
2004-06-15 23:34         ` Anton Blanchard
2004-06-16  4:37           ` David S. Miller
2004-06-11 12:41   ` jamal
2004-06-11 14:08   ` Anton Blanchard

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=20040611142336.GE27672@krispykreme \
    --to=anton@samba.org \
    --cc=davem@redhat.com \
    --cc=netdev@oss.sgi.com \
    --cc=sfeldma@pobox.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).