From: Lee Revell <hidden> Date: 2004-10-19 23:57:38
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 <redacted>
From: Lee Revell <hidden> Date: 2004-10-20 20:02:16
On Wed, 2004-10-20 at 15:14, Denis Vlasenko wrote:
On Wednesday 20 October 2004 19:47, Lee Revell wrote:
quoted
On Wed, 2004-10-20 at 11:11, Denis Vlasenko wrote:
quoted
0x57 == 87 bytes is too big for inline.
Ugh. So the only fix is not to inline it?
Yes.
You can make it conditionally inline/non-inline
depending on SMP/preempt if you feel masochistic today :),
but last time I asked davem thought that it is over the top.
I agree, not worth the trouble. This would actually depend only on
PREEMPT and not SMP.
OK, third try.
Signed-Off-By: Lee Revell <redacted>
@@ -694,11 +694,14 @@/* Post buffer to the network code from _non interrupt_ context.*seenet/core/dev.cfornetif_rxdescription.*/-staticinlineintnetif_rx_ni(structsk_buff*skb)+staticintnetif_rx_ni(structsk_buff*skb){-interr=netif_rx(skb);+interr;+preempt_disable();+err=netif_rx(skb);if(softirq_pending(smp_processor_id()))do_softirq();+preempt_enable();returnerr;}
@@ -694,11 +694,14 @@/* Post buffer to the network code from _non interrupt_ context.*seenet/core/dev.cfornetif_rxdescription.*/-staticinlineintnetif_rx_ni(structsk_buff*skb)+staticintnetif_rx_ni(structsk_buff*skb)
non-inline functions must not live in .h files
--
vda
@@ -694,11 +694,14 @@/* Post buffer to the network code from _non interrupt_ context.*seenet/core/dev.cfornetif_rxdescription.*/-staticinlineintnetif_rx_ni(structsk_buff*skb)+staticintnetif_rx_ni(structsk_buff*skb)
@@ -694,11 +694,14 @@/* Post buffer to the network code from _non interrupt_ context.*seenet/core/dev.cfornetif_rxdescription.*/-staticinlineintnetif_rx_ni(structsk_buff*skb)+staticintnetif_rx_ni(structsk_buff*skb)
@@ -694,11 +694,14 @@/* Post buffer to the network code from _non interrupt_ context.*seenet/core/dev.cfornetif_rxdescription.*/-staticinlineintnetif_rx_ni(structsk_buff*skb)+staticintnetif_rx_ni(structsk_buff*skb)
@@ -690,21 +691,6 @@externvoiddev_init(void);externintnetdev_nit;--/* Post buffer to the network code from _non interrupt_ context.-*seenet/core/dev.cfornetif_rxdescription.-*/-staticinlineintnetif_rx_ni(structsk_buff*skb)-{-interr=netif_rx(skb);--preempt_disable();-if(softirq_pending(smp_processor_id()))-do_softirq();-preempt_enable();--returnerr;-}/* Called by rtnetlink.c:rtnl_unlock() */externvoidnetdev_run_todo(void);
On Wednesday 20 October 2004 19:47, Lee Revell wrote:
On Wed, 2004-10-20 at 11:11, Denis Vlasenko wrote:
quoted
0x57 == 87 bytes is too big for inline.
Ugh. So the only fix is not to inline it?
Yes.
You can make it conditionally inline/non-inline
depending on SMP/preempt if you feel masochistic today :),
but last time I asked davem thought that it is over the top.
Deinline it.
--
vda