From owner-freebsd-net Tue Jun 4 11:44:56 2002 Delivered-To: freebsd-net@freebsd.org Received: from iguana.icir.org (iguana.icir.org [192.150.187.36]) by hub.freebsd.org (Postfix) with ESMTP id CB07137B403 for ; Tue, 4 Jun 2002 11:44:52 -0700 (PDT) Received: (from rizzo@localhost) by iguana.icir.org (8.11.6/8.11.3) id g54IipB89833; Tue, 4 Jun 2002 11:44:51 -0700 (PDT) (envelope-from rizzo) Date: Tue, 4 Jun 2002 11:44:51 -0700 From: Luigi Rizzo To: Lars Eggert Cc: net@FreeBSD.ORG Subject: Re: Dummynet WFQ Message-ID: <20020604114451.A89759@iguana.icir.org> References: <3CFB9BC4.9080506@isi.edu> <20020603122913.A78688@iguana.icir.org> <3CFCE101.3040108@isi.edu> <3CFCE1CF.2070001@isi.edu> <20020604090719.A88701@iguana.icir.org> <3CFCE935.8090603@isi.edu> <20020604092547.B88852@iguana.icir.org> <3CFCEF1A.8090807@isi.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <3CFCEF1A.8090807@isi.edu>; from larse@ISI.EDU on Tue, Jun 04, 2002 at 09:47:22AM -0700 Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Tue, Jun 04, 2002 at 09:47:22AM -0700, Lars Eggert wrote: > Luigi Rizzo wrote: > >>> BTW if you use polling, you have to be careful in the place > >>> where you put the call to if_tx_rdy() to make sure that it > >>> catches the tx queue becoming empty only once and not at every > >>> polling cycle. > >> > >> How about at the very end of sis_intr(), as a new "else" branch of > >> the queue length check, like this: > > > > except that sis_intr is never called when you use polling :( > > Doh. You're right, of course. > > A new "else" branch of the corresponding "if" in sis_poll() would fire > on each poll while the queue is empty, so I guess I'll put the call at > the end of the "while" loop in sis_txeof(), after the mbuf is freed. and _if_ the mbuf is freed. In any case it is more a matter of efficiency than of correctness. Even if you call repeatedly if_tx_rdy() when the device queue is empty (and the pipe is idle, otherwise at the first occurrence it will transmit a packet making the transmit queue not empty anymore) the pipe will not 'accumulate' credits. cheers luigi To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message