linux/drivers/net/can
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
..
c_can can: c_can: Speed up rx_poll function 2013-12-17 11:47:19 +01:00
cc770 can: cc770: use dev_get_platdata() 2013-09-21 15:43:13 +02:00
mscan can: Remove extern from function prototypes 2013-09-24 10:09:18 -04:00
sja1000 can: sja1000: fix {pre,post}_irq() handling and IRQ handler return value 2013-11-25 21:16:53 +01:00
softing Merge branch 'for-davem' of git://gitorious.org/linux-can/linux-can-next 2013-09-30 19:14:20 -04:00
usb can: kvaser_usb: fix usb endpoints detection 2013-10-31 20:20:23 +01:00
Kconfig can: flexcan: remove HAVE_CAN_FLEXCAN Kconfig symbol 2013-06-03 13:13:49 +02:00
Makefile can: add tx/rx LED trigger support 2013-01-26 16:58:59 +01:00
at91_can.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2013-10-23 16:49:34 -04:00
bfin_can.c can: bfin_can: use dev_get_platdata() 2013-09-21 15:43:13 +02:00
dev.c can: dev: sort can_changelink() by IFLA_CAN_* 2013-10-31 20:55:15 +01:00
flexcan.c can: flexcan: use correct clock as base for bit rate calculation 2013-11-26 15:39:47 +01:00
grcan.c drivers: remove unnecessary prom.h includes 2013-10-09 20:03:58 -05:00
janz-ican3.c can: janz-ican3: use dev_get_platdata() 2013-09-21 15:43:14 +02:00
led.c net: pass info struct via netdevice notifier 2013-05-28 13:11:01 -07:00
mcp251x.c can: mcp251x: use dev_get_platdata() 2013-09-21 15:43:14 +02:00
pch_can.c can: pch_can: remove unnecessary pci_set_drvdata() 2013-09-21 15:43:16 +02:00
slcan.c slcan: rewrite of slc_bump and slc_encaps 2013-09-20 15:38:27 -04:00
ti_hecc.c can: ti_hecc: remove priv->can.do_get_state() callback 2013-10-31 20:55:16 +01:00
vcan.c sections: fix section conflicts in drivers/net 2012-10-06 03:04:42 +09:00