[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.1.00.1005052111440.31888@pokey.mtv.corp.google.com>
Date: Wed, 5 May 2010 21:15:21 -0700 (PDT)
From: Tom Herbert <therbert@...gle.com>
To: netdev@...r.kernel.org, davem@...emloft.net
Subject: [PATCH] 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@...gle.com>
---
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index f9e1dd4..e282d0a 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)
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 &&
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists