lkml.org 
[lkml]   [2004]   [Oct]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Subject[PATCH] Make netif_rx_ni preempt-safe
    From
    Date
    This patch makes netif_rx_ni() preempt-safe.  The problem was reported
    by Alain Schroeder. Here are the users:

    drivers/s390/net/ctcmain.c
    drivers/s390/net/netiucv.c
    drivers/net/irda/vlsi_ir.c
    drivers/net/tun.c

    As David S. Miller explained, the do_softirq (and therefore the preempt
    dis/enable) is required because there is no softirq check on the return
    path when netif_rx is called from non-interrupt context.

    Signed-Off-By: Lee Revell <rlrevell@joe-job.com>

    --- include/linux/netdevice.h~ 2004-10-19 18:50:18.000000000 -0400
    +++ include/linux/netdevice.h 2004-10-19 18:51:01.000000000 -0400
    @@ -696,9 +696,11 @@
    */
    static inline int netif_rx_ni(struct sk_buff *skb)
    {
    + preempt_disable();
    int err = netif_rx(skb);
    if (softirq_pending(smp_processor_id()))
    do_softirq();
    + preempt_enable();
    return err;
    }


    -
    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: 2005-03-22 14:07    [W:0.019 / U:154.128 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site