From: Jeff Garzik <jgarzik@pobox.com>
To: jamal <hadi@cyberus.ca>
Cc: Andy Fleming <afleming@freescale.com>,
Kumar Gala <kumar.gala@freescale.com>,
netdev@oss.sgi.com, dwmw2@infradead.org
Subject: Re: [RFR] gianfar ethernet driver
Date: Tue, 6 Jul 2004 23:29:13 -0400 [thread overview]
Message-ID: <20040707032913.GA1822@havoc.gtf.org> (raw)
In-Reply-To: <1089170282.1038.80.camel@jzny.localdomain>
On Tue, Jul 06, 2004 at 11:18:02PM -0400, jamal wrote:
> You dont return a 1 anywhere.
That OK in one model.
> Heres what i mean (substitute your code):
> if no more descriptors
> netif_stop_queue(dev)
> unlock
> return 1
> process packet and stash on ring
> return 0
When you are not dealing with fragments, the most optimal model
eliminates the overflow case completely, so your ->hard_start_xmit looks
like
lock
queue packet to DMA ring
if (DMA ring full)
netif_stop_queue()
unlock
return 0
If you can be sure -- by design -- that room is always available when
the queue is not stopped, then that's fine.
With fragments, you cannot be sure of this, if you do not wish to
reserve MY_HW_MAX_FRAGMENTS slots on the DMA. Such a case would require
moving the "if no more descriptors" check up, and returning 1 when the
ring is empty.
But ideally, you should write the driver where such a condition does not
occur at all.
Jeff
next prev parent reply other threads:[~2004-07-07 3:29 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <C681B01E-CEA9-11D8-931F-000393DBC2E8@freescale.com>
[not found] ` <89563A5C-CFAE-11D8-BA44-000393C30512@freescale.com>
2004-07-07 3:18 ` [RFR] gianfar ethernet driver jamal
2004-07-07 3:29 ` Jeff Garzik [this message]
2004-07-07 3:41 ` jamal
2004-07-07 5:35 ` Jeff Garzik
2004-07-07 18:29 ` jamal
[not found] ` <40EDC7A7.8060906@pobox.com>
2004-07-08 23:08 ` jamal
2004-07-21 19:51 ` Andy Fleming
2004-07-21 20:14 ` David Woodhouse
2004-08-02 22:19 ` Andy Fleming
2004-08-02 23:11 ` Jeff Garzik
2004-08-02 23:25 ` Andy Fleming
2004-08-04 23:02 ` Andy Fleming
2004-08-16 16:31 ` Kumar Gala
2004-08-22 21:03 ` Jeff Garzik
2004-07-07 5:27 ` Jeff Garzik
[not found] ` <D3458628-D05D-11D8-BA44-000393C30512@freescale.com>
2004-07-08 22:29 ` Jeff Garzik
[not found] ` <944A2374-D137-11D8-8835-000393C30512@freescale.com>
2004-07-09 1:32 ` jamal
2004-07-09 1:42 ` jamal
2004-07-26 22:06 ` Andy Fleming
2004-07-26 22:10 ` Jeff Garzik
2004-08-02 13:59 ` Kumar Gala
2004-08-02 14:09 ` Christoph Hellwig
2004-08-02 14:11 ` Kumar Gala
[not found] ` <2A724364-D53A-11D8-8835-000393C30512@freescale.com>
[not found] ` <40F4A6E5.4060000@pobox.com>
2004-07-19 23:29 ` Andy Fleming
2004-07-20 1:13 ` David Woodhouse
[not found] <8F52CF1D-C916-11D8-BB6A-000393DBC2E8@freescale.com>
2004-07-05 17:28 ` Jeff Garzik
2004-07-06 2:38 ` jamal
[not found] ` <20040708231131.GA20305@infradead.org>
2004-07-08 23:25 ` Jeff Garzik
2004-07-08 23:35 ` Christoph Hellwig
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=20040707032913.GA1822@havoc.gtf.org \
--to=jgarzik@pobox.com \
--cc=afleming@freescale.com \
--cc=dwmw2@infradead.org \
--cc=hadi@cyberus.ca \
--cc=kumar.gala@freescale.com \
--cc=netdev@oss.sgi.com \
/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).