From c6a1b62de9d043f274ec3ae2e207908c6d5feff3 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Mon, 7 Jan 2008 00:23:04 -0800 Subject: [TULIP]: NAPI full quantum bug. This should fix the kernel warn/oops reported while routing. The tulip driver has a fencepost bug with new NAPI in 2.6.24 It has an off by one bug if a full quantum is reached. Signed-off-by: Stephen Hemminger Signed-off-by: David S. Miller --- drivers/net/tulip/interrupt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/net/tulip/interrupt.c') diff --git a/drivers/net/tulip/interrupt.c b/drivers/net/tulip/interrupt.c index 365331446387..0461956d3b50 100644 --- a/drivers/net/tulip/interrupt.c +++ b/drivers/net/tulip/interrupt.c @@ -151,7 +151,8 @@ int tulip_poll(struct napi_struct *napi, int budget) if (tulip_debug > 5) printk(KERN_DEBUG "%s: In tulip_rx(), entry %d %8.8x.\n", dev->name, entry, status); - if (work_done++ >= budget) + + if (++work_done >= budget) goto not_done; if ((status & 0x38008300) != 0x0300) { -- cgit v1.2.3 From 4ec2411980d0fd2995e8dea8a06fe57aa47523cb Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Mon, 7 Jan 2008 20:48:21 -0800 Subject: [NET]: Do not check netif_running() and carrier state in ->poll() Drivers do this to try to break out of the ->poll()'ing loop when the device is being brought administratively down. Now that we have a napi_disable() "pending" state we are going to solve that problem generically. Signed-off-by: David S. Miller --- drivers/net/tulip/interrupt.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'drivers/net/tulip/interrupt.c') diff --git a/drivers/net/tulip/interrupt.c b/drivers/net/tulip/interrupt.c index 0461956d3b50..6284afd14bbb 100644 --- a/drivers/net/tulip/interrupt.c +++ b/drivers/net/tulip/interrupt.c @@ -117,9 +117,6 @@ int tulip_poll(struct napi_struct *napi, int budget) int received = 0; #endif - if (!netif_running(dev)) - goto done; - #ifdef CONFIG_TULIP_NAPI_HW_MITIGATION /* that one buffer is needed for mit activation; or might be a @@ -261,8 +258,6 @@ int tulip_poll(struct napi_struct *napi, int budget) * finally: amount of IO did not increase at all. */ } while ((ioread32(tp->base_addr + CSR5) & RxIntr)); -done: - #ifdef CONFIG_TULIP_NAPI_HW_MITIGATION /* We use this simplistic scheme for IM. It's proven by -- cgit v1.2.3