aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/forcedeth.c
diff options
context:
space:
mode:
authorTom Herbert <therbert@google.com>2010-05-05 14:15:21 -0400
committerDavid S. Miller <davem@davemloft.net>2010-05-06 00:24:17 -0400
commitd951f7250305adaea5f25398b70023681183d0cb (patch)
treefcefaffedb3ec24b876713d6afd2eab66852c6d9 /drivers/net/forcedeth.c
parent0294b6f78f2dd9d94fa0deec28e8845a7fb43ac3 (diff)
forcedeth: Account for consumed budget in napi poll
Repeated calls to nv_rx_process in napi poll routine do not take portion of budget that has been consumed in previous calls. Fix by subtracting the number of packets processed. Signed-off-by: Tom Herbert <therbert@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/forcedeth.c')
-rw-r--r--drivers/net/forcedeth.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index f9e1dd48ac56..e282d0ae6a3d 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -3564,14 +3564,15 @@ static int nv_napi_poll(struct napi_struct *napi, int budget)
3564 tx_work += nv_tx_done(dev, np->tx_ring_size); 3564 tx_work += nv_tx_done(dev, np->tx_ring_size);
3565 spin_unlock_irqrestore(&np->lock, flags); 3565 spin_unlock_irqrestore(&np->lock, flags);
3566 3566
3567 rx_count = nv_rx_process(dev, budget); 3567 rx_count = nv_rx_process(dev, budget - rx_work);
3568 retcode = nv_alloc_rx(dev); 3568 retcode = nv_alloc_rx(dev);
3569 } else { 3569 } else {
3570 spin_lock_irqsave(&np->lock, flags); 3570 spin_lock_irqsave(&np->lock, flags);
3571 tx_work += nv_tx_done_optimized(dev, np->tx_ring_size); 3571 tx_work += nv_tx_done_optimized(dev, np->tx_ring_size);
3572 spin_unlock_irqrestore(&np->lock, flags); 3572 spin_unlock_irqrestore(&np->lock, flags);
3573 3573
3574 rx_count = nv_rx_process_optimized(dev, budget); 3574 rx_count = nv_rx_process_optimized(dev,
3575 budget - rx_work);
3575 retcode = nv_alloc_rx_optimized(dev); 3576 retcode = nv_alloc_rx_optimized(dev);
3576 } 3577 }
3577 } while (retcode == 0 && 3578 } while (retcode == 0 &&