Search Linux Wireless

Re: Linux 2.6.24-rc7

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
Date: Fri, 25 Jan 2008 11:07:47 -0800 (PST)

> 
> 
> 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?

No.

> 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).

PowerPC handles unaligned accesses transparently, so it is safe
for them to make this setting.

It would not work out on sparc64 for example.

What happens in practice is that the drivers provide something
reasonably aligned for IPV4 headers.  That's why we don't mark the
IPV4 header structure as packed and that's why we don't have to use
get_unaligned() to dereference the 32-bit addresses in there.

So you'll see drivers for chips that have to 64-byte align the
ethernet header in the RX packet for whatever reason, simply
copy into a fresh buffer on receive.

Some drivers do this only platforms where unalign accesses trap or
simply do not work.
-
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux