netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Make netif_rx_ni preempt-safe
@ 2004-10-19 23:55 Lee Revell
  2004-10-20  0:00 ` Herbert Xu
  0 siblings, 1 reply; 13+ messages in thread
From: Lee Revell @ 2004-10-19 23:55 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-kernel, David S. Miller, herbert, vda, linux-kernel, maxk,
	irda-users, Linux Network Development, Alain Schroeder

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2004-10-21  4:58 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-19 23:55 [PATCH] Make netif_rx_ni preempt-safe Lee Revell
2004-10-20  0:00 ` 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

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).