From: Ivo van Doorn <ivdoorn@gmail.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: chris2553@googlemail.com, linux-wireless@vger.kernel.org
Subject: Re: Warning emited by 2.6.24-rc6-git5
Date: Wed, 2 Jan 2008 20:12:52 +0100 [thread overview]
Message-ID: <200801022012.52287.IvDoorn@gmail.com> (raw)
In-Reply-To: <1199261473.4172.58.camel@johannes.berg>
Hi,
> Happy New Year!
You too. :)
> I was out since Saturday just before you sent your
> message, sorry for the late reply.
>
> > header_size = ieee80211_get_hdrlen_from_skb(entry->skb);
> > if (header_size % 4 == 2) {
> > /*
> > * Move entire frame 2 bytes to the front.
> > */
> > skb_push(entry->skb, 2);
> > memmove(entry->skb->data, entry->skb->data + 2,
> > entry->skb->len - 2);
> > }
>
> That doesn't really look right, I'd think the skb will be two bytes too
> long after this.
Yeah, fixed this in rt2x00.git :)
> It's probably more efficient to decide where to copy
> the frame and do the realignment while you're copying it anyway rather
> than doing a copy and then a memmove.
>
> I guess you should also try talk to Ralink to get firmware to do it
> (where possible), it's probably not too hard to insert padding before
> the frame.
Well the problem is a bit bigger than this, the bug is reported very rarely,
so I can't say for sure which drivers are affected by this. But since most
Ralink chipsets look alike, I think the safest assumption is that all are
affected.
rt2400pci, rt2500pci and rt2500usb don't have firmware, for rt61pci and
rt73usb there is, but looking at how the TX and RX registers are working
I *assume* the firmware isn't doing much in this area. (My personal
guess for the firmware is that it only handles the hardware encryption
and perhaps beaconing & virtual interfaces)
Additionally firmware for rt61 and rt73 have been discontinued,
all their work is currently going to rt2860 and rt2870. (Porting these to
rt2x00 has already begun, but I haven't arrived at the header alignment yet)
For PCI drivers I could indeed optimize the code by making the memcpy
perform the operation on the 4 byte aligned code. But for this I need
to check what is better, RX directly into a skbuff and use memmove
or RX into DMA and use memcpy to a skbuff.
But for USB this is not possible, since it directly performs the RX into
the skbuff already, so I either have to change that or perform memmove anyway.
> If you absolutely can't get the hardware to do it and would otherwise do
> DMA right into the skb we should try to evaluate the performance hit on
> platforms where unaligned access *is* possible to be able to balance it
> against the performance hit caused by the memmove(). Ultimately, though,
> I value correctness on all platforms over performance on some, hence the
> warning when unaligned packets are handed up to mac80211.
Overall correctness sounds as the best solution to me too.
Ivo
next prev parent reply other threads:[~2008-01-02 19:13 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-29 9:42 Warning emited by 2.6.24-rc6-git5 Chris Clayton
2007-12-29 9:54 ` Johannes Berg
2007-12-29 10:21 ` Ivo van Doorn
2007-12-29 10:26 ` Johannes Berg
2007-12-29 10:36 ` Johannes Berg
2007-12-29 11:47 ` Ivo van Doorn
2007-12-29 11:59 ` Johannes Berg
2007-12-29 12:01 ` Johannes Berg
2007-12-29 14:29 ` Ivo van Doorn
2007-12-29 14:40 ` Johannes Berg
2007-12-29 15:14 ` Ivo van Doorn
2007-12-30 11:49 ` Chris Clayton
2007-12-30 12:11 ` Ivo van Doorn
2007-12-30 19:26 ` Chris Clayton
2007-12-30 22:01 ` Ivo van Doorn
2007-12-31 7:27 ` Kalle Valo
2007-12-31 7:56 ` Ivo Van Doorn
2008-01-02 6:32 ` Chris Clayton
2008-01-02 19:02 ` Ivo van Doorn
2008-01-04 17:09 ` Chris Clayton
2008-01-06 7:49 ` Andrew Price
2008-01-08 6:03 ` Chris Clayton
2008-01-02 8:11 ` Johannes Berg
2008-01-02 19:12 ` Ivo van Doorn [this message]
2008-01-08 15:44 ` Tomas Winkler
2008-01-08 17:09 ` Johannes Berg
2008-01-08 17:22 ` Johannes Berg
2008-01-08 19:43 ` Tomas Winkler
2008-01-08 20:02 ` Michael Buesch
2008-01-08 23:18 ` Tomas Winkler
2008-01-09 12:49 ` Johannes Berg
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=200801022012.52287.IvDoorn@gmail.com \
--to=ivdoorn@gmail.com \
--cc=chris2553@googlemail.com \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
/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).