aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-03-23 06:35:12 -0400
committerDavid S. Miller <davem@davemloft.net>2008-03-23 06:35:12 -0400
commitda990a2402aeaee84837f29054c4628eb02f7493 (patch)
tree098506e67860ec0f5d58f707e0ee966db70b7a74 /drivers/net
parent2572c149a2f52232ce690ddb9c6fd0c90ffd61cd (diff)
[SUNGEM]: Fix NAPI assertion failure.
As reported by Johannes Berg: I started getting this warning with recent kernels: [ 773.908927] ------------[ cut here ]------------ [ 773.908954] Badness at net/core/dev.c:2204 ... If we loop more than once in gem_poll(), we'll use more than the real budget in our gem_rx() calls, thus eventually trigger the caller's assertions in net_rx_action(). Subtract "work_done" from "budget" for the second arg to gem_rx() to fix the bug. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/sungem.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c
index 97212799c513..4291458955ef 100644
--- a/drivers/net/sungem.c
+++ b/drivers/net/sungem.c
@@ -912,7 +912,7 @@ static int gem_poll(struct napi_struct *napi, int budget)
912 * rx ring - must call napi_disable(), which 912 * rx ring - must call napi_disable(), which
913 * schedule_timeout()'s if polling is already disabled. 913 * schedule_timeout()'s if polling is already disabled.
914 */ 914 */
915 work_done += gem_rx(gp, budget); 915 work_done += gem_rx(gp, budget - work_done);
916 916
917 if (work_done >= budget) 917 if (work_done >= budget)
918 return work_done; 918 return work_done;