From: Prerna Saxena <saxenap.ltc@gmail.com>
To: qemu-devel@nongnu.org
Cc: felipe@nutanix.com, anilkumar.boggarapu@nutanix.com,
mst@redhat.com, marcandre.lureau@gmail.com,
Prerna Saxena <prerna.saxena@nutanix.com>
Subject: [Qemu-devel] [PATCH v3 0/2] vhost-user: Extend protocol to receive replies on any command.
Date: Wed, 6 Jul 2016 23:34:47 -0700 [thread overview]
Message-ID: <1467873289-14220-1-git-send-email-saxenap.ltc@gmail.com> (raw)
From: Prerna Saxena <prerna.saxena@nutanix.com>
The current vhost-user protocol requires the client to send responses to only a
few commands. For the remaining commands, it is impossible for QEMU to know the
status of the requested operation -- ie, did it succeed? If so, by what time?
This is inconvenient, and can also lead to races. As an example:
(1) Qemu sends a SET_MEM_TABLE to the backend (eg, a vhost-user net application).Note that SET_MEM_TABLE does not require a reply according to the spec.
(2) Qemu commits the memory to the guest.
(3) Guest issues an I/O operation over a new memory region which was configured on (1).
(4) The application hasn't yet remapped the memory, but it sees the I/O request.
(5) The application cannot satisfy the request because it does not know about those GPAs.
Note that the kernel implementation does not suffer from this limitation since messages are sent via an ioctl(). The ioctl() blocks until the backend (eg. vhost-net) completes the command and returns (with an error code).
Changing the behaviour of current vhost-user commands would break existing applications.
Patch 1 introduces a protocol extension, VHOST_USER_PROTOCOL_F_REPLY_ACK. This feature, if negotiated, allows QEMU to request a response to any message by setting the newly introduced "need_response" flag. The application must then respond to qemu by providing a status about the requested operation.
Patch 2 adds a workaround for the race described above for clients that do not support REPLY_ACK
feature. it introduces a get_features command to be sent before returning from set_mem_table. While this is not a complete fix, it will help client applications that strictly process messagesin order.
Changelog:
----------
Changes v2->v3:
1) Swapped the patch numbers 1 & 2 from the previous series.
2) Patch 1 (previously patch 2 in v2): addresses MarcAndre's review comments and renames function 'process_message_response' to 'process_message_reply'
3) Patch 2 (ie patch 1 in v2) : Unchanged from v2.
Changes v1->v2:
1) Patch 1 : Ask for get_features before returning from set_mem_table(new).
2) Patch 2 : * Improve documentation.
* Abstract out commonly used operations in the form of a function, process_message_response(). Also implement this only for SET_MEM_TABLE.
References:
v1 : https://lists.gnu.org/archive/html/qemu-devel/2016-06/msg07152.html
v2 : https://lists.gnu.org/archive/html/qemu-devel/2016-07/msg00048.html
Prerna Saxena (2):
vhost-user: Introduce a new protocol feature REPLY_ACK.
vhost-user: Attempt to fix a race with set_mem_table.
docs/specs/vhost-user.txt | 44 +++++++++++++++
hw/virtio/vhost-user.c | 133 ++++++++++++++++++++++++++++++----------------
2 files changed, 130 insertions(+), 47 deletions(-)
--
1.8.1.2
next reply other threads:[~2016-07-07 6:35 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-07 6:34 Prerna Saxena [this message]
2016-07-07 6:34 ` [Qemu-devel] [PATCH v3 1/2] vhost-user: Introduce a new protocol feature REPLY_ACK Prerna Saxena
2016-07-07 6:34 ` [Qemu-devel] [PATCH v3 2/2] vhost-user: Attempt to fix a race with set_mem_table Prerna Saxena
2016-07-25 6:41 ` [Qemu-devel] [PATCH v3 0/2] vhost-user: Extend protocol to receive replies on any command Prerna
2016-07-25 10:27 ` Marc-André Lureau
2016-07-25 10:34 ` Prerna Saxena
2016-07-27 4:21 ` Michael S. Tsirkin
2016-07-27 10:00 ` Prerna Saxena
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=1467873289-14220-1-git-send-email-saxenap.ltc@gmail.com \
--to=saxenap.ltc@gmail.com \
--cc=anilkumar.boggarapu@nutanix.com \
--cc=felipe@nutanix.com \
--cc=marcandre.lureau@gmail.com \
--cc=mst@redhat.com \
--cc=prerna.saxena@nutanix.com \
--cc=qemu-devel@nongnu.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).