lkml.org 
[lkml]   [2007]   [Jul]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Date
    Subject[PATCH v2 -mm 7/9] netconsole: Use netif_running() in write_msg()
    From: Satyam Sharma <ssatyam@cse.iitk.ac.in>

    [7/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 <ssatyam@cse.iitk.ac.in>
    Cc: Keiichi Kii <k-keiichi@bx.jp.nec.com>

    ---

    drivers/net/netconsole.c | 18 +++++++++---------
    1 file changed, 9 insertions(+), 9 deletions(-)

    ---

    diff -ruNp a/drivers/net/netconsole.c b/drivers/net/netconsole.c
    --- a/drivers/net/netconsole.c 2007-07-10 07:26:47.000000000 +0530
    +++ b/drivers/net/netconsole.c 2007-07-10 07:45:51.000000000 +0530
    @@ -113,16 +113,16 @@ static void write_msg(struct console *co
    unsigned long flags;
    struct netconsole_target *nt = &default_target;

    - local_irq_save(flags);
    -
    - for (left = len; left;) {
    - frag = min(left, MAX_PRINT_CHUNK);
    - netpoll_send_udp(&nt->np, msg, frag);
    - msg += frag;
    - left -= frag;
    + if (netif_running(nt->np.dev)) {
    + local_irq_save(flags);
    + for (left = len; left;) {
    + frag = min(left, MAX_PRINT_CHUNK);
    + netpoll_send_udp(&nt->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 linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/
    \
     
     \ /
      Last update: 2007-07-10 11:03    [W:0.020 / U:0.380 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site