From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: [PATCH 4/6] virtio network driver Date: Sun, 30 Mar 2008 09:47:57 -0500 Message-ID: <47EFA81D.90802@us.ibm.com> References: <1206827760-4566-1-git-send-email-aliguori@us.ibm.com> <1206827760-4566-4-git-send-email-aliguori@us.ibm.com> <200803301127.08620.paul@codesourcery.com> Reply-To: qemu-devel@nongnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm-devel@lists.sourceforge.net, Marcelo Tosatti , qemu-devel@nongnu.org, Aurelien Jarno To: Paul Brook Return-path: In-Reply-To: <200803301127.08620.paul@codesourcery.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org Errors-To: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org List-Id: kvm.vger.kernel.org Paul Brook wrote: > On Saturday 29 March 2008, Anthony Liguori wrote: > >> + if ((elem = virtqueue_pop(n->rx_vq)) == NULL) { >> + /* wait until the guest adds some rx bufs */ >> + n->can_receive = 0; >> + return; >> + } >> > > Setting can_receive to zero *after* dropping a packet is a bit late. > Not a fatal flaw, but it does make can_receive fairly useless. The whole point > of can_receive is to workaround lack of proper TCP rate control in the slirp > code. > Yeah, I should just drop the can_receive handler. I assumed when I wrote the driver originally that can_receive queued packets. Since we have to drop packets anyway in the code now, there's no point in having a can_receive handler. Regards, Anthony Liguori > Paul >