vhost: invoke dev configuration after set vring call message

Message ID 20190114073424.15519-1-xiaolong.ye@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Maxime Coquelin
Headers
Series vhost: invoke dev configuration after set vring call message |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/intel-Performance-Testing success Performance Testing PASS

Commit Message

Xiaolong Ye Jan. 14, 2019, 7:34 a.m. UTC
  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.

Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
---
 lib/librte_vhost/vhost_user.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Maxime Coquelin Jan. 17, 2019, 8:34 a.m. UTC | #1
On 1/14/19 8:34 AM, Xiaolong Ye wrote:
> 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.
> 
> Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
> ---
>   lib/librte_vhost/vhost_user.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime
  
Maxime Coquelin Jan. 17, 2019, 11:34 a.m. UTC | #2
On 1/14/19 8:34 AM, Xiaolong Ye wrote:
> 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.
> 
> Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
> ---
>   lib/librte_vhost/vhost_user.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 

Applied to dpdk-next-virtio/master.

Thanks,
Maxime
  

Patch

diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
index 8fec773d5..469e61e5a 100644
--- a/lib/librte_vhost/vhost_user.c
+++ b/lib/librte_vhost/vhost_user.c
@@ -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;