From: Jiayu Hu Date: Mon, 19 Jul 2021 15:00:45 +0000 (-0400) Subject: vhost: fix lock on device readiness notification X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=7f31d4ea05ca;p=dpdk.git vhost: fix lock on device readiness notification The vhost notifies the application of device readiness via vhost_user_notify_queue_state(), but calling this function is not protected by the lock. This patch is to make this function call lock protected. Fixes: d0fcc38f5fa4 ("vhost: improve device readiness notifications") Cc: stable@dpdk.org Signed-off-by: Jiayu Hu Reviewed-by: Maxime Coquelin --- diff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c index 031c578e54..31300e194f 100644 --- a/lib/vhost/vhost_user.c +++ b/lib/vhost/vhost_user.c @@ -2995,9 +2995,6 @@ skip_to_post_handle: } } - if (unlock_required) - vhost_user_unlock_all_queue_pairs(dev); - /* If message was not handled at this stage, treat it as an error */ if (!handled) { VHOST_LOG_CONFIG(ERR, @@ -3032,6 +3029,8 @@ skip_to_post_handle: } } + if (unlock_required) + vhost_user_unlock_all_queue_pairs(dev); if (!virtio_is_ready(dev)) goto out;