Thread (1 message) 1 message, 1 author, 2012-03-22
  • (off-list ancestor, not in this archive)
  • Re: vhost question · Stefan Hajnoczi <hidden> · 2012-03-22

Re: vhost question

flat view

From: Stefan Hajnoczi <hidden>
Date: 2012-03-22 09:52:24
Also in: kvm, netdev

On Thu, Mar 22, 2012 at 1:48 AM, Steve Glass [off-list ref] wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Just some further information concerning my earlier question
concerning vhost and virtio.

I'm using virtio to implement an emulated mac80211 device in the
guest. A simple network simulation will be used to control delivery of
frames between guests and for this I am using the vhost approach.

A simple first-cut attempt at the tx and rx kick handlers are given
below. When the guest transmits frames the vhost's TX kick handler is
executed and copies the buffers onto a queue for the intended
recipient(s). When the vhost's RX kick handler is run it copies the
buffer from the queue and notifies the client that the buffers have
been used.

The problem is that if there are no frames in the queue when the guest
rx kick handler runs then it has to exit and I have to arrange that it
runs again. That's done in the current prototype by having the guests
poll using a timer - which is ugly and inefficient. Can I get the
vhost tx kick handler to wake the appropriate vhost rx kick handler?
How can I achieve this?
Can you queue a tx->rx kick on the vhost work queue with vhost_work_queue()?

Stefan
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help