From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S270227AbUJSX5i (ORCPT ); Tue, 19 Oct 2004 19:57:38 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S270225AbUJSX5Z (ORCPT ); Tue, 19 Oct 2004 19:57:25 -0400 Received: from mustang.oldcity.dca.net ([216.158.38.3]:6278 "HELO mustang.oldcity.dca.net") by vger.kernel.org with SMTP id S270227AbUJSX4P (ORCPT ); Tue, 19 Oct 2004 19:56:15 -0400 Subject: [PATCH] Make netif_rx_ni preempt-safe From: Lee Revell To: Andrew Morton Cc: linux-kernel , "David S. Miller" , herbert@gondor.apana.org.au, vda@port.imtp.ilyichevsk.odessa.ua, linux-kernel@vger.kernel.org, maxk@qualcomm.com, irda-users@lists.sourceforge.net, Linux Network Development , Alain Schroeder Content-Type: text/plain Message-Id: <1098230132.23628.28.camel@krustophenia.net> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Tue, 19 Oct 2004 19:55:33 -0400 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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; } From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lee Revell Subject: [PATCH] Make netif_rx_ni preempt-safe Date: Tue, 19 Oct 2004 19:55:33 -0400 Sender: netdev-bounce@oss.sgi.com Message-ID: <1098230132.23628.28.camel@krustophenia.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: linux-kernel , "David S. Miller" , 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 , Alain Schroeder Return-path: To: Andrew Morton Errors-to: netdev-bounce@oss.sgi.com List-Id: netdev.vger.kernel.org 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 --- 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; }