From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Ouyang, Changchun" Subject: Re: [PATCH v4 4/4] vhost: add comment for potential unwanted callback on listenfds Date: Wed, 1 Jul 2015 02:15:35 +0000 Message-ID: References: <1434649260-26317-2-git-send-email-huawei.xie@intel.com> <1435656050-3539-1-git-send-email-huawei.xie@intel.com> <1435656050-3539-5-git-send-email-huawei.xie@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable To: "Xie, Huawei" , "dev@dpdk.org" Return-path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id A1B9BC36E for ; Wed, 1 Jul 2015 04:15:40 +0200 (CEST) In-Reply-To: <1435656050-3539-5-git-send-email-huawei.xie@intel.com> Content-Language: en-US List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Huawei Xie > Sent: Tuesday, June 30, 2015 5:21 PM > To: dev@dpdk.org > Subject: [dpdk-dev] [PATCH v4 4/4] vhost: add comment for potential > unwanted callback on listenfds >=20 > add comment for potential unwanted callback on listenfds >=20 > v4 changes: > add comment for potential unwanted callback on listenfds >=20 > Signed-off-by: Huawei Xie Acked-by: Changchun Ouyang > --- > lib/librte_vhost/vhost_user/fd_man.c | 7 +++++++ > 1 file changed, 7 insertions(+) >=20 > diff --git a/lib/librte_vhost/vhost_user/fd_man.c > b/lib/librte_vhost/vhost_user/fd_man.c > index bd30f8d..d68b270 100644 > --- a/lib/librte_vhost/vhost_user/fd_man.c > +++ b/lib/librte_vhost/vhost_user/fd_man.c > @@ -242,6 +242,13 @@ fdset_event_dispatch(struct fdset *pfdset) >=20 > pthread_mutex_unlock(&pfdset->fd_mutex); >=20 > + /* > + * When select is blocked, other threads might unregister > + * listenfds from and register new listenfds into fdset. > + * When select returns, the entries for listenfds in the fdset > + * might have been updated. It is ok if there is unwanted call > + * for new listenfds. > + */ > ret =3D select(maxfds + 1, &rfds, &wfds, NULL, &tv); > if (ret <=3D 0) > continue; > -- > 1.8.1.4