* [dpdk-stable] [PATCH] vhost: prevent async register
@ 2021-07-05 13:08 Jiayu Hu
2021-07-05 12:31 ` Maxime Coquelin
0 siblings, 1 reply; 2+ messages in thread
From: Jiayu Hu @ 2021-07-05 13:08 UTC (permalink / raw)
To: stable; +Cc: maxime.coquelin, chenbo.xia, Jiayu Hu
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@intel.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 b97dcf6..cea7c36 100644
--- a/lib/librte_vhost/vhost.c
+++ b/lib/librte_vhost/vhost.c
@@ -1618,6 +1618,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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [dpdk-stable] [PATCH] vhost: prevent async register
2021-07-05 13:08 [dpdk-stable] [PATCH] vhost: prevent async register Jiayu Hu
@ 2021-07-05 12:31 ` Maxime Coquelin
0 siblings, 0 replies; 2+ messages in thread
From: Maxime Coquelin @ 2021-07-05 12:31 UTC (permalink / raw)
To: Jiayu Hu, stable; +Cc: chenbo.xia
On 7/5/21 3:08 PM, Jiayu Hu wrote:
> 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@intel.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 b97dcf6..cea7c36 100644
> --- a/lib/librte_vhost/vhost.c
> +++ b/lib/librte_vhost/vhost.c
> @@ -1618,6 +1618,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)) {
>
Acked-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Thanks,
Maxime
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-07-05 12:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-05 13:08 [dpdk-stable] [PATCH] vhost: prevent async register Jiayu Hu
2021-07-05 12:31 ` Maxime Coquelin
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).