From: Pierre Ossman <drzeus@drzeus.cx>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: Re: net: alignment problem in icmp code
Date: Mon, 22 Oct 2007 10:42:08 +0200 [thread overview]
Message-ID: <20071022104208.78c79467@poseidon.drzeus.cx> (raw)
In-Reply-To: <20071022.013105.74746322.davem@davemloft.net>
[-- Attachment #1: Type: text/plain, Size: 1205 bytes --]
On Mon, 22 Oct 2007 01:31:05 -0700 (PDT)
David Miller <davem@davemloft.net> wrote:
>
> On fast paths we aren't going to add things like get_unaligned()
> calls.
>
> Every architecture should handle unaligned accesses properly, and for
> the fast paths the network driver should provide the packet fully
> aligned or take steps to make it so if it can't DMA directly into
> 2-byte offset buffers (such as copying the packet).
>
This seems like a rather evil layering violation. The hardware driver needs to be aware of every layer between itself and the IP stack for this to work. And what does "aligned" mean in this context? 32-bit aligned? 64-bit aligned? The entire thing is severely underdocumented (which is why I got hit by the problem in the first place).
Also, since I developed the code on a forgiving platform (x86), I didn't notice this requirement. Perhaps a WARN_ON(NET_IP_ALIGN && (skb->data & 0x3));?
> What is the specific reason why you see packet headers unaligned?
> It's probably just some AVR networking driver that needs tweaks.
It's my own driver (if_sdio for libertas), which did not reserve two bytes as that voodoo was unknown to me.
Rgds
Pierre
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2007-10-22 8:42 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-20 21:35 net: alignment problem in icmp code Pierre Ossman
2007-10-21 5:12 ` David Miller
2007-10-21 9:34 ` Pierre Ossman
2007-10-21 19:48 ` David Miller
2007-10-21 21:21 ` Pierre Ossman
2007-10-21 23:02 ` David Miller
2007-10-22 4:54 ` Pierre Ossman
2007-10-22 5:15 ` David Miller
2007-10-22 7:23 ` Pierre Ossman
2007-10-22 8:31 ` David Miller
2007-10-22 8:42 ` Pierre Ossman [this message]
2007-10-22 9:05 ` David Miller
2007-10-22 9:26 ` Pierre Ossman
2007-10-22 9:52 ` Eric Dumazet
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=20071022104208.78c79467@poseidon.drzeus.cx \
--to=drzeus@drzeus.cx \
--cc=davem@davemloft.net \
--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).