Commit 0cc120be authored by Satyam Sharma's avatar Satyam Sharma Committed by David S. Miller

[NET] netconsole: Use netif_running() in write_msg()

Based upon initial work by Keiichi Kii <k-keiichi@bx.jp.nec.com>.

Avoid unnecessarily disabling interrupts and calling netpoll_send_udp() if the
corresponding local interface is not up.
Signed-off-by: default avatarSatyam Sharma <satyam@infradead.org>
Acked-by: default avatarKeiichi Kii <k-keiichi@bx.jp.nec.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d2b60881
...@@ -75,16 +75,16 @@ static void write_msg(struct console *con, const char *msg, unsigned int len) ...@@ -75,16 +75,16 @@ static void write_msg(struct console *con, const char *msg, unsigned int len)
int frag, left; int frag, left;
unsigned long flags; unsigned long flags;
local_irq_save(flags); if (netif_running(np.dev)) {
local_irq_save(flags);
for (left = len; left;) { for (left = len; left;) {
frag = min(left, MAX_PRINT_CHUNK); frag = min(left, MAX_PRINT_CHUNK);
netpoll_send_udp(&np, msg, frag); netpoll_send_udp(&np, msg, frag);
msg += frag; msg += frag;
left -= frag; left -= frag;
}
local_irq_restore(flags);
} }
local_irq_restore(flags);
} }
static struct console netconsole = { static struct console netconsole = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment