aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/gianfar.c
diff options
context:
space:
mode:
authorDai Haruki <dai.haruki@freescale.com>2008-12-16 18:29:52 -0500
committerDavid S. Miller <davem@davemloft.net>2008-12-16 18:29:52 -0500
commitb46a8454cd304b5376ba00d3457a612720e47269 (patch)
treecf6a119d3903b519b9540585684ba1eb2ef130d6 /drivers/net/gianfar.c
parentb31a1d8b41513b96e9c7ec2f68c5734cef0b26a4 (diff)
gianfar: Optimize interrupt coalescing configuration
Store the interrupt coalescing values in the form in which they will be written to the interrupt coalescing registers. This puts a little overhead into the ethtool configuration, and takes it out of the interrupt handler Signed-off-by: Dai Haruki <dai.haruki@freescale.com> Acked-by: Andy Fleming <afleming@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/gianfar.c')
-rw-r--r--drivers/net/gianfar.c24
1 files changed, 8 insertions, 16 deletions
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index 7398704c4b55..5100f75238af 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -428,11 +428,9 @@ static int gfar_probe(struct of_device *ofdev,
428 priv->rx_ring_size = DEFAULT_RX_RING_SIZE; 428 priv->rx_ring_size = DEFAULT_RX_RING_SIZE;
429 429
430 priv->txcoalescing = DEFAULT_TX_COALESCE; 430 priv->txcoalescing = DEFAULT_TX_COALESCE;
431 priv->txcount = DEFAULT_TXCOUNT; 431 priv->txic = DEFAULT_TXIC;
432 priv->txtime = DEFAULT_TXTIME;
433 priv->rxcoalescing = DEFAULT_RX_COALESCE; 432 priv->rxcoalescing = DEFAULT_RX_COALESCE;
434 priv->rxcount = DEFAULT_RXCOUNT; 433 priv->rxic = DEFAULT_RXIC;
435 priv->rxtime = DEFAULT_RXTIME;
436 434
437 /* Enable most messages by default */ 435 /* Enable most messages by default */
438 priv->msg_enable = (NETIF_MSG_IFUP << 1 ) - 1; 436 priv->msg_enable = (NETIF_MSG_IFUP << 1 ) - 1;
@@ -1060,17 +1058,13 @@ int startup_gfar(struct net_device *dev)
1060 phy_start(priv->phydev); 1058 phy_start(priv->phydev);
1061 1059
1062 /* Configure the coalescing support */ 1060 /* Configure the coalescing support */
1061 gfar_write(&regs->txic, 0);
1063 if (priv->txcoalescing) 1062 if (priv->txcoalescing)
1064 gfar_write(&regs->txic, 1063 gfar_write(&regs->txic, priv->txic);
1065 mk_ic_value(priv->txcount, priv->txtime));
1066 else
1067 gfar_write(&regs->txic, 0);
1068 1064
1065 gfar_write(&regs->rxic, 0);
1069 if (priv->rxcoalescing) 1066 if (priv->rxcoalescing)
1070 gfar_write(&regs->rxic, 1067 gfar_write(&regs->rxic, priv->rxic);
1071 mk_ic_value(priv->rxcount, priv->rxtime));
1072 else
1073 gfar_write(&regs->rxic, 0);
1074 1068
1075 if (priv->rx_csum_enable) 1069 if (priv->rx_csum_enable)
1076 rctrl |= RCTRL_CHECKSUMMING; 1070 rctrl |= RCTRL_CHECKSUMMING;
@@ -1538,8 +1532,7 @@ static irqreturn_t gfar_transmit(int irq, void *dev_id)
1538 /* Otherwise, clear it */ 1532 /* Otherwise, clear it */
1539 if (likely(priv->txcoalescing)) { 1533 if (likely(priv->txcoalescing)) {
1540 gfar_write(&priv->regs->txic, 0); 1534 gfar_write(&priv->regs->txic, 0);
1541 gfar_write(&priv->regs->txic, 1535 gfar_write(&priv->regs->txic, priv->txic);
1542 mk_ic_value(priv->txcount, priv->txtime));
1543 } 1536 }
1544 1537
1545 spin_unlock(&priv->txlock); 1538 spin_unlock(&priv->txlock);
@@ -1825,8 +1818,7 @@ static int gfar_poll(struct napi_struct *napi, int budget)
1825 /* Otherwise, clear it */ 1818 /* Otherwise, clear it */
1826 if (likely(priv->rxcoalescing)) { 1819 if (likely(priv->rxcoalescing)) {
1827 gfar_write(&priv->regs->rxic, 0); 1820 gfar_write(&priv->regs->rxic, 0);
1828 gfar_write(&priv->regs->rxic, 1821 gfar_write(&priv->regs->rxic, priv->rxic);
1829 mk_ic_value(priv->rxcount, priv->rxtime));
1830 } 1822 }
1831 } 1823 }
1832 1824