summaryrefslogtreecommitdiff
path: root/drivers/net/amd8111e.c
diff options
context:
space:
mode:
authorChris Friesen <cfriesen@nortel.com>2008-10-28 15:50:54 -0700
committerDavid S. Miller <davem@davemloft.net>2008-10-28 15:50:54 -0700
commit48e5ecae691cfb50aa39036ba9fc193f5c24dbb3 (patch)
tree00d40cab7f9724bf84a493b7f10cbbc3c59d8c1d /drivers/net/amd8111e.c
parent882716604ecf388b2ff09bc76eb2a752aa9cc76b (diff)
amd8111e: Fix rx return code
The amd8111e rx poll routine currently mishandles the case when we process exactly the number of packets specified in the budget. This patch is basically as suggested by David Miller. Signed-off-by: Chris Friesen <cfriesen@nortel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/amd8111e.c')
-rw-r--r--drivers/net/amd8111e.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/net/amd8111e.c b/drivers/net/amd8111e.c
index c54967f7942a..ba1be0b3a8c8 100644
--- a/drivers/net/amd8111e.c
+++ b/drivers/net/amd8111e.c
@@ -833,12 +833,14 @@ static int amd8111e_rx_poll(struct napi_struct *napi, int budget)
} while(intr0 & RINT0);
- /* Receive descriptor is empty now */
- spin_lock_irqsave(&lp->lock, flags);
- __netif_rx_complete(dev, napi);
- writel(VAL0|RINTEN0, mmio + INTEN0);
- writel(VAL2 | RDMD0, mmio + CMD0);
- spin_unlock_irqrestore(&lp->lock, flags);
+ if (rx_pkt_limit > 0) {
+ /* Receive descriptor is empty now */
+ spin_lock_irqsave(&lp->lock, flags);
+ __netif_rx_complete(dev, napi);
+ writel(VAL0|RINTEN0, mmio + INTEN0);
+ writel(VAL2 | RDMD0, mmio + CMD0);
+ spin_unlock_irqrestore(&lp->lock, flags);
+ }
rx_not_empty:
return num_rx_pkt;