diff options
author | Claudiu Manoil <claudiu.manoil@freescale.com> | 2013-02-14 05:00:02 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-02-14 13:32:24 -0500 |
commit | 369ec162b30e34c29bef8ec5ce32c40d5697fd64 (patch) | |
tree | 4fc74e93960c792f3c057a9b92ea7d066e1aacb4 /drivers/net/ethernet/freescale/gianfar.h | |
parent | 41a2060976ca879a68108ffb181dc429d556adce (diff) | |
download | blackbird-op-linux-369ec162b30e34c29bef8ec5ce32c40d5697fd64.tar.gz blackbird-op-linux-369ec162b30e34c29bef8ec5ce32c40d5697fd64.zip |
gianfar: Add device ref (dev) in gfar_private
Use device pointer (dev) to simplify the code and to
avoid double indirections, especially on the hot path.
Basically, instead of accessing priv to get the ofdev
reference and then accessing the ofdev structure to
dereference the needed dev pointer, we will get the
dev pointer directly from priv.
The dev pointer is required on the hot path, see gfar_new_rxbdp
or gfar_clean_rx_ring (or xmit), and this patch makes
it available directly from priv's 1st cacheline.
This change is reflected at asm level too, taking (the hot)
gfar_new_rxbdp():
initial version -
18c0: 7c 7e 1b 78 mr r30,r3
18d0: 81 69 04 3c lwz r11,1084(r9)
18d8: 34 6b 00 10 addic. r3,r11,16
18dc: 41 82 00 08 beq- 18e4
patched version -
18d0: 80 69 04 38 lwz r3,1080(r9)
18d8: 2f 83 00 00 cmpwi cr7,r3,0
18dc: 41 9e 00 08 beq- cr7,18e4
Signed-off-by: Claudiu Manoil <claudiu.manoil@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/freescale/gianfar.h')
-rw-r--r-- | drivers/net/ethernet/freescale/gianfar.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/ethernet/freescale/gianfar.h b/drivers/net/ethernet/freescale/gianfar.h index 8b4de57a5c23..8b27e5ff54c0 100644 --- a/drivers/net/ethernet/freescale/gianfar.h +++ b/drivers/net/ethernet/freescale/gianfar.h @@ -1060,6 +1060,7 @@ struct gfar_private { unsigned int total_tx_ring_size; unsigned int total_rx_ring_size; + struct device *dev; struct net_device *ndev; struct platform_device *ofdev; enum gfar_errata errata; |