From: Damjan Marion Date: Thu, 13 Oct 2016 08:02:19 +0000 (+0200) Subject: vhost-user: Add reconnect support X-Git-Tag: v17.01-rc0~93 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=10eb1ea468496807432734814f264139fe3299dc;p=vpp.git vhost-user: Add reconnect support QEMU 2.7 introduces reconnect support. However it doesn't send last state of last_avail_idx in the SET_VRING_BASE. With this patch we are overriding SET_VRING_BASE with value taken from used->idx. It is a bit hackish as it basically overrides SET_VRING_BASE provided value but it should work in most of the cases. This is what author of reconnect code is also suggesting in his post: https://lists.gnu.org/archive/html/qemu-devel/2016-06/msg01495.html Change-Id: I10e5f401c409d2989bf6c43eaea377800a9c76df Signed-off-by: Damjan Marion --- diff --git a/vnet/vnet/devices/virtio/vhost-user.c b/vnet/vnet/devices/virtio/vhost-user.c index 9b0db749ee9..a3dacd13b42 100644 --- a/vnet/vnet/devices/virtio/vhost-user.c +++ b/vnet/vnet/devices/virtio/vhost-user.c @@ -588,6 +588,7 @@ vhost_user_socket_read (unix_file_t * uf) } vui->vrings[msg.state.index].last_used_idx = + vui->vrings[msg.state.index].last_avail_idx = vui->vrings[msg.state.index].used->idx; /* tell driver that we don't want interrupts */