Search Linux Wireless

Re: zd1211rw (2.6.26 sparc64): unaligned access (zd_mac_rx)

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

 



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

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