linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Kalle Valo <kalle.valo@iki.fi>
Cc: linux-wireless@vger.kernel.org, linville@tuxdriver.com
Subject: Re: [PATCH 06/12] wl1251: fix payload alignment
Date: Fri, 27 Nov 2009 12:11:59 +0100	[thread overview]
Message-ID: <1259320319.5428.17.camel@johannes.local> (raw)
In-Reply-To: <873a409qdg.fsf@purkki.valot.fi>

[-- Attachment #1: Type: text/plain, Size: 1884 bytes --]

On Fri, 2009-11-27 at 13:08 +0200, Kalle Valo wrote:
> Johannes Berg <johannes@sipsolutions.net> writes:
> 
> > On Thu, 2009-11-26 at 17:13 +0200, Kalle Valo wrote:
> >> Kalle Valo <kalle.valo@iki.fi> writes:
> >> 
> >> > mac80211 complained that in some cases IP payload was not aligned, this
> >> > happens if the 802.11 header is not aligned with four. In that case we have
> >> > to move entire packet to make the payload properly aligned.
> >
> > Eh, turn off the debugging option ...
> 
> Sure. But isn't this warning going to create false alarms for others?

That's why it says "Say N unless you're writing a mac80211 based
driver." Maybe it should say "Say N unless you want to debug potential
alignment issues with your driver." Or maybe it should just go away now
that we align things properly in mac80211, and most firmware either
handles it or not, and there's nothing we can do about the firmware most
of the time... And mesh makes it more complex anyway than the warning
checks.

> > The point of the warning is to make developers aware that alignment by
> > firmware will be better. If you can't put the packet into the right
> > place directly from the device, don't bother, the memmove is done by
> > mac80211.
> 
> Ok, I have totally misunderstood the warning then. What's the proper
> way to fix this? I'll try to improve the comments in mac80211 to make
> this more clear.
> 
> At least in wl1251 we have to transfer the frame to an address aligned
> with four, otherwise DMA won't work. So the only solution I can think
> of is that firmware adds two bytes of padding before the frame in case
> of unaligned payload. Is there any other way?

No, there's no other way :) In fact, the padding has to be dynamic --
depending on whether you have QoS and/or 4addr format -- you need
padding if (!(qos ^ 4addr)) IIRC.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

  reply	other threads:[~2009-11-27 11:11 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-26 15:08 [PATCH 00/12] wl1251 WMM support and minor fixes Kalle Valo
2009-11-26 15:08 ` [PATCH 01/12] wl1251: add tx queue status to debugfs Kalle Valo
2009-11-26 15:08 ` [PATCH 02/12] wl1251: print a debug message when tx_queue is full Kalle Valo
2009-11-26 15:08 ` [PATCH 03/12] wl1251: fix error handling in wl1251_op_config() Kalle Valo
2009-11-26 15:08 ` [PATCH 04/12] wl1251: reduce ELP wakeup timeout Kalle Valo
2009-11-26 15:08 ` [PATCH 05/12] wl1251: simplify ELP wakeup time calculation Kalle Valo
2009-11-26 15:09 ` [PATCH 06/12] wl1251: fix payload alignment Kalle Valo
2009-11-26 15:13   ` Kalle Valo
2009-11-26 18:13     ` Johannes Berg
2009-11-27 11:08       ` Kalle Valo
2009-11-27 11:11         ` Johannes Berg [this message]
2009-11-27 11:32           ` Kalle Valo
2009-11-26 15:09 ` [PATCH 07/12] wl1251: use __dev_alloc_skb() on RX Kalle Valo
2009-11-26 15:09 ` [PATCH 08/12] wl1251: implement acx_ac_cfg to configure hardware queues Kalle Valo
2009-11-26 15:09 ` [PATCH 09/12] wl1251: implement wl1251_acx_tid_cfg() Kalle Valo
2009-11-26 15:09 ` [PATCH 10/12] wl1251: implement WMM Kalle Valo
2009-11-26 15:09 ` [PATCH 11/12] wl1251: update tx_hdr when aliging skb in tx Kalle Valo
2009-11-26 15:09 ` [PATCH 12/12] wl1251: enable WMM Kalle Valo
2009-11-27 13:30 ` [PATCH 00/12] wl1251 WMM support and minor fixes Kalle Valo

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=1259320319.5428.17.camel@johannes.local \
    --to=johannes@sipsolutions.net \
    --cc=kalle.valo@iki.fi \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /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).