netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@osdl.org>
To: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Cc: Jeff Garzik <jgarzik@pobox.com>, netdev@oss.sgi.com
Subject: Re: [Fwd: [RFT] NAPI for 8139too]
Date: Mon, 20 Oct 2003 08:41:47 -0700	[thread overview]
Message-ID: <20031020084147.3bb5b25c.shemminger@osdl.org> (raw)
In-Reply-To: <873cdqbt6z.fsf@devron.myhome.or.jp>

On Sat, 18 Oct 2003 21:56:20 +0900
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> wrote:

> Hi,
> 
> I also working for it (patches attached). So I have several comment.
> 
> Jeff Garzik <jgarzik@pobox.com> writes:
> 
> > +	dev->weight = 16;
> 
> just question: Is there basis for believing that this value is
> rightness?  Although I use 64, I don't have a reason for having chosen
> it at all.

I chose 16 only because that was in the sample NAPI documentation,
but it probably doesn't matter a lot unless you have multiple NIC's using
NAPI in the same machine, which is not common since this chipset seems to be used
mostly in cheap boxes.

> 
> >  	dev->stop = rtl8139_close;
> >  	dev->get_stats = rtl8139_get_stats;
> >  	dev->set_multicast_list = rtl8139_set_rx_mode;
> > @@ -1879,24 +1877,28 @@
> >  #endif
> >  }
> >  
> > -static void rtl8139_rx_interrupt (struct net_device *dev,
> > -				  struct rtl8139_private *tp, void *ioaddr)
> > +/*
> > + * NAPI poll routine.
> > + */
> > +static int rtl8139_poll(struct net_device *dev, int *budget)
> >  {
> > +	struct rtl8139_private *tp = dev->priv;
> > +	void *ioaddr = tp->mmio_addr;
> >  	unsigned char *rx_ring;
> >  	u16 cur_rx;
> > +	int rx, status;
> > +	unsigned long flags;
> >  
> > -	assert (dev != NULL);
> > -	assert (tp != NULL);
> > -	assert (ioaddr != NULL);
> > -
> > +	spin_lock_irqsave(&tp->lock, flags);
> 
> I don't think lock of interrupt related path needed here. And this
> thinks that it has a bad influence on TX path.
> 
> Instead of it, I think we need synchronize with ->tx_timeout because
> ->tx_timeout touch IntrMask.

Locking in this version is more conservative than necessary, will think about
how to do it better.


> > + rescan:
> >  	rx_ring = tp->rx_ring;
> >  	cur_rx = tp->cur_rx;
> > -
> [...]
> >  			RTL_W16_F (IntrStatus, RxAckBits);
> > +
> > +		if (++rx >= dev->quota)
> 
> Shouldn't we use "min(dev->quota, *budget)" for this limit? Users can
> change "budget" via sysctl.

Once again, this not what the documentation, or some other drivers do.

> 
> > +	/* If received interrupt, then disable furthur interrupts
> > +	 * and enable NAPI polling.
> > +	 */
> > +	if (netif_running (dev) && (status & RxAckBits)) {
> > +		/* disable more receive interrupts */
> > +		RTL_W16 (IntrMask, rtl8139_intr_mask & ~RxAckBits);
> > +		netif_rx_schedule(dev);
> > +	}
> 
> This style have problem on shutdowning interface path. Please see
> 8139too-napi-stop-fix.patch.
> 
> Thanks.
> -- 
> OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
> 
> 

  reply	other threads:[~2003-10-20 15:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3F9070B6.9090306@pobox.com>
2003-10-18 12:56 ` [Fwd: [RFT] NAPI for 8139too] OGAWA Hirofumi
2003-10-20 15:41   ` Stephen Hemminger [this message]
2003-10-20 20:11   ` [RFT] merged 8139too NAPI Stephen Hemminger
2003-10-21 13:35     ` OGAWA Hirofumi
2003-10-28 19:47       ` [PATCH] Updated 8139too with NAPI Stephen Hemminger
2003-10-29 19:34         ` Jeff Garzik
2003-10-30 17:12           ` OGAWA Hirofumi
     [not found]             ` <20031030104943.20b61af0.shemminger@osdl.org>
     [not found]               ` <87ekwu9tn4.fsf@devron.myhome.or.jp>
2003-11-11 22:31                 ` Stephen Hemminger
2003-11-12  0:20                   ` Jeff Garzik
2003-11-12 15:41                   ` OGAWA Hirofumi
2003-11-12 16:01                     ` 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=20031020084147.3bb5b25c.shemminger@osdl.org \
    --to=shemminger@osdl.org \
    --cc=hirofumi@mail.parknet.co.jp \
    --cc=jgarzik@pobox.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).