netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lee Revell <rlrevell@joe-job.com>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	herbert@gondor.apana.org.au, vda@port.imtp.ilyichevsk.odessa.ua,
	linux-kernel@oss.sgi.com, maxk@qualcomm.com,
	irda-users@lists.sourceforge.net,
	Linux Network Development <netdev@oss.sgi.com>,
	Alain Schroeder <alain@parkautomat.net>
Subject: [PATCH] Make netif_rx_ni preempt-safe
Date: Tue, 19 Oct 2004 19:55:33 -0400	[thread overview]
Message-ID: <1098230132.23628.28.camel@krustophenia.net> (raw)

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;
 }
 

             reply	other threads:[~2004-10-19 23:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-19 23:55 Lee Revell [this message]
2004-10-20  0:00 ` [PATCH] Make netif_rx_ni preempt-safe Herbert Xu
2004-10-20  0:22   ` Lee Revell
2004-10-20 15:11     ` Denis Vlasenko
2004-10-20 16:47       ` Lee Revell
2004-10-20 19:14         ` Denis Vlasenko
2004-10-20 19:53           ` Lee Revell
2004-10-20 19:56             ` Denis Vlasenko
2004-10-20 20:25               ` Lee Revell
2004-10-20 20:32                 ` Denis Vlasenko
2004-10-21  0:15                   ` David S. Miller
2004-10-21  0:35                     ` Herbert Xu
2004-10-21  4:58                       ` David S. Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1098230132.23628.28.camel@krustophenia.net \
    --to=rlrevell@joe-job.com \
    --cc=akpm@osdl.org \
    --cc=alain@parkautomat.net \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=irda-users@lists.sourceforge.net \
    --cc=linux-kernel@oss.sgi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maxk@qualcomm.com \
    --cc=netdev@oss.sgi.com \
    --cc=vda@port.imtp.ilyichevsk.odessa.ua \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).