[dpdk-stable] [PATCH] vhost: prevent async register

Maxime Coquelin maxime.coquelin at redhat.com
Mon Jul 5 14:31:16 CEST 2021



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 at 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 at redhat.com>

Thanks,
Maxime



More information about the stable mailing list