[Top] [All Lists]

Re: RFC: NAPI packet weighting patch

To: Michael Chan <mchan@xxxxxxxxxxxx>
Subject: Re: RFC: NAPI packet weighting patch
From: Lennert Buytenhek <buytenh@xxxxxxxxxxxxxx>
Date: Fri, 3 Jun 2005 22:59:45 +0200
Cc: "David S. Miller" <davem@xxxxxxxxxxxxx>, mitch.a.williams@xxxxxxxxx, hadi@xxxxxxxxxx, john.ronciak@xxxxxxxxx, jdmason@xxxxxxxxxx, shemminger@xxxxxxxx, netdev@xxxxxxxxxxx, Robert.Olsson@xxxxxxxxxxx, ganesh.venkatesan@xxxxxxxxx, jesse.brandeburg@xxxxxxxxx
In-reply-to: <1117828169.4430.29.camel@rh4>
References: <20050603.120126.41874584.davem@xxxxxxxxxxxxx> <Pine.CYG.4.58.0506031202280.3344@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> <20050603.132257.23013342.davem@xxxxxxxxxxxxx> <20050603.132922.63997492.davem@xxxxxxxxxxxxx> <1117828169.4430.29.camel@rh4>
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mutt/1.4.1i
On Fri, Jun 03, 2005 at 12:49:29PM -0700, Michael Chan wrote:

> > E1000 processes the full QUOTA of RX packets,
> > _THEN_ replenishes with new RX buffers.  No wonder
> > the chip runs out of RX descriptors.
> > 
> > You should replenish _AS_ you grab RX packets
> > off the receive queue, just as tg3 does.
> Yes, in tg3, rx buffers are replenished and put back into the ring
> as completed packets are taken off the ring. But we don't tell the
> chip about these new buffers until we get to the end of the loop,
> potentially after a full quota of packets.

Which makes a lot more sense, since you'd rather do one MMIO write
at the end of the loop than one per iteration, especially if your
MMIO read (flush) latency is high.  (Any subsequent MMIO read will
have to flush out all pending writes, which'll be slow if there's
a lot of writes still in the queue.)


<Prev in Thread] Current Thread [Next in Thread>