提交 0cc120be 编写于 作者: S Satyam Sharma 提交者: 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: NSatyam Sharma <satyam@infradead.org>
Acked-by: NKeiichi Kii <k-keiichi@bx.jp.nec.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册