aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/forcedeth.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index a1c0e7bb70e8..5cf0e6615695 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -3743,23 +3743,26 @@ static int nv_napi_poll(struct napi_struct *napi, int budget)
3743 u8 __iomem *base = get_hwbase(dev); 3743 u8 __iomem *base = get_hwbase(dev);
3744 unsigned long flags; 3744 unsigned long flags;
3745 int retcode; 3745 int retcode;
3746 int tx_work, rx_work; 3746 int rx_count, tx_work=0, rx_work=0;
3747 3747
3748 if (!nv_optimized(np)) { 3748 do {
3749 spin_lock_irqsave(&np->lock, flags); 3749 if (!nv_optimized(np)) {
3750 tx_work = nv_tx_done(dev, np->tx_ring_size); 3750 spin_lock_irqsave(&np->lock, flags);
3751 spin_unlock_irqrestore(&np->lock, flags); 3751 tx_work += nv_tx_done(dev, np->tx_ring_size);
3752 spin_unlock_irqrestore(&np->lock, flags);
3752 3753
3753 rx_work = nv_rx_process(dev, budget); 3754 rx_count = nv_rx_process(dev, budget);
3754 retcode = nv_alloc_rx(dev); 3755 retcode = nv_alloc_rx(dev);
3755 } else { 3756 } else {
3756 spin_lock_irqsave(&np->lock, flags); 3757 spin_lock_irqsave(&np->lock, flags);
3757 tx_work = nv_tx_done_optimized(dev, np->tx_ring_size); 3758 tx_work += nv_tx_done_optimized(dev, np->tx_ring_size);
3758 spin_unlock_irqrestore(&np->lock, flags); 3759 spin_unlock_irqrestore(&np->lock, flags);
3759 3760
3760 rx_work = nv_rx_process_optimized(dev, budget); 3761 rx_count = nv_rx_process_optimized(dev, budget);
3761 retcode = nv_alloc_rx_optimized(dev); 3762 retcode = nv_alloc_rx_optimized(dev);
3762 } 3763 }
3764 } while (retcode == 0 &&
3765 rx_count > 0 && (rx_work += rx_count) < budget);
3763 3766
3764 if (retcode) { 3767 if (retcode) {
3765 spin_lock_irqsave(&np->lock, flags); 3768 spin_lock_irqsave(&np->lock, flags);