linux/drivers/net
Markus Pargmann 4ce78a838c can: c_can: Speed up rx_poll function
This patch speeds up the rx_poll function by reducing the number of
register reads.

Replace the 32bit register read by a 16bit register read. Currently
the 32bit register read is implemented by using 2 16bit reads. This is
inefficient as we only use the lower 16bit in rx_poll.

The for loop reads the pending interrupts in every iteration. This
leads up to 16 reads of pending interrupts. The patch introduces a new
outer loop to read the pending interrupts as long as 'quota' is above 0.
This reduces the total number of reads.

The third change is to replace the for-loop by a ffs loop.

Tested on AM335x. I removed all 'static' and 'inline' from c_can.c to
see the timings for all functions. I used the function tracer with
trace_stats.

125kbit:
  Function                               Hit    Time            Avg             s^2
  --------                               ---    ----            ---             ---
  c_can_do_rx_poll                     63960    10168178 us     158.977 us      1493056 us
With patch:
  c_can_do_rx_poll                     63941    3764057 us      58.867 us       776162.2 us

1Mbit:
  Function                               Hit    Time            Avg             s^2
  --------                               ---    ----            ---             ---
  c_can_do_rx_poll                     69489    30049498 us     432.435 us      9271851 us
With patch:
  c_can_do_rx_poll                    207109    24322185 us     117.436 us      171469047 us

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2013-12-17 11:47:19 +01:00
..
appletalk
arcnet
bonding bonding: rebuild the bond_resend_igmp_join_requests_delayed() 2013-12-14 01:58:02 -05:00
caif virtio: use size-based config accessors. 2013-10-17 10:55:37 +10:30
can can: c_can: Speed up rx_poll function 2013-12-17 11:47:19 +01:00
cris
dsa
ethernet Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/bwh/sfc-next 2013-12-14 22:33:45 -05:00
fddi fddi: cleanup unsigned to unsigned int/short 2013-12-16 20:07:59 -05:00
hamradio drivers/net/*: Fix FSF address in file headers 2013-12-06 12:37:55 -05:00
hippi net: hippi: remove unnecessary pci_set_drvdata() 2013-12-10 22:31:32 -05:00
hyperv drivers/net/*: Fix FSF address in file headers 2013-12-06 12:37:55 -05:00
ieee802154 net: ieee802154: remove unnecessary spi_set_drvdata() 2013-12-10 22:31:32 -05:00
irda irda: vlsi_ir: remove unnecessary pci_set_drvdata() 2013-12-09 18:09:28 -05:00
phy net: phy: spi_ks8995: remove unnecessary spi_set_drvdata() 2013-12-10 22:31:32 -05:00
plip net:drivers/net: Miscellaneous conversions to ETH_ALEN 2013-10-02 17:04:45 -04:00
ppp drivers/net/*: Fix FSF address in file headers 2013-12-06 12:37:55 -05:00
slip
team team: fix master carrier set when user linkup is enabled 2013-11-29 16:34:33 -05:00
usb usb: Fix FSF address in file headers 2013-12-06 12:37:55 -05:00
vmxnet3 net: vmxnet3: remove unnecessary pci_set_drvdata() 2013-12-10 22:31:32 -05:00
wan wan: wanxl: remove unnecessary pci_set_drvdata() 2013-12-09 18:09:29 -05:00
wimax
wireless Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless 2013-12-06 09:50:45 -05:00
xen-netback xen-netback: improve guest-receive-side flow control 2013-12-09 20:33:12 -05:00
dummy.c net: Explicitly initialize u64_stats_sync structures for lockdep 2013-11-06 12:40:25 +01:00
eql.c
ifb.c net: Explicitly initialize u64_stats_sync structures for lockdep 2013-11-06 12:40:25 +01:00
Kconfig
LICENSE.SRC
loopback.c net: Explicitly initialize u64_stats_sync structures for lockdep 2013-11-06 12:40:25 +01:00
macvlan.c macvlan: Remove custom recieve and forward handlers 2013-12-12 13:38:39 -05:00
macvtap.c macvlan: Remove custom recieve and forward handlers 2013-12-12 13:38:39 -05:00
Makefile
mdio.c
mii.c
netconsole.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2013-11-04 13:48:30 -05:00
nlmon.c net: Explicitly initialize u64_stats_sync structures for lockdep 2013-11-06 12:40:25 +01:00
ntb_netdev.c
rionet.c
sb1000.c
Space.c
sungem_phy.c
tun.c Revert "tun: remove useless codes in tun_chr_aio_read() and tun_recvmsg()" 2013-12-10 22:05:45 -05:00
veth.c Merge branch 'core-locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-11-14 16:30:30 +09:00
virtio_net.c virtio_net: spelling fixes 2013-12-10 22:28:06 -05:00
vxlan.c vxlan: leave multicast group when vxlan device down 2013-12-11 14:21:26 -05:00
xen-netfront.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2013-11-19 15:50:47 -08:00