netconsole: Use netif_running() in write_msg()
Subsystems (3)
PATCH 21/28 netconsole: Use netif_running() in write_msg()
From: Satyam Sharma <[email protected]>
Based upon initial work by Keiichi Kii <[email protected]>.
Avoid unnecessarily disabling interrupts and calling netpoll_send_udp() if the corresponding local interface is not up.
Signed-off-by Satyam Sharma <[email protected]>
Acked-by Keiichi Kii <[email protected]>
Cc Matt Mackall <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
drivers/net/netconsole.c | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-)
drivers/net/netconsole.c renamed from drivers/net/netconsole.c~netconsole-use-netif_running-in-write_msg +9 -9
@@ -75,16 +75,16 @@ static void write_msg(struct console *coint frag, left;unsigned long flags; -local_irq_save (flags); - -for (left = len; left;) { - frag =min (left,MAX_PRINT_CHUNK ); -netpoll_send_udp (&np, msg, frag); - msg += frag; - left -= frag; +if (netif_running (np.dev)) { +local_irq_save (flags); +for (left = len; left;) { + frag =min (left,MAX_PRINT_CHUNK ); +netpoll_send_udp (&np, msg, frag); + msg += frag; + left -= frag; + } +local_irq_restore (flags); } - -local_irq_restore (flags); }static struct console netconsole = {
_
From: [email protected]
Date: Fri, 10 Aug 2007 14:12:04 -0700
Quoted 11 lines
From: Satyam Sharma <[email protected]>
Based upon initial work by Keiichi Kii <[email protected]>.
Avoid unnecessarily disabling interrupts and calling
netpoll_send_udp()if the corresponding local interface is not up.Signed-off-by Satyam Sharma <[email protected]>Acked-by Keiichi Kii <[email protected]>Cc Matt Mackall <[email protected]>Signed-off-by Andrew Morton <[email protected]>
Applied to net-2.6.24, thanks!