Skip to contentSkip to conversation

vhost: invoke dev configuration after set vring call message

PATCH Applied Xiaolong Ye 2 participants 3 messages Jan 14, 2019 – Jan 17, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vhost: invoke dev configuration after set vring call message

As qemu will only send VHOST_USER_SET_VRING_ENABLE message for guest enabled vrings (only first queue pair will be enabled at initialized stage), this will cause trouble for multiqueue case, vDPA's dev_conf callback will get no chance be invoked. Decouple the dev_conf callback from VHOST_USER_SET_VRING_ENABLE solves this issue.

---
 lib/librte_vhost/vhost_user.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/librte_vhost/vhost_user.c +1 -1
index 8fec773d5..469e61e5a 100644
@@ -2045,7 +2045,7 @@ vhost_user_msg_handler(int vid, int fd)
 	vdpa_dev = rte_vdpa_get_device(did);
 	if (vdpa_dev && virtio_is_ready(dev) &&
 			!(dev->flags & VIRTIO_DEV_VDPA_CONFIGURED) &&
-			msg.request.master == VHOST_USER_SET_VRING_ENABLE) {
+			msg.request.master == VHOST_USER_SET_VRING_CALL) {
 		if (vdpa_dev->ops->dev_conf)
 			vdpa_dev->ops->dev_conf(dev->vid);
 		dev->flags |= VIRTIO_DEV_VDPA_CONFIGURED;
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Xiaolong Ye

As qemu will only send VHOST_USER_SET_VRING_ENABLE message for guest enabled vrings (only first queue pair will be enabled at initialized stage), this will cause trouble for multiqueue case, vDPA's dev_conf callback will get no chance be invoked. Decouple the dev_conf callback from VHOST_USER_SET_VRING_ENABLE solves this issue.

---
  lib/librte_vhost/vhost_user.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

Thanks,
Maxime

#2 lore raw
In reply to Xiaolong Ye
Quoted 11 lines · Xiaolong Ye

As qemu will only send VHOST_USER_SET_VRING_ENABLE message for guest enabled vrings (only first queue pair will be enabled at initialized stage), this will cause trouble for multiqueue case, vDPA's dev_conf callback will get no chance be invoked. Decouple the dev_conf callback from VHOST_USER_SET_VRING_ENABLE solves this issue.

---
  lib/librte_vhost/vhost_user.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

Applied to dpdk-next-virtio/master.

Thanks,
Maxime