| To: | hadi@xxxxxxxxxx |
|---|---|
| Subject: | Re: reminder to netdriver authors |
| From: | Jeff Garzik <jgarzik@xxxxxxxxx> |
| Date: | Sun, 04 Jul 2004 11:05:21 -0400 |
| Cc: | netdev@xxxxxxxxxxx |
| In-reply-to: | <1088910801.1041.818.camel@xxxxxxxxxxxxxxxx> |
| References: | <1088910801.1041.818.camel@xxxxxxxxxxxxxxxx> |
| Sender: | netdev-bounce@xxxxxxxxxxx |
| User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040510 |
jamal wrote: 1) When you have no space in your DMADo NOT stash the packet in your ring a) netif_stop_queue() b) return 1 A _lot_ of drivers dont follow this rule. A good driver to copy from if you are into cutnpaste is the e1000.If you stash the packet in your ring then return 1 you are in deep doodoo friend.2) return a 0 only when you have succesfully put things on DMA. Returning 0 always is not a BadThing. Most drivers do this. It is a little less efficient at the top layer for each batch of packets sent to the driver and you end up stopping the netif at this point. 3) In case of error probably return a 1 and dont try anything funny with the skb. Dont put on your DMA or try to free it or muck with it in any way. You probably should whine if you have too many errors insequence.Someone with more time than myself can audit the drivers - I have seen these issues. FWIW some of this is related to my own lack of knowledge, long long ago, and mistakes made long ago get cut-n-pasted into the present. I will edit this email, and add it to Documentation/networking/netdevices.txt. Please (to all) consider netdevices.txt as a general text describing how to (or how not to) write net drivers. Any patches -- or even random comments you would like me to turn into patches -- are accepted. Share the knowledge!
Jeff
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: 2.6.6: IPv6 initialisation bug, Russell King |
|---|---|
| Next by Date: | Re: [PATCH] Gigabit Ethernet support for forcedeth, Pavel Machek |
| Previous by Thread: | reminder to netdriver authors, jamal |
| Next by Thread: | Re: [Prism54-devel] 2.6.7 patches, Luis R. Rodriguez |
| Indexes: | [Date] [Thread] [Top] [All Lists] |