Skip to contentSkip to conversation

netpoll: fix TX queue overflow in trapped mode

PATCH Applied Sergei Shtylyov 2 participants 4 messages Apr 28, 2007 – Apr 29, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 netpoll: fix TX queue overflow in trapped mode

CONFIG_NETPOLL_TRAP causes the TX queue controls to be completely bypassed in the netpoll's "trapped" mode which easily causes overflows in the drivers with short TX queues (most notably, in 8139too with its 4-deep queue). So, make this option more sensible by making it only bypass the TX softirq wakeup.

---
Split this part form the initial patch as request by Matt Mackall.

 include/linux/netdevice.h |    8 +++-----
 2 files changed, 3 insertions(+), 10 deletions(-)
include/linux/netdevice.h +3 -5
Index: linux-2.6/include/linux/netdevice.h
===================================================================
@@ -647,8 +647,10 @@ static inline void netif_start_queue(str
 static inline void netif_wake_queue(struct net_device *dev)
 {
 #ifdef CONFIG_NETPOLL_TRAP
-	if (netpoll_trap())
+	if (netpoll_trap()) {
+		clear_bit(__LINK_STATE_XOFF, &dev->state);
 		return;
+	}
 #endif
 	if (test_and_clear_bit(__LINK_STATE_XOFF, &dev->state))
 		__netif_schedule(dev);
@@ -656,10 +658,6 @@ static inline void netif_wake_queue(stru
 
 static inline void netif_stop_queue(struct net_device *dev)
 {
-#ifdef CONFIG_NETPOLL_TRAP
-	if (netpoll_trap())
-		return;
-#endif
 	set_bit(__LINK_STATE_XOFF, &dev->state);
 }
 
author Acked-by Jeff Garzik Acked-by Matt Mackall on v1 1/1
#1 lore raw
Quoted 5 lines · you

CONFIG_NETPOLL_TRAP causes the TX queue controls to be completely bypassed in the netpoll's "trapped" mode which easily causes overflows in the drivers with short TX queues (most notably, in 8139too with its 4-deep queue). So, make this option more sensible by making it only bypass the TX softirq wakeup.

Dammit! Finally forgot to add acks earned so far:

Quoted 1 line
Quoted 32 lines

---
Split this part form the initial patch as request by Matt Mackall.

 include/linux/netdevice.h |    8 +++-----
 2 files changed, 3 insertions(+), 10 deletions(-)

Index: linux-2.6/include/linux/netdevice.h
===================================================================

include/linux/netdevice.h +3 -5
@@ -647,8 +647,10 @@ static inline void netif_start_queue(str
 static inline void netif_wake_queue(struct net_device *dev)
 {
 #ifdef CONFIG_NETPOLL_TRAP
-	if (netpoll_trap())
+	if (netpoll_trap()) {
+		clear_bit(__LINK_STATE_XOFF, &dev->state);
 		return;
+	}
 #endif
 	if (test_and_clear_bit(__LINK_STATE_XOFF, &dev->state))
 		__netif_schedule(dev);
@@ -656,10 +658,6 @@ static inline void netif_wake_queue(stru
 
 static inline void netif_stop_queue(struct net_device *dev)
 {
-#ifdef CONFIG_NETPOLL_TRAP
-	if (netpoll_trap())
-		return;
-#endif
 	set_bit(__LINK_STATE_XOFF, &dev->state);
 }
author Acked-by Tom Rini
#2 lore raw
Quoted 6 lines · On Saturday 28 April 2007 22:52, I wrote:
Quoted 5 lines

CONFIG_NETPOLL_TRAP causes the TX queue controls to be completely bypassed in the netpoll's "trapped" mode which easily causes overflows in the drivers with short TX queues (most notably, in 8139too with its 4-deep queue). So, make this option more sensible by making it only bypass the TX softirq wakeup.

Dammit! Finally forgot to add acks earned so far:

Oh, and there was even another one:

Quoted 3 lines
Quoted 1 line
Quoted 34 lines
Quoted 32 lines

---
Split this part form the initial patch as request by Matt Mackall.

 include/linux/netdevice.h |    8 +++-----
 2 files changed, 3 insertions(+), 10 deletions(-)

Index: linux-2.6/include/linux/netdevice.h
===================================================================

include/linux/netdevice.h +3 -5
@@ -647,8 +647,10 @@ static inline void netif_start_queue(str
 static inline void netif_wake_queue(struct net_device *dev)
 {
 #ifdef CONFIG_NETPOLL_TRAP
-	if (netpoll_trap())
+	if (netpoll_trap()) {
+		clear_bit(__LINK_STATE_XOFF, &dev->state);
 		return;
+	}
 #endif
 	if (test_and_clear_bit(__LINK_STATE_XOFF, &dev->state))
 		__netif_schedule(dev);
@@ -656,10 +658,6 @@ static inline void netif_wake_queue(stru
 
 static inline void netif_stop_queue(struct net_device *dev)
 {
-#ifdef CONFIG_NETPOLL_TRAP
-	if (netpoll_trap())
-		return;
-#endif
 	set_bit(__LINK_STATE_XOFF, &dev->state);
 }
maintainer Applied
#3 lore raw

From: Sergei Shtylyov <[email protected]>
Date: Sun, 29 Apr 2007 00:25:41 +0400

Quoted 7 lines · On Saturday 28 April 2007 22:52, I wrote:
Quoted 6 lines
Quoted 6 lines

CONFIG_NETPOLL_TRAP causes the TX queue controls to be completely bypassed in the netpoll's "trapped" mode which easily causes overflows in the drivers with short TX queues (most notably, in 8139too with its 4-deep queue). So, make this option more sensible by making it only bypass the TX softirq wakeup.

Quoted 9 lines
Quoted 1 line

Dammit! Finally forgot to add acks earned so far:

Oh, and there was even another one:

Quoted 3 lines
Quoted 1 line
Quoted 1 line

Applied, I'll push this to -stable too.