From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51980) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YfPEI-0004vW-TS for qemu-devel@nongnu.org; Tue, 07 Apr 2015 04:51:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YfPEF-000812-AV for qemu-devel@nongnu.org; Tue, 07 Apr 2015 04:51:30 -0400 Received: from e06smtp14.uk.ibm.com ([195.75.94.110]:53625) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YfPEF-00080i-0N for qemu-devel@nongnu.org; Tue, 07 Apr 2015 04:51:27 -0400 Received: from /spool/local by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 7 Apr 2015 09:51:25 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 8CC051B0805F for ; Tue, 7 Apr 2015 09:51:53 +0100 (BST) Received: from d06av09.portsmouth.uk.ibm.com (d06av09.portsmouth.uk.ibm.com [9.149.37.250]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t378pM3C1507804 for ; Tue, 7 Apr 2015 08:51:22 GMT Received: from d06av09.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av09.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t378pMeV005506 for ; Tue, 7 Apr 2015 02:51:22 -0600 Date: Tue, 7 Apr 2015 10:51:17 +0200 From: Greg Kurz Message-ID: <20150407105117.73cff6ef@bahia.local> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [virtio] qemu vs vhost virtqueue consumer List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Catalin Vasile Cc: qemu-devel@nongnu.org On Tue, 7 Apr 2015 11:10:07 +0300 Catalin Vasile wrote: > I am using the virtio-net vhost-net model to make another virtio/vhost solution. > I can't seem to find how does one make a virtqueue to only be consumed > by vhost when adding notifiers to vhost. > virtio_add_queue() seems to always ask for a valid handle for qemu, > and I don't see any disable function primitives called in either vhost > or virtio part in qemu. > I then thought the qemu part checks a flag every time a message > appears, and it stops it from popping data from the virtqueue, but I > don't see that either. > How does the virtio/vhost-net solution make sure qemu doesn't consume > data from a virtqueue destined for vhost? > The idea behind vhost is we want to avoid QEMU to be involved when data is being copied to/from the guest: "adding notifiers to vhost" basically means that MMIO will be redirected to vhost instead of QEMU. In other words, QEMU cannot consume data because it is simply not notified at all in this case. Cheers. -- Greg