Commit d951f725 authored by Tom Herbert's avatar Tom Herbert Committed by David S. Miller

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: default avatarTom Herbert <therbert@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0294b6f7
...@@ -3564,14 +3564,15 @@ static int nv_napi_poll(struct napi_struct *napi, int budget) ...@@ -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); tx_work += nv_tx_done(dev, np->tx_ring_size);
spin_unlock_irqrestore(&np->lock, flags); 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); retcode = nv_alloc_rx(dev);
} else { } else {
spin_lock_irqsave(&np->lock, flags); spin_lock_irqsave(&np->lock, flags);
tx_work += nv_tx_done_optimized(dev, np->tx_ring_size); tx_work += nv_tx_done_optimized(dev, np->tx_ring_size);
spin_unlock_irqrestore(&np->lock, flags); 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); retcode = nv_alloc_rx_optimized(dev);
} }
} while (retcode == 0 && } while (retcode == 0 &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment