From 966027b4b3a3e1059bf31ca07340914f6b8bb53a Mon Sep 17 00:00:00 2001 From: Ilya Maximets Date: Fri, 12 Apr 2019 16:09:49 +0300 Subject: [PATCH] vhost: fix silent queue enabling with legacy guests 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: 321203a54ba7 ("vhost: enable rings at the right time") Cc: stable@dpdk.org Signed-off-by: Ilya Maximets Reviewed-by: Maxime Coquelin --- lib/librte_vhost/vhost_user.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c index 23beed97d0..c9e29ece8f 100644 --- a/lib/librte_vhost/vhost_user.c +++ b/lib/librte_vhost/vhost_user.c @@ -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); -- 2.20.1