linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shaddy Baddah <shaddy_baddah@hotmail.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless@vger.kernel.org, Michael Buesch <mb@bu3sch.de>
Subject: Re: zd1211rw (2.6.26 sparc64): unaligned access (zd_mac_rx)
Date: Sat, 29 Nov 2008 23:56:46 +1100	[thread overview]
Message-ID: <BAY104-DAV4CB3E353C627AA7068CC899070@phx.gbl> (raw) (sfid-20081129_135700_397877_4AC4B26D)
Message-ID: <49313C0E.9030309@hotmail.com> (raw)
In-Reply-To: <1227952204.3542.3.camel@johannes.berg>

Hi,

On 29/11/08 20:50, Johannes Berg wrote:
> On Sat, 2008-11-29 at 19:59 +1100, Shaddy Baddah wrote:
> 
>> 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.
> 
> You're looking at the TX path, that's irrelevant :)

Do you mean by that the code that handles TX does not expect alignment?

I suspect I still missing some important point. But here it goes. 
Although the sta_info_get() function seems to be a more general purpose, 
the unaligned access is happening on TX. I found the stack trace:

Nov 22 19:04:43 trad kernel: [ 1459.328317]  [000000001039574c] 
__ieee80211_tx_prepare+0x288/0x3e8 [mac80211]
Nov 22 19:04:43 trad kernel: [ 1459.420571]  [0000000010398174] 
ieee80211_master_start_xmit+0x378/0x4f4 [mac80211]
Nov 22 19:04:43 trad kernel: [ 1459.518716]  [000000000061de88] 
dev_hard_start_xmit+0x210/0x2a0
Nov 22 19:04:43 trad kernel: [ 1459.596342]  [000000000062ff38] 
__qdisc_run+0xe4/0x220
Nov 22 19:04:43 trad kernel: [ 1459.664429]  [0000000000620c94] 
dev_queue_xmit+0x3dc/0x5d0
Nov 22 19:04:43 trad kernel: [ 1459.737359]  [000000001038ba10] 
ieee80211_associated+0x10c/0x154 [mac80211]
Nov 22 19:04:43 trad kernel: [ 1459.827398]  [000000001038dda0] 
ieee80211_sta_work+0xd50/0xe48 [mac80211]
Nov 22 19:04:43 trad kernel: [ 1459.915701]  [000000000045e584] 
run_workqueue+0x98/0x130
Nov 22 19:04:43 trad kernel: [ 1459.985658]  [000000000045ea30] 
worker_thread+0xa4/0xbc
Nov 22 19:04:43 trad kernel: [ 1460.054609]  [0000000000461d5c] 
kthread+0x3c/0x70
Nov 22 19:04:43 trad kernel: [ 1460.117894]  [0000000000426f84] 
kernel_thread+0x30/0x48
Nov 22 19:04:43 trad kernel: [ 1460.186919]  [0000000000461c18] 
kthreadd+0xb0/0x124

> No, the IP stack assumes alignment. Besides, zd1211 actually enforces
> the alignment before passing the skb off to mac80211.

You mean on RX, right? I'm OK on RX I think. The memcmp() is fine in 
filter_ack(), because it is on the raw packet that comes in from over 
USB which will always be unaligned (because of PLCP header, from the 
device itself). And it is before we actually memcpy() aligned into the 
skb buffer to pass to mac80211.

Perhaps I'm second guessing a little too much here, so I'll ask a simple 
question. Why do I get a 80211 packet passed into 
__ieee80211_tx_prepare() which is at an odd address in the skb buffer? I 
would have expected that they would have always been constructed aligned?

Thanks in advance,
Shaddy


  reply	other threads:[~2008-11-29 12:56 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
2008-11-29  9:50                               ` Johannes Berg
     [not found]                                 ` <49313C0E.9030309@hotmail.com>
2008-11-29 12:56                                   ` Shaddy Baddah [this message]
     [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-DAV4CB3E353C627AA7068CC899070@phx.gbl \
    --to=shaddy_baddah@hotmail.com \
    --cc=johannes@sipsolutions.net \
    --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).