From: Didier Pallard <didier.pallard@6wind.com>
To: "qemu-devel"@nongnu.org, mst@redhat.com, pbonzini@redhat.com
Cc: thibaut.collet@6wind.com, jmg@6wind.com
Subject: Re: [Qemu-devel] Linux vhost-user interrupt management fixes
Date: Fri, 04 Dec 2015 11:04:31 +0100 [thread overview]
Message-ID: <5661652F.9060000@6wind.com> (raw)
In-Reply-To: <1449136399-4158-1-git-send-email-didier.pallard@6wind.com>
On 12/03/2015 10:53 AM, Didier Pallard wrote:
> Hi,
>
> I recently did some stress tests of a vhost-user interface using an UDP
> traffic generator. Traffic generator was connected to 2 physical ports
> that are in turn connected to 2 virtio ports through a linux bridge, VM
> (running linux) doing routing to forward packets between the 2 virtio ports.
> When traffic reaches high pps rates of small packets, I faced the 2 following
> problems:
>
> - at some time, my qemu socket becomes full, causing qemu to send incomplete
> SET_VRING_CALL messages to vhost-user backend (without proper fd set in
> ancillary data).
> - after some time, some interrupts are lost, causing the VM to stop
> transmitting packets.
>
> Both problems come from the fact that interrupt masking/unmasking of the VM
> is deferred to vhost-user backend through the linux socket.
> First problem comes from the fact that socket buffer gets full; it is corrected
> in the first patch of the serie.
> Second problem is a bit more complex. From what i understand of the code,
> when VM wants to mask/unmask interrupts, qemu traps the command and sends a
> SET_VRING_CALL to the vhost-user to swap interrupt notifications either to
> a dummy descriptor or to an fd that was given to kvm module to route
> interruption to the VM. After sending SET_VRING_CALL message through
> the socket, VM code continues to run, assuming that the interrupts are now
> masked; but due to linux socket, this message may be buffered and not currently
> treated by the vhost-user backend, ie interrupts are not really masked/unmasked
> as they ought to be.
> I think it can be solved in two different ways:
> - by waiting for an acknowledgement of vhost-user backend before exiting
> interrupt masking function, this ensures that interrupt masking is correctly
> taken into account before giving back hand to the VM, but it has a very high
> cost in term of cycles. Moreover, unless specifying a new option, it will
> break current API, since existing vhost-user implementations do not
> expect a return message on a SET_VRING_CALL call.
> - second way could be, in case vhost-user is involved, to restore the
> initial behaviour of interrupt masking (ie masking/unmasking interrupts
> by taking/giving vring_call fd from/to kernel kvm module).
> Patches 2 and 3 of the serie propose an implementation of this second option.
>
> Didier
>
> Didier Pallard (3):
> char: fix vhost-user socket full
> virtio-pci: add an option to bypass guest_notifier_mask
> vhost-net: force guest_notifier_mask bypass in vhost-user case
>
> hw/net/vhost_net.c | 19 ++++++++++++++++++-
> hw/virtio/vhost.c | 13 +++++++++++++
> hw/virtio/virtio-pci.c | 29 +++++++++++++++++++++++------
> hw/virtio/virtio-pci.h | 6 ++++++
> qemu-char.c | 10 ++++++++++
> 5 files changed, 70 insertions(+), 7 deletions(-)
>
+maintainers
sorry, i forgot them in initial mail
didier
next prev parent reply other threads:[~2015-12-04 10:04 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-03 9:53 [Qemu-devel] Linux vhost-user interrupt management fixes Didier Pallard
2015-12-03 9:53 ` [Qemu-devel] [PATCH 1/3] char: fix vhost-user socket full Didier Pallard
2015-12-07 13:31 ` Marc-André Lureau
2015-12-09 15:59 ` Victor Kaplansky
2015-12-09 17:06 ` Didier Pallard
2015-12-10 12:56 ` Victor Kaplansky
2015-12-10 15:09 ` Didier Pallard
2015-12-17 14:41 ` Victor Kaplansky
2016-02-04 13:13 ` Michael S. Tsirkin
2016-02-04 14:10 ` Michael S. Tsirkin
2016-02-08 13:12 ` Didier Pallard
2016-02-09 11:37 ` Michael S. Tsirkin
2016-02-09 11:48 ` Daniel P. Berrange
2016-02-09 12:21 ` Michael S. Tsirkin
2016-02-09 16:17 ` Didier Pallard
2016-02-09 16:50 ` Michael S. Tsirkin
2016-02-09 17:04 ` Daniel P. Berrange
2016-02-10 9:35 ` Didier Pallard
2016-02-10 11:53 ` Michael S. Tsirkin
2016-02-10 12:15 ` Daniel P. Berrange
2016-02-19 9:09 ` Didier Pallard
2015-12-03 9:53 ` [Qemu-devel] [PATCH 2/3] virtio-pci: add an option to bypass guest_notifier_mask Didier Pallard
2015-12-07 13:37 ` Marc-André Lureau
2015-12-07 13:59 ` Marc-André Lureau
2015-12-09 15:06 ` Didier Pallard
2016-02-04 13:08 ` Michael S. Tsirkin
2016-02-08 13:24 ` Didier Pallard
2016-02-15 15:38 ` Victor Kaplansky
2015-12-03 9:53 ` [Qemu-devel] [PATCH 3/3] vhost-net: force guest_notifier_mask bypass in vhost-user case Didier Pallard
2016-02-04 13:06 ` Michael S. Tsirkin
2015-12-04 10:04 ` Didier Pallard [this message]
2016-01-25 9:22 ` [Qemu-devel] Linux vhost-user interrupt management fixes Victor Kaplansky
2016-01-26 9:25 ` Didier Pallard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5661652F.9060000@6wind.com \
--to=didier.pallard@6wind.com \
--cc=jmg@6wind.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=thibaut.collet@6wind.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.