[patch 11/20] r8169: avoid needless NAPI poll scheduling

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Greg KH
Date: Monday, August 20, 2007 - 11:55 pm

-stable review patch.  If anyone has any objections, please let us know.

------------------
From: Francois Romieu <romieu@fr.zoreil.com>

Theory  : though needless, it should not have hurt.
Practice: it does not play nice with DEBUG_SHIRQ + LOCKDEP + UP
(see https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=3D242572).
 

The patch makes sense in itself but I should dig why it has an effect
on #242572 (assuming that NAPI do not change in a near future).

Patch in mainline as 313b0305b5a1e7e0fb39383befbf79558ce68a9c.
Backported to 2.6.22-stable by Thomas M=FCller.

Signed-off-by: Thomas M=FCller <thomas@mathtm.de>
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/net/r8169.c |   18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -2649,14 +2649,16 @@ rtl8169_interrupt(int irq, void *dev_ins
 			rtl8169_check_link_status(dev, tp, ioaddr);
 
 #ifdef CONFIG_R8169_NAPI
-		RTL_W16(IntrMask, rtl8169_intr_mask & ~rtl8169_napi_event);
-		tp->intr_mask = ~rtl8169_napi_event;
-
-		if (likely(netif_rx_schedule_prep(dev)))
-			__netif_rx_schedule(dev);
-		else if (netif_msg_intr(tp)) {
-			printk(KERN_INFO "%s: interrupt %04x taken in poll\n",
-			       dev->name, status);
+		if (status & rtl8169_napi_event) {
+			RTL_W16(IntrMask, rtl8169_intr_mask & ~rtl8169_napi_event);
+			tp->intr_mask = ~rtl8169_napi_event;
+
+			if (likely(netif_rx_schedule_prep(dev)))
+				__netif_rx_schedule(dev);
+			else if (netif_msg_intr(tp)) {
+				printk(KERN_INFO "%s: interrupt %04x in poll\n",
+				       dev->name, status);
+			}
 		}
 		break;
 #else

-- 
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch 00/20] 2.6.22-stable review, Greg KH, (Mon Aug 20, 11:52 pm)
[patch 04/20] sky2: carrier management, Greg KH, (Mon Aug 20, 11:54 pm)
[patch 06/20] sky2: check drop truncated packets, Greg KH, (Mon Aug 20, 11:54 pm)
[patch 11/20] r8169: avoid needless NAPI poll scheduling, Greg KH, (Mon Aug 20, 11:55 pm)
[patch 19/20] i386: Fix double fault handler, Greg KH, (Mon Aug 20, 11:56 pm)
[patch 20/20] JFFS2 locking regression fix., Greg KH, (Mon Aug 20, 11:56 pm)
Re: [patch 00/20] 2.6.22-stable review, Justin M. Forbes, (Tue Aug 21, 8:33 am)
Re: [stable] [patch 00/20] 2.6.22-stable review, Greg KH, (Wed Aug 22, 5:10 pm)