| To: | "Jeff Garzik" <jgarzik@xxxxxxxxx>, <raghavendra.koushik@xxxxxxxxx> |
|---|---|
| Subject: | RE: Submission #3 for S2io 10GbE driver |
| From: | "Feldman, Scott" <scott.feldman@xxxxxxxxx> |
| Date: | Tue, 2 Mar 2004 13:16:33 -0800 |
| Cc: | <leonid.grossman@xxxxxxxx>, <netdev@xxxxxxxxxxx>, <shemminger@xxxxxxxx>, <hch@xxxxxxxxxxxxx>, <ravinandan.arakali@xxxxxxxx>, <raghavendra.koushik@xxxxxxxx> |
| Sender: | netdev-bounce@xxxxxxxxxxx |
| Thread-index: | AcQAhvva3gJRrh/5Tx6Fvh3gg2fA7wABFdSA |
| Thread-topic: | Submission #3 for S2io 10GbE driver |
> 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.
But tg3 checks this case also and returns 1:
/* This is a hard error, log it. */
if (unlikely(TX_BUFFS_AVAIL(tp) <= (skb_shinfo(skb)->nr_frags +
1))) {
netif_stop_queue(dev);
...
return 1;
}
Does this code path happen?
Using tg3 for reference, can we say this is the ideal model?
dev->hard_start
if(!space_avail)
stop_queue
return 1;
queue skb
if(!space_avail)
stop_queue
return 0;
tx_clean
if(queue_stopped && space_avail)
wake_queue
-scott
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: [janitor] remove casts in drivers/net/arm/, Jeff Garzik |
|---|---|
| Next by Date: | Re: Submission #3 for S2io 10GbE driver, Jeff Garzik |
| Previous by Thread: | Re: Submission #3 for S2io 10GbE driver, Jeff Garzik |
| Next by Thread: | Re: Submission #3 for S2io 10GbE driver, Jeff Garzik |
| Indexes: | [Date] [Thread] [Top] [All Lists] |