[dpdk-stable] [dpdk-dev] [PATCH] virtio-user: fix backend selection if stat fails

Jiang, YuX yux.jiang at intel.com
Tue Oct 20 10:43:08 CEST 2020


Tested-by: JiangYuX <yux.jiang at intel.com>

    Best Regards
    Jiang yu


> -----Original Message-----
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Adrian Moreno
> Sent: Tuesday, October 20, 2020 3:16 PM
> To: dev at dpdk.org
> Cc: Wang, Yinan <yinan.wang at intel.com>; Fu, Patrick
> <patrick.fu at intel.com>; amorenoz at redhat.com; stable at dpdk.org; Maxime
> Coquelin <maxime.coquelin at redhat.com>; Xia, Chenbo
> <chenbo.xia at intel.com>; Wang, Zhihong <zhihong.wang at intel.com>
> Subject: [dpdk-dev] [PATCH] virtio-user: fix backend selection if stat fails
> 
> If stat fails it means the backend must be vhost-user in server mode
> 
> Bugzilla ID: 559
> Fixes: f908b22ea47a ("net/virtio: move backend type selection to ethdev")
> Cc: stable at dpdk.org
> 
> Signed-off-by: Adrian Moreno <amorenoz at redhat.com>
> ---
>  drivers/net/virtio/virtio_user_ethdev.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/virtio/virtio_user_ethdev.c
> b/drivers/net/virtio/virtio_user_ethdev.c
> index 042665bc0..ce74d08ab 100644
> --- a/drivers/net/virtio/virtio_user_ethdev.c
> +++ b/drivers/net/virtio/virtio_user_ethdev.c
> @@ -560,9 +560,10 @@ virtio_user_backend_type(const char *path)
>  	struct stat sb;
> 
>  	if (stat(path, &sb) == -1) {
> -		PMD_INIT_LOG(ERR, "Stat fails: %s (%s)\n", path,
> +		PMD_INIT_LOG(INFO, "Stat fails: %s (%s)\n", path,
>  			     strerror(errno));
> -		return VIRTIO_USER_BACKEND_UNKNOWN;
> +		/* Must be vhost-user in server mode */
> +		return VIRTIO_USER_BACKEND_VHOST_USER;
>  	}
> 
>  	if (S_ISSOCK(sb.st_mode)) {
> --
> 2.26.2



More information about the stable mailing list