Skip to contentSkip to conversation

netpoll: trapping fix/cleanup

PATCH In review Sergei Shtylyov 3 participants 4 messages Mar 30, 2007 – Apr 5, 2007

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

PATCH 1/1 netpoll: trapping fix/cleanup

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). Make this option more sensible by only bypassing TX softirq wakeup and remove CONFIG_NETPOLL_RX option completely since there is *no* code depending on it.

---

 drivers/net/Kconfig       |    5 -----
 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);
 }
 
drivers/net/Kconfig +0 -5
Index: linux-2.6/drivers/net/Kconfig
===================================================================
@@ -2928,11 +2928,6 @@ endif #NETDEVICES
 config NETPOLL
 	def_bool NETCONSOLE
 
-config NETPOLL_RX
-	bool "Netpoll support for trapping incoming packets"
-	default n
-	depends on NETPOLL
-
 config NETPOLL_TRAP
 	bool "Netpoll traffic trapping"
 	default n
#1 lore raw
Quoted 7 lines · Sergei Shtylyov

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). Make this option more sensible by only bypassing TX softirq wakeup and remove CONFIG_NETPOLL_RX option completely since there is *no* code depending on it.

ACK but (a) DaveM not me should apply this, and (b) I would check with netpoll people to see what that define is there for.

Jeff

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

#2 lore raw

Hello.

Quoted 10 lines · Jeff Garzik
Quoted 9 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). Make this option more sensible by only bypassing TX softirq wakeup and remove
CONFIG_NETPOLL_RX option completely since there is *no* code depending on it.

Quoted 3 lines
Quoted 1 line

ACK but (a) DaveM not me should apply this,

Oops, sorry. But he's only mentioned as IPv4/v6 maintainer. :-)

Quoted 2 lines

and (b) I would check with
netpoll people to see what that define is there for.

Amit Kale and I were already asking about CONFIG_NETPOLL_TRAP here 1+
months ago and got no replies. Well I'll try to CC Matt Mackall...
If you mean CONFIG_NETPOLL_RX, there was #ifdef's in the early version of
netpoll support:

http://git.kernel.org/?p=linux/kernel/git/tglx/history.git;a=commitdiff;h=8fb9cf8ab6c0ccb1b17b32c05dc9da3cc96ac229

but later they were removed but the option left:

http://git.kernel.org/?p=linux/kernel/git/tglx/history.git;a=commitdiff;h=e3c265bcf67f21d847e970e71504890f61f37824

Quoted 1 line

Jeff

WBR, Sergei

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

#3 lore raw
In reply to Jeff Garzik
Quoted 11 lines · Jeff Garzik
Quoted 7 lines · Sergei Shtylyov

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). Make this option more sensible by only bypassing TX softirq wakeup and remove CONFIG_NETPOLL_RX option completely since there is *no* code depending on it.

ACK but (a) DaveM not me should apply this, and (b) I would check with netpoll people to see what that define is there for.

In terms of KGDB usage, I know Sergei has been trying to track down and fix some issues (/make it more reliable) so if this does impact us I know he'll be sending something along. ACK.

Signature · 7 lines
Tom Rini

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV