From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 83CFA44BE for ; Fri, 23 Mar 2018 02:30:21 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Mar 2018 18:30:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,347,1517904000"; d="scan'208";a="36088653" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by FMSMGA003.fm.intel.com with ESMTP; 22 Mar 2018 18:30:16 -0700 Received: from fmsmsx113.amr.corp.intel.com (10.18.116.7) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 22 Mar 2018 18:30:16 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX113.amr.corp.intel.com (10.18.116.7) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 22 Mar 2018 18:30:15 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.235]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.166]) with mapi id 14.03.0319.002; Fri, 23 Mar 2018 09:30:13 +0800 From: "Tan, Jianfeng" To: "xiangxia.m.yue@gmail.com" CC: "dev@dpdk.org" Thread-Topic: [PATCH 1/2] vhost: make sure vhost fdset-thread created successfully Thread-Index: AQHTwdrtgZgsF/ZGXkOeQQH7WDPzkaPdCHkw Date: Fri, 23 Mar 2018 01:30:13 +0000 Message-ID: References: <1521722398-93353-1-git-send-email-xiangxia.m.yue@gmail.com> In-Reply-To: <1521722398-93353-1-git-send-email-xiangxia.m.yue@gmail.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 1/2] vhost: make sure vhost fdset-thread created successfully 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: Fri, 23 Mar 2018 01:30:22 -0000 Hi Xiangxia, > -----Original Message----- > From: xiangxia.m.yue@gmail.com [mailto:xiangxia.m.yue@gmail.com] > Sent: Thursday, March 22, 2018 8:40 PM > To: Tan, Jianfeng > Cc: dev@dpdk.org; Tonghao Zhang > Subject: [PATCH 1/2] vhost: make sure vhost fdset-thread created > successfully >=20 > From: Tonghao Zhang >=20 > When first call the 'rte_vhost_driver_start', the > fdset_event_dispatch thread should be created successfully. > Because the vhost uses it to poll socket events for vhost > server or clients. Without it, for example, vhost will not > get the connection event. >=20 > This patch returns err code directly when created not successful. >=20 > Signed-off-by: Tonghao Zhang Except a nit below, Reviewed-by: Jianfeng Tan > --- > lib/librte_vhost/socket.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) >=20 > diff --git a/lib/librte_vhost/socket.c b/lib/librte_vhost/socket.c > index 83befdc..8ca01df 100644 > --- a/lib/librte_vhost/socket.c > +++ b/lib/librte_vhost/socket.c > @@ -831,9 +831,11 @@ struct vhost_device_ops const * > if (fdset_tid =3D=3D 0) { > int ret =3D pthread_create(&fdset_tid, NULL, > fdset_event_dispatch, > &vhost_user.fdset); > - if (ret !=3D 0) > + if (ret !=3D 0) { > RTE_LOG(ERR, VHOST_CONFIG, > "failed to create fdset handling thread"); > + return ret; According to the declaration below, we shall return 0 or -1. /** * * Start the vhost-user driver. * * This function triggers the vhost-user negotiation. * * @param path * The vhost-user socket file path * @return * 0 on success, -1 on failure */ int rte_vhost_driver_start(const char *path); > + } > } >=20 > if (vsocket->is_server) > -- > 1.8.3.1