[rt2x00-users] [PATCH 6/8] rt2x00: no realign

Andreas Hartmann andihartmann at 01019freenet.de
Thu Nov 29 14:14:25 AEDT 2012


Hello Helmut,

Helmut Schaa wrote:
> Hi Daniel,
> 
> On Wed, Nov 28, 2012 at 7:05 PM, Daniel Golle <dgolle at allnet.de> wrote:
>>
>> diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c
>> index e488b94..f75bdda 100644
>> --- a/drivers/net/wireless/rt2x00/rt2x00queue.c
>> +++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
>> @@ -151,36 +151,14 @@ void rt2x00queue_align_frame(struct sk_buff *skb)
>>  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);
>>  }
>>
> 
> That one came originally from me [1]. I've been running it for over a
> year now (on rt2800pci) without issues. I'm just unsure how the other
> ralink devices (rt61pci) react to this change but I'd be fine with
> including it ...

Since I read about it these days, I applied it too, but again for
rt2800pci / AP. It's working fine for me, too (but couldn't see any
difference in CPU usage)!

> 
> Helmut
> 
> [1] https://github.com/mirrors/openwrt/blob/master/package/mac80211/patches/606-rt2x00_no_realign.patch


Kind regards,
Andreas




More information about the users mailing list