[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20070730024821.10828.48960.sendpatchset@enigma.security.iitk.ac.in>
Date: Mon, 30 Jul 2007 08:18:21 +0530
From: Satyam Sharma <satyam@...radead.org>
To: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Cc: Keiichi Kii <k-keiichi@...jp.nec.com>,
Netdev <netdev@...r.kernel.org>,
Joel Becker <joel.becker@...cle.com>,
Matt Mackall <mpm@...enic.com>,
Andrew Morton <akpm@...ux-foundation.org>,
David Miller <davem@...emloft.net>
Subject: [PATCH v3 -mm 4/9] netconsole: Use netif_running() in write_msg()
From: Satyam Sharma <satyam@...radead.org>
[4/9] netconsole: Use netif_running() in write_msg()
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>
---
drivers/net/netconsole.c | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
index e56aa6c..75cb761 100644
--- a/drivers/net/netconsole.c
+++ b/drivers/net/netconsole.c
@@ -75,16 +75,16 @@ static void write_msg(struct console *con, const char *msg, unsigned int len)
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