DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] vhost: fix deadlock when handling user messages
@ 2022-05-05 13:40 Wenwu Ma
  2022-05-05  7:21 ` David Marchand
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Wenwu Ma @ 2022-05-05 13:40 UTC (permalink / raw)
  To: maxime.coquelin, chenbo.xia, dev
  Cc: jiayu.hu, yinan.wang, xingguang.he, Wenwu Ma

In vhost_user_msg_handler(), if vhost message handling
failed, we should check whether the queue is locked and
release the lock before returning. Or, it will cause a
deadlock later.

Signed-off-by: Wenwu Ma <wenwux.ma@intel.com>
---
 lib/vhost/vhost_user.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c
index 1d390677fa..80a5df6e9d 100644
--- a/lib/vhost/vhost_user.c
+++ b/lib/vhost/vhost_user.c
@@ -3113,6 +3113,8 @@ vhost_user_msg_handler(int vid, int fd)
 		send_vhost_reply(dev, fd, &ctx);
 	} else if (ret == RTE_VHOST_MSG_RESULT_ERR) {
 		VHOST_LOG_CONFIG(ERR, "(%s) vhost message handling failed.\n", dev->ifname);
+		if (unlock_required)
+			vhost_user_unlock_all_queue_pairs(dev);
 		return -1;
 	}
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2022-07-11  9:14 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-05 13:40 [PATCH] vhost: fix deadlock when handling user messages Wenwu Ma
2022-05-05  7:21 ` David Marchand
2022-05-05 16:17 ` [PATCH v2] " Wenwu Ma
2022-05-06  8:19   ` Xia, Chenbo
2022-05-07 13:27 ` [PATCH v3] vhost: fix deadlock when message handling failed Wenwu Ma
2022-05-07  6:02   ` Xia, Chenbo
2022-05-09  3:13   ` Ling, WeiX
2022-05-17 13:15   ` David Marchand
2022-05-17 13:24   ` Maxime Coquelin
2022-07-11  8:42     ` Pei, Andy
2022-07-11  8:54       ` Xia, Chenbo
2022-07-11  9:02         ` Pei, Andy
2022-07-11  9:14           ` Xia, Chenbo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).