Skip to content

Commit

Permalink
vhost: fix silent queue enabling with legacy guests
Browse files Browse the repository at this point in the history
[ upstream commit 966027b ]

vhost should notify the application in case of all vring state changes.

In general, application should not care about negotiation of
VHOST_USER_F_PROTOCOL_FEATURES. Protocol details like this should
be hidden by the vhost library.

With this patch applications like OVS will be able to assume that
all vrings disabled by default and only process 'vring_state_changed'
events.

Fixes: 321203a ("vhost: enable rings at the right time")

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
  • Loading branch information
igsilya authored and kevintraynor committed May 7, 2019
1 parent 9fc9960 commit 467038a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/librte_vhost/vhost_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -1231,8 +1231,12 @@ vhost_user_set_vring_kick(struct virtio_net **pdev, struct VhostUserMsg *msg,
* the ring starts already enabled. Otherwise, it is enabled via
* the SET_VRING_ENABLE message.
*/
if (!(dev->features & (1ULL << VHOST_USER_F_PROTOCOL_FEATURES)))
if (!(dev->features & (1ULL << VHOST_USER_F_PROTOCOL_FEATURES))) {
vq->enabled = 1;
if (dev->notify_ops->vring_state_changed)
dev->notify_ops->vring_state_changed(
dev->vid, file.index, 1);
}

if (vq->kickfd >= 0)
close(vq->kickfd);
Expand Down

0 comments on commit 467038a

Please sign in to comment.