]> git.baikalelectronics.ru Git - kernel.git/commit
net: ethernet: fec: Replace interrupt driven MDIO with polled IO
authorAndrew Lunn <andrew@lunn.ch>
Sun, 19 Apr 2020 22:04:00 +0000 (00:04 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 20 Apr 2020 19:37:07 +0000 (12:37 -0700)
commitee4e250c8a0c3d95c26f7ed583cdeef417800765
tree3583aaa9233ce774a224a3cf5ba86ae2e339794b
parent4d82269a986c8e507e23a54f8b2fb2f49f1c8997
net: ethernet: fec: Replace interrupt driven MDIO with polled IO

Measurements of the MDIO bus have shown that driving the MDIO bus
using interrupts is slow. Back to back MDIO transactions take about
90us, with 25us spent performing the transaction, and the remainder of
the time the bus is idle.

Replacing the completion interrupt with polled IO results in back to
back transactions of 40us. The polling loop waiting for the hardware
to complete the transaction takes around 28us. Which suggests
interrupt handling has an overhead of 50us, and polled IO nearly
halves this overhead, and doubles the MDIO performance.

Suggested-by: Chris Heally <cphealy@gmail.com>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/fec.h
drivers/net/ethernet/freescale/fec_main.c