netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@osdl.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: David Miller <davem@davemloft.net>, netdev@vger.kernel.org
Subject: Re: [PATCH 1/4] net: make dev_kfree_skb_irq not inline
Date: Thu, 14 Dec 2006 14:34:11 -0800	[thread overview]
Message-ID: <20061214143411.39e9f77e@freekitty> (raw)
In-Reply-To: <20061214223009.GA16356@infradead.org>

On Thu, 14 Dec 2006 22:30:09 +0000
Christoph Hellwig <hch@infradead.org> wrote:

> On Thu, Dec 14, 2006 at 12:48:15PM -0800, Stephen Hemminger wrote:
> > Move the dev_kfree_skb_irq function from netdevice.h to dev.c
> > for a couple of reasons. Primarily, I want to make softnet_data
> > local to dev.c; also this function is called 300+ places already.
> > 
> > Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
> > 
> > --- linux-2.6.20-rc1.orig/include/linux/netdevice.h
> > +++ linux-2.6.20-rc1/include/linux/netdevice.h
> > @@ -676,20 +676,7 @@ static inline int netif_running(const st
> >  /* Use this variant when it is known for sure that it
> >   * is executing from interrupt context.
> >   */
> > -static inline void dev_kfree_skb_irq(struct sk_buff *skb)
> > -{
> > -	if (atomic_dec_and_test(&skb->users)) {
> > -		struct softnet_data *sd;
> > -		unsigned long flags;
> > -
> > -		local_irq_save(flags);
> > -		sd = &__get_cpu_var(softnet_data);
> > -		skb->next = sd->completion_queue;
> > -		sd->completion_queue = skb;
> > -		raise_softirq_irqoff(NET_TX_SOFTIRQ);
> > -		local_irq_restore(flags);
> > -	}
> > -}
> > +extern void dev_kfree_skb_irq(struct sk_buff *skb);
> 
> Maybe you should only move the slowpath out of line ala:
> 
> static inline void dev_kfree_skb_irq(struct sk_buff *skb)
> {
> 	if (atomic_dec_and_test(&skb->users)) 
> 		__dev_kfree_skb_irq(skb);
> }
> 

We could but for routing or other cases where buffer isn't cloned
it goes through the test.

-- 
Stephen Hemminger <shemminger@osdl.org>

  reply	other threads:[~2006-12-14 22:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-14 20:48 [PATCH 0/4] network device interface cleanups Stephen Hemminger
2006-12-14 20:48 ` [PATCH 1/4] net: make dev_kfree_skb_irq not inline Stephen Hemminger
2006-12-14 22:30   ` Christoph Hellwig
2006-12-14 22:34     ` Stephen Hemminger [this message]
2006-12-14 23:00     ` David Miller
2006-12-14 20:48 ` [PATCH 2/4] net: uninline netif_rx_reschedule Stephen Hemminger
2006-12-14 20:48 ` [PATCH 3/4] net: move softnet_data Stephen Hemminger
2006-12-20 18:39   ` David Miller
2006-12-14 20:48 ` [PATCH 4/4] net: rearrange functions in netdevice.h Stephen Hemminger

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=20061214143411.39e9f77e@freekitty \
    --to=shemminger@osdl.org \
    --cc=davem@davemloft.net \
    --cc=hch@infradead.org \
    --cc=netdev@vger.kernel.org \
    /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).