Skip to content

Commit

Permalink
forcedeth: Account for consumed budget in napi poll
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tom Herbert authored and David S. Miller committed May 6, 2010
1 parent 0294b6f commit d951f72
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/net/forcedeth.c
Original file line number Diff line number Diff line change
Expand Up @@ -3564,14 +3564,15 @@ static int nv_napi_poll(struct napi_struct *napi, int budget)
tx_work += nv_tx_done(dev, np->tx_ring_size);
spin_unlock_irqrestore(&np->lock, flags);

rx_count = nv_rx_process(dev, budget);
rx_count = nv_rx_process(dev, budget - rx_work);
retcode = nv_alloc_rx(dev);
} else {
spin_lock_irqsave(&np->lock, flags);
tx_work += nv_tx_done_optimized(dev, np->tx_ring_size);
spin_unlock_irqrestore(&np->lock, flags);

rx_count = nv_rx_process_optimized(dev, budget);
rx_count = nv_rx_process_optimized(dev,
budget - rx_work);
retcode = nv_alloc_rx_optimized(dev);
}
} while (retcode == 0 &&
Expand Down

0 comments on commit d951f72

Please sign in to comment.