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 4B19D106B for ; Fri, 3 Jul 2015 03:58:31 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP; 02 Jul 2015 18:58:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,396,1432623600"; d="scan'208";a="518140196" Received: from pgsmsx107.gar.corp.intel.com ([10.221.44.105]) by FMSMGA003.fm.intel.com with ESMTP; 02 Jul 2015 18:58:29 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.110.14) by PGSMSX107.gar.corp.intel.com (10.221.44.105) with Microsoft SMTP Server (TLS) id 14.3.224.2; Fri, 3 Jul 2015 09:57:39 +0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.165]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.46]) with mapi id 14.03.0224.002; Fri, 3 Jul 2015 09:57:32 +0800 From: "Ouyang, Changchun" To: "Xie, Huawei" , "dev@dpdk.org" Thread-Topic: [PATCH 1/3] vhost: add log if fails to bind a socket Thread-Index: AQHQtHfVoxTZy9w4IU2pfiKwq6hrFJ3I/i5Q Date: Fri, 3 Jul 2015 01:57:32 +0000 Message-ID: References: <1435807983-20383-1-git-send-email-changchun.ouyang@intel.com> <1435807983-20383-2-git-send-email-changchun.ouyang@intel.com> In-Reply-To: Accept-Language: zh-CN, 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 1/3] vhost: add log if fails to bind a socket X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jul 2015 01:58:31 -0000 > -----Original Message----- > From: Xie, Huawei > Sent: Thursday, July 2, 2015 5:29 PM > To: Ouyang, Changchun; dev@dpdk.org > Cc: Cao, Waterman; Xu, Qian Q > Subject: Re: [PATCH 1/3] vhost: add log if fails to bind a socket >=20 > On 7/2/2015 11:33 AM, Ouyang, Changchun wrote: > > It adds more readable log info if a socket fails to bind to local devic= e file > name. > local socket file, not device file. :). Make sense, will update it, thanks > > > > Signed-off-by: Changchun Ouyang > > --- > > lib/librte_vhost/vhost_user/vhost-net-user.c | 5 ++++- > > 1 file changed, 4 insertions(+), 1 deletion(-) > > > > diff --git a/lib/librte_vhost/vhost_user/vhost-net-user.c > b/lib/librte_vhost/vhost_user/vhost-net-user.c > > index 87a4711..f406a94 100644 > > --- a/lib/librte_vhost/vhost_user/vhost-net-user.c > > +++ b/lib/librte_vhost/vhost_user/vhost-net-user.c > > @@ -122,8 +122,11 @@ uds_socket(const char *path) > > un.sun_family =3D AF_UNIX; > > snprintf(un.sun_path, sizeof(un.sun_path), "%s", path); > > ret =3D bind(sockfd, (struct sockaddr *)&un, sizeof(un)); > > - if (ret =3D=3D -1) > > + if (ret =3D=3D -1) { > > + RTE_LOG(ERR, VHOST_CONFIG, "fail to bind fd:%d, remove > file:%s and try again.\n", > > + sockfd, path); > > goto err; > > + } > > RTE_LOG(INFO, VHOST_CONFIG, "bind to %s\n", path); > > > > ret =3D listen(sockfd, MAX_VIRTIO_BACKLOG);