From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MaasM-0000vi-RD for qemu-devel@nongnu.org; Mon, 10 Aug 2009 15:49:46 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MaasI-0000sL-DC for qemu-devel@nongnu.org; Mon, 10 Aug 2009 15:49:46 -0400 Received: from [199.232.76.173] (port=54851 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MaasI-0000sI-8J for qemu-devel@nongnu.org; Mon, 10 Aug 2009 15:49:42 -0400 Received: from mx2.redhat.com ([66.187.237.31]:47324) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MaasG-00089T-IY for qemu-devel@nongnu.org; Mon, 10 Aug 2009 15:49:41 -0400 Date: Mon, 10 Aug 2009 22:47:53 +0300 From: "Michael S. Tsirkin" Subject: Re: [Qemu-devel] Re: [PATCH] qemu/virtio: move features to an inline function Message-ID: <20090810194753.GA16803@redhat.com> References: <20090810192809.GA16800@redhat.com> <4A8076F0.5050700@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4A8076F0.5050700@codemonkey.ws> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: rusty@rustcorp.com.au, qemu-devel@nongnu.org, virtualization@lists.linux-foundation.org On Mon, Aug 10, 2009 at 02:37:20PM -0500, Anthony Liguori wrote: > Michael S. Tsirkin wrote: >> devices should have the final say over which virtio features they >> support. E.g. indirect entries may or may not make sense in the context >> of virtio-console. Move the common bits from virtio-pci to an inline >> function and let each device call it. >> > > What drove this in vhost? vhost does not support indirect ring entries and notify on empty yet. > Normally, the common features are transport features and the devices > should have absolutely no knowledge of transport feature (since they're > transport dependent). Good point. But 1. note that with my patch they don't. They call virtio_get_common_features and that's all. 2. some features may not make sense for some devices. For example, it is quite possible that indirect ring entries feature improves performance on block but hurts on net, as net has a similar merged buffers feature. Someone should try benchmarking with it disabled, and it becomes possible with my patch. > IOW, VIRTIO_RING_F_INDIRECT_DESC is meaningless to virtio-console > because virtio-console has no idea what the ring implementation is that > it sits on top of. At some level. Same can be said to be true for virtio-pci: it sits below the ring implementation. However, it is not *completely* meaningless: some devices may benefit from indirect entries, others may not, or may benefit from disabling them. > Regards, > > Anthony Liguori >