From: Shaddy Baddah <shaddy_baddah@hotmail.com>
To: Michael Buesch <mb@bu3sch.de>
Cc: linux-wireless@vger.kernel.org
Subject: Re: zd1211rw (2.6.26 sparc64): unaligned access (zd_mac_rx)
Date: Sat, 29 Nov 2008 19:59:00 +1100 [thread overview]
Message-ID: <BAY104-DAV45277DC429AEBF024857A99070@phx.gbl> (raw) (sfid-20081129_095917_158558_C9DF327F)
Message-ID: <49310454.60906@hotmail.com> (raw)
In-Reply-To: <200811282344.29293.mb@bu3sch.de>
On 29/11/08 09:44, Michael Buesch wrote:
> On Friday 28 November 2008 06:34:34 Shaddy Baddah wrote:
>> case the same simple function replacement would not be OK. But I saw
>> several places where memcmp() is preferred to compare_ether_addr(),
>> which I assume indicates that mac80211 does not expect alignment of
>> 80211 packets passed to it.
>
> The whole networking stack expects 4byte alignment and the driver _must_
> make sure it is this way. Either by padding a constant number of bytes at the front
> of each allocated SKB, or (if the alignment differs) use dynamic checks
> for the lowest few bits of the pointer passed to mac80211.
Right. But I'm not sure that in this case that the packet is being
passed to mac80211 by the driver. My recall of the stack traces I saw
were that the unalignment I was seeing in sta_info_get() were a
consequence of transmission attempts.
I must admit though, I could not source where the unaligned packet came
from, as I do not fully understand the different queuing mechanisms in
use and where and how enqueues occur. My limited efforts to understand
this gave me the impression that network stack itself, and not the
driver, was constructing these unaligned packets, for transmission.
The memcmp() that really persuaded me to believe that the mac80211 had
no alignment requirements was this one:
net/mac80211/tx.c:1304: if (memcmp(odev->dev_addr, hdr->addr4,
ETH_ALEN) != 0)
I would have thought it would use compare_ether_addr() if we could
safely assume alignment. In any case, say that alignment was always the
intention... then can't we just use memcmp() as a hack (not being
derogatory. Just that it would turn into a hack in deference to using
compare_ether_addr()) consistent with hacks like the above? Even in the
interim until a program to iron out alignment is set in place?
Regards,
Shaddy
next prev parent reply other threads:[~2008-11-29 8:59 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-25 8:54 zd1211rw (2.6.26 sparc64): unaligned access (zd_mac_rx) Shaddy Baddah
2008-10-25 9:17 ` Johannes Berg
2008-10-25 11:25 ` Sebastian Andrzej Siewior
2008-10-25 12:05 ` Johannes Berg
2008-10-26 22:00 ` Sebastian Andrzej Siewior
2008-10-27 7:00 ` Johannes Berg
2008-10-25 11:21 ` Sebastian Andrzej Siewior
2008-10-25 11:25 ` Michael Buesch
2008-10-25 11:28 ` Sebastian Andrzej Siewior
2008-10-25 11:31 ` Michael Buesch
2008-10-25 11:38 ` Sebastian Andrzej Siewior
2008-10-25 15:13 ` Shaddy Baddah
[not found] ` <491589ED.4090904@hotmail.com>
2008-11-08 12:45 ` Shaddy Baddah
2008-11-08 13:11 ` Johannes Berg
[not found] ` <491653A6.20705@hotmail.com>
2008-11-09 3:06 ` Shaddy Baddah
[not found] ` <49165436.4040306@hotmail.com>
2008-11-09 3:08 ` Shaddy Baddah
2008-11-09 12:00 ` Michael Buesch
2008-11-09 8:56 ` Johannes Berg
2008-11-09 9:03 ` Johannes Berg
2008-11-09 12:02 ` Michael Buesch
2008-11-09 18:31 ` Johannes Berg
[not found] ` <4916F1C0.1040703@hotmail.com>
2008-11-09 14:20 ` Shaddy Baddah
[not found] ` <49184F82.9070102@hotmail.com>
2008-11-10 15:13 ` Shaddy Baddah
[not found] ` <492F82EA.4030902@hotmail.com>
2008-11-28 5:34 ` Shaddy Baddah
2008-11-28 7:10 ` David Miller
2008-11-28 22:44 ` Michael Buesch
[not found] ` <49310454.60906@hotmail.com>
2008-11-29 8:59 ` Shaddy Baddah [this message]
2008-11-29 9:50 ` Johannes Berg
[not found] ` <49313C0E.9030309@hotmail.com>
2008-11-29 12:56 ` Shaddy Baddah
[not found] ` <492F856D.9020200@hotmail.com>
2008-11-28 5:45 ` Shaddy Baddah
2008-11-28 6:47 ` Harvey Harrison
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=BAY104-DAV45277DC429AEBF024857A99070@phx.gbl \
--to=shaddy_baddah@hotmail.com \
--cc=linux-wireless@vger.kernel.org \
--cc=mb@bu3sch.de \
/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).