From 2f4489112896770d66dc2960f71174d69ee23004 Mon Sep 17 00:00:00 2001 From: Andy Fleming Date: Mon, 24 Mar 2008 10:53:28 -0500 Subject: gianfar: Fix Rx/Tx HW interrupt coalescing counter reset procedure. - Fix Rx/Tx HW interrupt coalescing counter reset logic. Disabling is required before resetting the counter. - Update the Default both Rx and Tx coalescing timer threshold. Formerly 4 is set which is equal to 1.5 frame at the line rate of 1GbE interface, and it doesn't match to the coalescing frame count which is set to 16. Threashold 21 is matched to frame count 16. Signed-off-by: Dai Haruki Signed-off-by: Andy Fleming Signed-off-by: Jeff Garzik --- drivers/net/gianfar.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'drivers/net/gianfar.c') diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c index a59edf7eacd..601f93e482c 100644 --- a/drivers/net/gianfar.c +++ b/drivers/net/gianfar.c @@ -1299,11 +1299,11 @@ static irqreturn_t gfar_transmit(int irq, void *dev_id) /* If we are coalescing the interrupts, reset the timer */ /* Otherwise, clear it */ - if (priv->txcoalescing) + if (likely(priv->txcoalescing)) { + gfar_write(&priv->regs->txic, 0); gfar_write(&priv->regs->txic, mk_ic_value(priv->txcount, priv->txtime)); - else - gfar_write(&priv->regs->txic, 0); + } spin_unlock(&priv->txlock); @@ -1417,11 +1417,11 @@ irqreturn_t gfar_receive(int irq, void *dev_id) /* If we are coalescing interrupts, update the timer */ /* Otherwise, clear it */ - if (priv->rxcoalescing) + if (likely(priv->rxcoalescing)) { + gfar_write(&priv->regs->rxic, 0); gfar_write(&priv->regs->rxic, mk_ic_value(priv->rxcount, priv->rxtime)); - else - gfar_write(&priv->regs->rxic, 0); + } spin_unlock_irqrestore(&priv->rxlock, flags); #endif @@ -1593,11 +1593,11 @@ static int gfar_poll(struct napi_struct *napi, int budget) /* If we are coalescing interrupts, update the timer */ /* Otherwise, clear it */ - if (priv->rxcoalescing) + if (likely(priv->rxcoalescing)) { + gfar_write(&priv->regs->rxic, 0); gfar_write(&priv->regs->rxic, mk_ic_value(priv->rxcount, priv->rxtime)); - else - gfar_write(&priv->regs->rxic, 0); + } } return howmany; -- cgit v1.2.3