From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id AD3D1237 for ; Mon, 20 Nov 2017 10:18:22 +0100 (CET) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Nov 2017 01:18:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,426,1505804400"; d="scan'208";a="3790700" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga004.fm.intel.com with ESMTP; 20 Nov 2017 01:18:21 -0800 Received: from fmsmsx117.amr.corp.intel.com (10.18.116.17) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 20 Nov 2017 01:18:20 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx117.amr.corp.intel.com (10.18.116.17) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 20 Nov 2017 01:18:20 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.213]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.218]) with mapi id 14.03.0319.002; Mon, 20 Nov 2017 17:18:18 +0800 From: "Tan, Jianfeng" To: Gellert Babel , "yliu@fridaylinux.org" , "maxime.coquelin@redhat.com" CC: "dev@dpdk.org" , Jan Wickbom Thread-Topic: [dpdk-dev] [PATCH] vhost user: unlink sockaddr when poll sched fails Thread-Index: AQHTYc0ttTgBuMAWi0yM9UmBCmOgt6Mc/HbA Date: Mon, 20 Nov 2017 09:18:18 +0000 Message-ID: References: <1511161153-5127-1-git-send-email-gellert.babel@ericsson.com> In-Reply-To: <1511161153-5127-1-git-send-email-gellert.babel@ericsson.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] vhost user: unlink sockaddr when poll sched fails X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Nov 2017 09:18:23 -0000 Hi, > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Gellert Babel > Sent: Monday, November 20, 2017 2:59 PM > To: yliu@fridaylinux.org; maxime.coquelin@redhat.com > Cc: dev@dpdk.org; Jan Wickbom; Gellert Babel > Subject: [dpdk-dev] [PATCH] vhost user: unlink sockaddr when poll sched > fails >=20 > From: Jan Wickbom >=20 > Issue: >=20 > 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. >=20 > 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. >=20 > 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 path= 1; and we (wrongly) add another port path1. This patch would remove the pre= vious socket on path1. Thanks, Jianfeng >=20 > Signed-off-by: Jan Wickbom > Signed-off-by: Gellert Babel > --- > lib/librte_vhost/socket.c | 1 + > 1 file changed, 1 insertion(+) >=20 > 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 { >=20 > err: > close(fd); > + unlink(path); > return -1; > } >=20 > -- > 1.9.1