lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100428111354.49a6ec1a@nehalam>
Date:	Wed, 28 Apr 2010 11:13:54 -0700
From:	Stephen Hemminger <shemminger@...tta.com>
To:	Joe Perches <joe@...ches.com>
Cc:	Tom Herbert <therbert@...gle.com>, netdev@...r.kernel.org,
	aabdulla@...dia.com, davem@...emloft.net
Subject: Re: [PATCH] forcedeth: Stay in NAPI as long as there's work

On Wed, 28 Apr 2010 10:54:11 -0700
Joe Perches <joe@...ches.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@...gle.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?

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ