All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [virtio] qemu vs vhost virtqueue consumer
@ 2015-04-07  8:10 Catalin Vasile
  2015-04-07  8:51 ` Greg Kurz
  0 siblings, 1 reply; 3+ messages in thread
From: Catalin Vasile @ 2015-04-07  8:10 UTC (permalink / raw)
  To: qemu-devel

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?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [virtio] qemu vs vhost virtqueue consumer
  2015-04-07  8:10 [Qemu-devel] [virtio] qemu vs vhost virtqueue consumer Catalin Vasile
@ 2015-04-07  8:51 ` Greg Kurz
  2015-04-07  8:53   ` Catalin Vasile
  0 siblings, 1 reply; 3+ messages in thread
From: Greg Kurz @ 2015-04-07  8:51 UTC (permalink / raw)
  To: Catalin Vasile; +Cc: qemu-devel

On Tue, 7 Apr 2015 11:10:07 +0300
Catalin Vasile <catalinvasile92@gmail.com> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [virtio] qemu vs vhost virtqueue consumer
  2015-04-07  8:51 ` Greg Kurz
@ 2015-04-07  8:53   ` Catalin Vasile
  0 siblings, 0 replies; 3+ messages in thread
From: Catalin Vasile @ 2015-04-07  8:53 UTC (permalink / raw)
  To: Greg Kurz; +Cc: qemu-devel

Awesome.
Thanks

On Tue, Apr 7, 2015 at 11:51 AM, Greg Kurz <gkurz@linux.vnet.ibm.com> wrote:
> On Tue, 7 Apr 2015 11:10:07 +0300
> Catalin Vasile <catalinvasile92@gmail.com> 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
>
>
>
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-04-07  8:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-07  8:10 [Qemu-devel] [virtio] qemu vs vhost virtqueue consumer Catalin Vasile
2015-04-07  8:51 ` Greg Kurz
2015-04-07  8:53   ` Catalin Vasile

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.