[dpdk-dev] [PATCH] vhost user: unlink sockaddr when poll sched fails

Tan, Jianfeng jianfeng.tan at intel.com
Mon Nov 20 10:18:18 CET 2017


Hi,

> -----Original Message-----
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Gellert Babel
> Sent: Monday, November 20, 2017 2:59 PM
> To: yliu at fridaylinux.org; maxime.coquelin at redhat.com
> Cc: dev at dpdk.org; Jan Wickbom; Gellert Babel
> Subject: [dpdk-dev] [PATCH] vhost user: unlink sockaddr when poll sched
> fails
> 
> From: Jan Wickbom <jan.wickbom at ericsson.com>
> 
> Issue:
> 
> Vhost user socket addresses left in /var/run/openvswitch.
> This will lead to failure to add vhost user ports with names that
> already exist in this directory.
> 
> When there is a failure to add a vhost user socket file descriptor to
> the file descriptor set using fdset_add() in
> rte_vhost_driver_register() the address bound to the socket is not
> released.
> 
> Solution:
> Add unlink of the file path corresponding to the socket address.

I'm afraid this overkills. Suppose we have an existing port binding on path1; and we (wrongly) add another port path1. This patch would remove the previous socket on path1.

Thanks,
Jianfeng

> 
> Signed-off-by: Jan Wickbom <jan.wickbom at ericsson.com>
> Signed-off-by: Gellert Babel <gellert.babel at ericsson.com>
> ---
>  lib/librte_vhost/socket.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/lib/librte_vhost/socket.c b/lib/librte_vhost/socket.c
> index 41aa3f9..eb9dae2 100644
> --- a/lib/librte_vhost/socket.c
> +++ b/lib/librte_vhost/socket.c
> @@ -352,6 +352,7 @@ struct vhost_user {
> 
>  err:
>  	close(fd);
> +	unlink(path);
>  	return -1;
>  }
> 
> --
> 1.9.1



More information about the dev mailing list