[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <200708102112.l7ALC4RO009442@imap1.linux-foundation.org>
Date: Fri, 10 Aug 2007 14:12:04 -0700
From: akpm@...ux-foundation.org
To: davem@...emloft.net
Cc: netdev@...r.kernel.org, akpm@...ux-foundation.org,
satyam@...radead.org, k-keiichi@...jp.nec.com, mpm@...enic.com
Subject: [patch 21/28] netconsole: Use netif_running() in write_msg()
From: Satyam Sharma <satyam@...radead.org>
Based upon initial work by Keiichi Kii <k-keiichi@...jp.nec.com>.
Avoid unnecessarily disabling interrupts and calling netpoll_send_udp() if the
corresponding local interface is not up.
Signed-off-by: Satyam Sharma <satyam@...radead.org>
Acked-by: Keiichi Kii <k-keiichi@...jp.nec.com>
Cc: Matt Mackall <mpm@...enic.com>
Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
---
drivers/net/netconsole.c | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
diff -puN drivers/net/netconsole.c~netconsole-use-netif_running-in-write_msg drivers/net/netconsole.c
--- a/drivers/net/netconsole.c~netconsole-use-netif_running-in-write_msg
+++ a/drivers/net/netconsole.c
@@ -75,16 +75,16 @@ static void write_msg(struct console *co
int 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 = {
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists