From: Rusty Russell Subject: Re: question on virtio Date: Thu, 6 May 2010 11:02:41 +0930 Message-ID: <201005061102.42306.rusty@rustcorp.com.au> References: <20100505110947.GA27872@redhat.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Cc: virtualization@lists.linux-foundation.org, Anthony Liguori , qemu-devel@nongnu.org, kvm@vger.kernel.org To: "Michael S. Tsirkin" Return-path: Received: from ozlabs.org ([203.10.76.45]:42535 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752217Ab0EFBcr (ORCPT ); Wed, 5 May 2010 21:32:47 -0400 In-Reply-To: <20100505110947.GA27872@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, 5 May 2010 08:39:47 pm Michael S. Tsirkin wrote: > Hi! > I see this in virtio_ring.c: > > /* Put entry in available array (but don't update avail->idx * > until they do sync). */ > > Why is it done this way? > It seems that updating the index straight away would be simpler, while > this might allow the host to specilatively look up the buffer and handle > it, without waiting for the kick. I agree. From my TODO: what if we actually expose in ->add_buf? I don't *think* anyone adds buffers without being ready for them to be used, so changing this should be safe. Want to give it a try and report back? Thanks! Rusty.