| To: | Andrew Morton <akpm@xxxxxxxx> |
|---|---|
| Subject: | [PATCH] Make netif_rx_ni preempt-safe |
| From: | Lee Revell <rlrevell@xxxxxxxxxxx> |
| Date: | Tue, 19 Oct 2004 19:55:33 -0400 |
| Cc: | linux-kernel <linux-kernel@xxxxxxxxxxxxxxx>, "David S. Miller" <davem@xxxxxxxxxxxxx>, herbert@xxxxxxxxxxxxxxxxxxx, vda@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, linux-kernel, maxk@xxxxxxxxxxxx, irda-users@xxxxxxxxxxxxxxxxxxxxx, Linux Network Development <netdev@xxxxxxxxxxx>, Alain Schroeder <alain@xxxxxxxxxxxxxxx> |
| Sender: | netdev-bounce@xxxxxxxxxxx |
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@xxxxxxxxxxx>
--- 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;
}
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | re-clone netdev-2.6, Jeff Garzik |
|---|---|
| Next by Date: | Re: [PATCH] Make netif_rx_ni preempt-safe, Herbert Xu |
| Previous by Thread: | re-clone netdev-2.6, Jeff Garzik |
| Next by Thread: | Re: [PATCH] Make netif_rx_ni preempt-safe, Herbert Xu |
| Indexes: | [Date] [Thread] [Top] [All Lists] |