netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "David S. Miller" <davem@davemloft.net>
To: Denis Vlasenko <vda@port.imtp.ilyichevsk.odessa.ua>
Cc: rlrevell@joe-job.com, herbert@gondor.apana.org.au, akpm@osdl.org,
	linux-kernel@vger.kernel.org, linux-kernel@gondor.apana.org.au,
	maxk@qualcomm.com, irda-users@lists.sourceforge.net,
	netdev@oss.sgi.com, alain@parkautomat.net
Subject: Re: [PATCH] Make netif_rx_ni preempt-safe
Date: Wed, 20 Oct 2004 17:15:08 -0700	[thread overview]
Message-ID: <20041020171508.0e947d08.davem@davemloft.net> (raw)
In-Reply-To: <200410202332.33583.vda@port.imtp.ilyichevsk.odessa.ua>

On Wed, 20 Oct 2004 23:32:33 +0300
Denis Vlasenko <vda@port.imtp.ilyichevsk.odessa.ua> wrote:

> On Wednesday 20 October 2004 23:25, Lee Revell wrote:
> > > > --- include/linux/netdevice.h~	2004-10-20 15:51:00.000000000 -0400
> > > > +++ include/linux/netdevice.h	2004-10-20 15:51:54.000000000 -0400
> > > > @@ -694,11 +694,14 @@
> > > >  /* Post buffer to the network code from _non interrupt_ context.
> > > >   * see net/core/dev.c for netif_rx description.
> > > >   */
> > > > -static inline int netif_rx_ni(struct sk_buff *skb)
> > > > +static int netif_rx_ni(struct sk_buff *skb)
> > > 
> > > non-inline functions must not live in .h files
> > 
> > Where do you suggest we put it?
> 
> Somewhere near this place:
> 
> http://lxr.linux.no/source/net/core/dev.c?v=2.6.8.1#L1555

I've done this as follows, thanks.

# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2004/10/20 16:57:53-07:00 davem@nuts.davemloft.net 
#   [NET]: Uninline netif_rx_ni().
#   
#   It expands to a lot of code when SMP or PREEMPT is
#   enabled.
#   
#   Signed-off-by: David S. Miller <davem@davemloft.net>
# 
# net/core/dev.c
#   2004/10/20 16:57:03-07:00 davem@nuts.davemloft.net +14 -0
#   [NET]: Uninline netif_rx_ni().
# 
# include/linux/netdevice.h
#   2004/10/20 16:57:03-07:00 davem@nuts.davemloft.net +1 -15
#   [NET]: Uninline netif_rx_ni().
# 
diff -Nru a/include/linux/netdevice.h b/include/linux/netdevice.h
--- a/include/linux/netdevice.h	2004-10-20 16:58:28 -07:00
+++ b/include/linux/netdevice.h	2004-10-20 16:58:28 -07:00
@@ -677,6 +677,7 @@
 
 #define HAVE_NETIF_RX 1
 extern int		netif_rx(struct sk_buff *skb);
+extern int		netif_rx_ni(struct sk_buff *skb);
 #define HAVE_NETIF_RECEIVE_SKB 1
 extern int		netif_receive_skb(struct sk_buff *skb);
 extern int		dev_ioctl(unsigned int cmd, void __user *);
@@ -690,21 +691,6 @@
 extern void		dev_init(void);
 
 extern int		netdev_nit;
-
-/* Post buffer to the network code from _non interrupt_ context.
- * see net/core/dev.c for netif_rx description.
- */
-static inline int netif_rx_ni(struct sk_buff *skb)
-{
-       int err = netif_rx(skb);
-
-       preempt_disable();
-       if (softirq_pending(smp_processor_id()))
-               do_softirq();
-       preempt_enable();
-
-       return err;
-}
 
 /* Called by rtnetlink.c:rtnl_unlock() */
 extern void netdev_run_todo(void);
diff -Nru a/net/core/dev.c b/net/core/dev.c
--- a/net/core/dev.c	2004-10-20 16:58:28 -07:00
+++ b/net/core/dev.c	2004-10-20 16:58:28 -07:00
@@ -1587,6 +1587,20 @@
 	return NET_RX_DROP;
 }
 
+int netif_rx_ni(struct sk_buff *skb)
+{
+       int err = netif_rx(skb);
+
+       preempt_disable();
+       if (softirq_pending(smp_processor_id()))
+               do_softirq();
+       preempt_enable();
+
+       return err;
+}
+
+EXPORT_SYMBOL(netif_rx_ni);
+
 static __inline__ void skb_bond(struct sk_buff *skb)
 {
 	struct net_device *dev = skb->dev;

  reply	other threads:[~2004-10-21  0:15 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2004-10-21  0:35                     ` Herbert Xu
2004-10-21  4:58                       ` David S. Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041020171508.0e947d08.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=akpm@osdl.org \
    --cc=alain@parkautomat.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=irda-users@lists.sourceforge.net \
    --cc=linux-kernel@gondor.apana.org.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maxk@qualcomm.com \
    --cc=netdev@oss.sgi.com \
    --cc=rlrevell@joe-job.com \
    --cc=vda@port.imtp.ilyichevsk.odessa.ua \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).