Subject: Re: RFC: NAPI packet weighting patch

From: Edgar E Iglesias <[email-masked]>
Date: Fri, 3 Jun 2005 23:07:01 +0200

On Fri, Jun 03, 2005 at 10:59:45PM +0200, Lennert Buytenhek wrote:
> 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.)
> 
> 
> --L

Maybe it would be better to put a fixed weight at this level, return
the descriptors to the HW after every X packets. That way you
can keep the NAPI weight at 64 (or what ever) and still give back 
descriptors to HW more often.

Best regards
-- 
        Programmer
        Edgar E Iglesias <[email-masked]> 46.46.272.1946