[PATCH 20.11] vhost: prevent async register
Jiayu Hu
jiayu.hu at intel.com
Thu Aug 18 02:57:32 CEST 2022
Deadlock may occur if async register function is called inside
vhost callback functions. This patch disables async datapath
by preventing async vhost register.
Signed-off-by: Jiayu Hu <jiayu.hu at intel.com>
Acked-by: Maxime Coquelin <maxime.coquelin at redhat.com>
---
lib/librte_vhost/vhost.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c
index b83cf63..530a960 100644
--- a/lib/librte_vhost/vhost.c
+++ b/lib/librte_vhost/vhost.c
@@ -1608,6 +1608,11 @@ int rte_vhost_async_channel_register(int vid, uint16_t queue_id,
ops->transfer_data == NULL))
return -1;
+ VHOST_LOG_CONFIG(ERR, "async vhost is not supported by 20.11 LTS, "
+ "as deadlock may occur if this function is called "
+ "inside vhost callback functions.");
+ return -1;
+
rte_spinlock_lock(&vq->access_lock);
if (unlikely(vq->async_registered)) {
--
2.7.4
More information about the stable
mailing list