linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "John W. Linville" <linville@tuxdriver.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Michael Buesch <mb@bu3sch.de>, Dan Williams <dcbw@redhat.com>,
	Johannes Berg <johannes@sipsolutions.net>,
	linux-wireless@vger.kernel.org
Subject: Re: Linux 2.6.24-rc7
Date: Fri, 25 Jan 2008 14:48:07 -0500	[thread overview]
Message-ID: <20080125194807.GD14687@tuxdriver.com> (raw)
In-Reply-To: <alpine.LFD.1.00.0801251045430.2979@hp.linux-foundation.org>

On Fri, Jan 25, 2008 at 11:07:47AM -0800, Linus Torvalds wrote:
> 
> 
> On Fri, 25 Jan 2008, Michael Buesch wrote:
> > 
> > The problem is _not_ the wireless header access, but the alignment of the embedded
> > protocol stack, if the header does not have a size aligned to 4.
> > Do we want to clutter the whole networking stack below wireless with
> > get_unaligned() or attribute(packed) or something like that?
> 
> That's what all the other protocols do, isn't it?
> 
> For example, on PowerPC, NET_IP_ALIGN is 0 - explicitly so that the *dma* 
> from the card should be aligned, even if that in turn means that the IP 
> payload itself is then just two-byte aligned rather than word-aligned 
> (14-byte ethernet headers and all that).

http://kerneltrap.org/mailarchive/linux-netdev/2007/11/24/442496

Quoth Herbert Xu:

"OK.  Let me clarify this a bit more.  We require at least one
of the following rules to be met:

* the IPv4/IPv6 header is aligned by 8 bytes on reception;
* or the platform provides unaligned exception handlers.

So if your platform violates both rules then it won't work with
the IP stack, simple as that.  Fortunately I don't think such a
platform exists currently on Linux."

That puts mac80211 in an awkward position.  It is not architecture
code, so it can't make any assumptions about what is or isn't OK.
So, we need to present aligned data to the network stack.

We could put the alignment onus on mac80211, but this has proven to be
very solvable at (near?) zero cost by all the other drivers.  I suppose
we could put code in mac80211 to check/correct the alignment anyway
and hope that the cost of such checking is small enough not to matter
as long as drivers are passing aligned data anyway.  But that seems
a bit silly, when at least so far only this one driver has balked at
doing the right thing.

I'm working on some iwlwifi patches to check/correct alignment.

(Hmmm..."aligned by 8 bytes", so our warning and my iwlwifi patch
may still not be right...)

John
-- 
John W. Linville
linville@tuxdriver.com

  parent reply	other threads:[~2008-01-25 20:03 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <alpine.LFD.1.00.0801061410290.3148@woody.linux-foundation.org>
2008-01-07 16:14 ` Linux 2.6.24-rc7 Alejandro Riveira Fernández
2008-01-07 16:24   ` Michael Buesch
2008-01-07 16:52     ` Alejandro Riveira Fernández
2008-01-07 17:30       ` Michael Buesch
2008-01-07 20:23         ` Alejandro Riveira Fernández
2008-01-08 15:30           ` Michael Buesch
2008-01-08 15:55             ` Alejandro Riveira Fernández
2008-01-24 20:27             ` Linus Torvalds
2008-01-24 21:07               ` John W. Linville
2008-01-24 21:34                 ` Linus Torvalds
2008-01-25 12:29                   ` Johannes Berg
2008-01-25 16:08                     ` Linus Torvalds
2008-01-25 16:23                       ` Michael Buesch
2008-01-25 16:43                         ` Linus Torvalds
2008-01-25 17:27                           ` Dan Williams
2008-01-25 17:38                             ` Linus Torvalds
2008-01-25 17:42                               ` Dan Williams
2008-02-05 20:55                                 ` Russell S. Senior
2008-01-25 18:22                               ` Linus Torvalds
2008-01-25 18:30                                 ` Michael Buesch
2008-01-25 19:07                                   ` Linus Torvalds
2008-01-25 19:34                                     ` Michael Buesch
2008-01-25 19:48                                     ` John W. Linville [this message]
2008-01-25 19:50                                       ` John W. Linville
2008-01-25 21:18                                         ` John W. Linville
2008-01-25 21:56                                           ` Linus Torvalds
2008-01-25 22:46                                             ` John W. Linville
2008-01-25 23:20                                               ` Guy Cohen
2008-01-26 13:53                                               ` David Miller
2008-01-26 13:47                                             ` David Miller
2008-01-25 22:02                                           ` Guy Cohen
2008-01-26 13:40                                           ` David Miller
2008-01-25 20:28                                       ` Linus Torvalds
2008-01-26 13:37                                         ` David Miller
2008-01-27  6:32                                           ` Linus Torvalds
2008-01-27  7:16                                             ` Jeff Garzik
2008-01-27  7:24                                               ` David Miller
2008-01-27  7:54                                                 ` Linus Torvalds
2008-01-28  3:15                                                   ` David Miller
2008-01-25 23:22                                     ` Jeff Garzik
2008-01-26 13:27                                     ` David Miller
2008-01-27  6:25                                       ` Linus Torvalds
2008-01-26 13:22                                 ` David Miller
2008-01-25 18:21                           ` Michael Buesch
2008-01-25 18:34                             ` Linus Torvalds
2008-01-25 18:41                               ` Michael Buesch
2008-01-25 21:11                                 ` Inaky Perez-Gonzalez
2008-01-25 21:21                                   ` Michael Buesch
2008-01-25 21:28                                     ` Inaky Perez-Gonzalez
2008-01-26 13:42                                       ` David Miller
2008-01-27  2:26                                         ` Luis R. Rodriguez
2008-01-29 19:07                                         ` Inaky Perez-Gonzalez
2008-01-25 21:46                                     ` John W. Linville
2008-01-25 22:15                                       ` Michael Buesch
2008-01-25 22:34                                       ` Tomas Winkler
2008-01-26 13:49                                       ` David Miller
2008-01-25 21:46                                     ` Guy Cohen
2008-01-25 21:54                                     ` Linus Torvalds
2008-01-26 13:46                                       ` David Miller
2008-01-25 18:34                             ` John W. Linville
2008-01-24 22:17               ` Michael Buesch
2008-01-24 22:26                 ` Linus Torvalds
2008-01-24 22:33                   ` Michael Buesch

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=20080125194807.GD14687@tuxdriver.com \
    --to=linville@tuxdriver.com \
    --cc=dcbw@redhat.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=mb@bu3sch.de \
    --cc=torvalds@linux-foundation.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).