netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@pobox.com>
To: raghavendra.koushik@wipro.com
Cc: leonid.grossman@s2io.com, netdev@oss.sgi.com,
	shemminger@osdl.org, hch@infradead.org,
	ravinandan.arakali@s2io.com, raghavendra.koushik@s2io.com
Subject: Re: Submission #3  for S2io 10GbE driver
Date: Tue, 02 Mar 2004 13:47:09 -0500	[thread overview]
Message-ID: <4044D6AD.9090209@pobox.com> (raw)
In-Reply-To: <4223A04BF7D1B941A25246ADD0462FF50115AFCF@blr-m3-msg.wipro.com>

raghavendra.koushik@wipro.com wrote:
> Hi Jeff,
> 
> 	Really sorry about that "confidentiality notice" that gets attached.
> I have asked my sysAdmin to get rid of it. He has promised to do so ASAP.
> Hope this mail does not have it attached at the end :-). If at all the
> message still persists please ignore it as inconsequential to our discussion.
> 
> I Have a few more questions.
> 
> 
>>>4) just delete the SET_NETDEV_DEV(), FREE_NETDEV, and IRQ_NONE
>>>compatibility defines.  these are in 2.4 just like 2.6.
> 
> 
> Not all 2.4 kernels have them yet right? but since this driver is going

Correct.  But when I merge this driver into 2.4, it will be latest 2.4 
(which contains these definitions).

The vendor (s2io) is expected to maintain any old-kernel compatibility 
outside the kernel.  For example, if you submitting the s2io driver for 
inclusion in my employer's product, Red Hat Enterprise Linux, then you 
would submit with the compatibility gunk.


> into 2.6 kernel if you want all these backward compatibility macros eliminated
> I can do that.

Yes, please.


>>>13) in s2io_xmit, kfree the skb (drop it) if you don't have enough free
>>>space to queue it.  this is normally a BUG condition, since proper use
>>>of netif_{start,stop,wake}_queue() will guarantee that s2io_xmit will
>>>only be called when there is free space to queue another skb.
> 
> 
> On returning error (non zero) from s2io_xmit, I think the calling function frees
> the skb.

Not correct in all cases, this is why the driver should drop the skb and 
free it.  Several existing drivers get this wrong, in fact :/


> How s2io_xmit works is when I get a packet for Tx and I find that all the
> Tx descriptors are owned by the NIC, I stop the queue and return error.
> So I wouldn't know before hand whether free queue space is available or not.

This is incorrect, and definitely an issue that needs to be addressed.

As I said, the model is, the driver calls netif_stop_queue() after 
queueing a packet, when it knows there is no more room for a full 
packet.  The tg3 driver does it like this:
	
	...queue an skb to hardware...
         if (TX_BUFFS_AVAIL(tp) <= (MAX_SKB_FRAGS + 1))
                 netif_stop_queue(dev);

Therefore you guarantee the queue is stopped until you are 100% certain 
that another skb (up to MAX_SKB_FRAGS + "main frag" fragments) may be 
queued to hardware.

You do -not- want to figure out "after the fact" that you cannot queue 
the skb you were just passed.

	Jeff

  reply	other threads:[~2004-03-02 18:47 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-02 13:46 Submission #3 for S2io 10GbE driver raghavendra.koushik
2004-03-02 18:47 ` Jeff Garzik [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-03-02 21:47 Feldman, Scott
2004-03-02 22:21 ` Ben Greear
2004-03-02 21:16 Feldman, Scott
2004-03-02 21:21 ` Jeff Garzik
2004-03-02 21:33   ` Ben Greear
2004-03-02 21:38     ` Jeff Garzik
2004-03-01 13:05 raghavendra.koushik
2004-03-01 15:24 ` Leonid Grossman
2004-03-01  6:21 raghavendra.koushik
2004-03-01  6:53 ` Jeff Garzik
2004-02-17  0:11 Submission " Christoph Hellwig
2004-02-28 15:08 ` Submission #3 " Leonid Grossman
2004-02-28 20:21   ` Jeff Garzik
2004-03-12 21:55     ` ravinandan arakali
2004-03-13  2:30       ` Jeff Garzik

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=4044D6AD.9090209@pobox.com \
    --to=jgarzik@pobox.com \
    --cc=hch@infradead.org \
    --cc=leonid.grossman@s2io.com \
    --cc=netdev@oss.sgi.com \
    --cc=raghavendra.koushik@s2io.com \
    --cc=raghavendra.koushik@wipro.com \
    --cc=ravinandan.arakali@s2io.com \
    --cc=shemminger@osdl.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).