* Kernel Janitor TODO: dev_kfree_skb
@ 2006-06-23 17:35 John Daiker
2006-06-23 23:47 ` Herbert Xu
0 siblings, 1 reply; 2+ messages in thread
From: John Daiker @ 2006-06-23 17:35 UTC (permalink / raw)
To: netdev; +Cc: akpm, jgarzik
I was running through the kernel janitors TODO list
(http://janitor.kernelnewbies.org/TODO) and thought I'd try to find
something easy for my first attempt at kernel hacking/maintenance.
The "Balancing Function" header suggests that all net_device interrupt
functions should use dev_kfree_skb_irq as opposed to dev_kfree_skb.
Should we ever be calling dev_kfree_skb directly, or would the better
practice be to always call dev_kfree_skb_any (thus letting the kernel
decide to call dev_kfree_skb or dev_kfree_skb_irq)?
dev_kfree_skb_any is defined in 'net/core/dev.c:1118'
John Daiker
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Kernel Janitor TODO: dev_kfree_skb
2006-06-23 17:35 Kernel Janitor TODO: dev_kfree_skb John Daiker
@ 2006-06-23 23:47 ` Herbert Xu
0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2006-06-23 23:47 UTC (permalink / raw)
To: John Daiker; +Cc: netdev, akpm, jgarzik
John Daiker <jdaiker@osdl.org> wrote:
>
> The "Balancing Function" header suggests that all net_device interrupt
> functions should use dev_kfree_skb_irq as opposed to dev_kfree_skb.
> Should we ever be calling dev_kfree_skb directly, or would the better
> practice be to always call dev_kfree_skb_any (thus letting the kernel
> decide to call dev_kfree_skb or dev_kfree_skb_irq)?
It's best if you write code in a way so that you always know whether it's
IRQ context or not. You should only use dev_kfree_skb_any when you fail
to write code like that.
Now once you've achieved that, then the next objective is to strive to
not have to call kfree_skb in IRQ context at all. Have a look at the TG3
driver for an example where IRQ context is kept to a minimum.
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-06-23 23:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-23 17:35 Kernel Janitor TODO: dev_kfree_skb John Daiker
2006-06-23 23:47 ` Herbert Xu
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).