Search Linux Wireless

Re: [PATCH 21/23] rt2x00: Optimize register access in rt2800usb

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

 



W dniu 18 kwietnia 2011 16:06 uÅytkownik Ivo Van Doorn
<ivdoorn@xxxxxxxxx> napisaÅ:
> Hi,
>
>>> All register reads/writes in rt2800usb were previously done with
>>> rt2800_register_read/rt2800_register_write. These however indirectly
>>> call rt2x00usb_register_read/rt2x00usb_register_write which adds an
>>> additional overhead of at least one call and several move instructions
>>> to each register access.
>>>
>>> Replacing the calls to rt2800_register_read/rt2800_register_write with
>>> direct calls to rt2x00usb_register_read/rt2x00usb_register_write gets
>>> rid of quite a number of instructions in the drivers hotpaths (IRQ
>>> handling and txdone handling).
>>>
>>> For consistency replace all references to rt2800_register_read/write
>>> with the rt2x00usb_register_read/write variants.
>>
>> This way you loose abstraction of writes/reads for usb vs. pci. And
>> you still can not optimize rt2800lib code which is shared between usb
>> and pci.
>
> Well the rt2800lib code is not changed by this (or patch 20 of this series).
>
>> Wouldn't this be better to create two pointers in struct rt2x00_dev.
>> One for writing function and one for reading function? Am I right
>> thinking calling functions by pointers is quite fast? Or is this still
>> noticeably slower than using proper functions directly?
>
> We already have the pointer inside struct rt2x00_dev which references
> the register access functions for rt2800pci/usb. These pointers are used
> by rt2800lib to access the common registers. What this patch does, is
> optimize the case where we exactly know which function we need, because
> we are in the actual driver.

Ah, OK, I can see rt2800_register_read/write indeed are using pointers:
rt2800ops->register_read(rt2x00dev, offset, value);
So I believe it was still not fast enough for you.

It's OK then. I just though you were using
if (dev->usb)
rt2x00usb_register_read
else
...


> As for the performance, I'll let Helmut comment on that as he created patch 20,
> which introduced this change to rt2800pci. :)

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