diff options
author | John Crispin <blogic@openwrt.org> | 2013-06-21 16:54:37 +0000 |
---|---|---|
committer | John Crispin <blogic@openwrt.org> | 2013-06-21 16:54:37 +0000 |
commit | f1b4824c865b228039d84b2605b2e7e4f34cddeb (patch) | |
tree | 37c9cbe251e4fb790aaa72e862c35822be30b491 /package/kernel/mac80211/patches/606-rt2x00_no_realign.patch | |
parent | d2642de7494bba312bbb22cfeb3ad77130a10047 (diff) | |
download | master-187ad058-f1b4824c865b228039d84b2605b2e7e4f34cddeb.tar.gz master-187ad058-f1b4824c865b228039d84b2605b2e7e4f34cddeb.tar.bz2 master-187ad058-f1b4824c865b228039d84b2605b2e7e4f34cddeb.zip |
packages: clean up the package folder
Signed-off-by: John Crispin <blogic@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@37007 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/kernel/mac80211/patches/606-rt2x00_no_realign.patch')
-rw-r--r-- | package/kernel/mac80211/patches/606-rt2x00_no_realign.patch | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/package/kernel/mac80211/patches/606-rt2x00_no_realign.patch b/package/kernel/mac80211/patches/606-rt2x00_no_realign.patch new file mode 100644 index 0000000000..9608df2e20 --- /dev/null +++ b/package/kernel/mac80211/patches/606-rt2x00_no_realign.patch @@ -0,0 +1,67 @@ +[RFC] rt2x00: For drivers that only need L2 padding don't realign frames + +Signed-off-by: Helmut Schaa <helmut.schaa@...> +--- + +Ivo, Gertjan, do you remeber by any chance why this alignment stuff was added +in the first place? Was it because of DMA restrictions? + +While doing some profiling on the rt3052 SoC I noticed that 30-40% time was +spent in memmove calls. And the culprit is the memmove aligning the payload +to a 4byte boundary since that has to move a whole bunch of data. + +Interesstingly the legacy drivers insert an l2pad between the header and the +payload but doesn't realign the payload itself to a 4-byte boundary. Hence, +I came up with this patch and indeed CPU usage improves impressively. + +Only tested on rt2800pci! + +Thanks, +Helmut + + drivers/net/wireless/rt2x00/rt2x00queue.c | 30 +++------------------------- + 1 files changed, 4 insertions(+), 26 deletions(-) + +--- a/drivers/net/wireless/rt2x00/rt2x00queue.c ++++ b/drivers/net/wireless/rt2x00/rt2x00queue.c +@@ -163,36 +163,14 @@ void rt2x00queue_align_frame(struct sk_b + void rt2x00queue_insert_l2pad(struct sk_buff *skb, unsigned int header_length) + { + unsigned int payload_length = skb->len - header_length; +- unsigned int header_align = ALIGN_SIZE(skb, 0); +- unsigned int payload_align = ALIGN_SIZE(skb, header_length); + unsigned int l2pad = payload_length ? L2PAD_SIZE(header_length) : 0; + +- /* +- * Adjust the header alignment if the payload needs to be moved more +- * than the header. +- */ +- if (payload_align > header_align) +- header_align += 4; +- +- /* There is nothing to do if no alignment is needed */ +- if (!header_align) ++ if (!l2pad) + return; + +- /* Reserve the amount of space needed in front of the frame */ +- skb_push(skb, header_align); +- +- /* +- * Move the header. +- */ +- memmove(skb->data, skb->data + header_align, header_length); +- +- /* Move the payload, if present and if required */ +- if (payload_length && payload_align) +- memmove(skb->data + header_length + l2pad, +- skb->data + header_length + l2pad + payload_align, +- payload_length); +- +- /* Trim the skb to the correct size */ ++ /* insert l2pad -> Move header */ ++ skb_push(skb, l2pad); ++ memmove(skb->data, skb->data + l2pad, header_length); + skb_trim(skb, header_length + l2pad + payload_length); + } + |