From: Stephen Hemminger <shemminger@vyatta.com>
To: Joe Perches <joe@perches.com>
Cc: Tom Herbert <therbert@google.com>,
netdev@vger.kernel.org, aabdulla@nvidia.com, davem@davemloft.net
Subject: Re: [PATCH] forcedeth: Stay in NAPI as long as there's work
Date: Wed, 28 Apr 2010 11:13:54 -0700 [thread overview]
Message-ID: <20100428111354.49a6ec1a@nehalam> (raw)
In-Reply-To: <1272477251.18228.36.camel@Joe-Laptop.home>
On Wed, 28 Apr 2010 10:54:11 -0700
Joe Perches <joe@perches.com> wrote:
> On Tue, 2010-04-27 at 23:36 -0700, Tom Herbert wrote:
> > Add loop in NAPI poll routine to keep processing RX and TX as long as
> > there is more work to do. This is similar to what tg3 and some other
> > drivers do.
> > Signed-off-by: Tom Herbert <therbert@google.com>
> > ---
> > diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
> > index a1c0e7b..1e4de7b 100644
> > --- a/drivers/net/forcedeth.c
> > +++ b/drivers/net/forcedeth.c
> > @@ -3736,6 +3736,23 @@ static irqreturn_t nv_nic_irq_tx(int foo, void *data)
> > }
> >
> > #ifdef CONFIG_FORCEDETH_NAPI
> > +static inline int nv_has_work(struct fe_priv *np)
> > +{
> > + if (nv_optimized(np)) {
> > + return (
> > + ((np->get_rx.ex != np->put_rx.ex) &&
> > + !(le32_to_cpu(np->get_rx.ex->flaglen) & NV_RX2_AVAIL)) ||
> > + ((np->get_tx.ex != np->put_tx.ex) &&
> > + !(le32_to_cpu(np->get_tx.ex->flaglen) & NV_TX_VALID)));
> > + } else {
> > + return (
> > + ((np->get_rx.orig != np->put_rx.orig) &&
> > + !(le32_to_cpu(np->get_rx.orig->flaglen) & NV_RX_AVAIL)) ||
> > + ((np->get_tx.orig != np->put_tx.orig) &&
> > + !(le32_to_cpu(np->get_tx.orig->flaglen) & NV_TX_VALID)));
> > + }
> > +}
Why than adding another check step, why not just keep going until
rx_done returns 0?
next prev parent reply other threads:[~2010-04-28 18:14 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-28 6:36 [PATCH] forcedeth: Stay in NAPI as long as there's work Tom Herbert
2010-04-28 17:54 ` Joe Perches
2010-04-28 18:07 ` Tom Herbert
2010-04-28 18:18 ` Tom Herbert
2010-04-28 18:13 ` Stephen Hemminger [this message]
2010-04-28 18:25 ` Stephen Hemminger
2010-04-28 21:25 ` David Miller
2010-04-28 23:56 ` Tom Herbert
2010-04-30 23:17 ` David Miller
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=20100428111354.49a6ec1a@nehalam \
--to=shemminger@vyatta.com \
--cc=aabdulla@nvidia.com \
--cc=davem@davemloft.net \
--cc=joe@perches.com \
--cc=netdev@vger.kernel.org \
--cc=therbert@google.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).