Thread (13 messages) flat view 13 messages, 4 authors, 2004-10-21

Re: [PATCH] Make netif_rx_ni preempt-safe

From: Lee Revell <hidden>
Date: 2004-10-20 00:58:49
Also in: lkml

On Tue, 2004-10-19 at 20:00, Herbert Xu wrote:
On Tue, Oct 19, 2004 at 07:55:33PM -0400, Lee Revell wrote:
quoted
--- 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);
This is broken on older compilers.
How about this:

Signed-Off-By: Lee Revell <redacted>
--- include/linux/netdevice.h~	2004-10-19 20:16:48.000000000 -0400
+++ include/linux/netdevice.h	2004-10-19 20:21:01.000000000 -0400
@@ -696,9 +696,12 @@
  */
 static inline int netif_rx_ni(struct sk_buff *skb)
 {
-       int err = netif_rx(skb);
+       int err;
+       preempt_disable();
+       err = netif_rx(skb);
        if (softirq_pending(smp_processor_id()))
                do_softirq();
+       preempt_enable();
        return err;
 }
 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help