From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 043A12BB8 for ; Thu, 29 Mar 2018 15:32:06 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Mar 2018 06:32:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,376,1517904000"; d="scan'208";a="46310042" Received: from irsmsx154.ger.corp.intel.com ([163.33.192.96]) by orsmga002.jf.intel.com with ESMTP; 29 Mar 2018 06:32:02 -0700 Received: from irsmsx101.ger.corp.intel.com ([169.254.1.176]) by IRSMSX154.ger.corp.intel.com ([169.254.12.249]) with mapi id 14.03.0319.002; Thu, 29 Mar 2018 14:32:01 +0100 From: "Van Haaren, Harry" To: "Tan, Jianfeng" , "Guo, Jia" , "stephen@networkplumber.org" , "Richardson, Bruce" , "Yigit, Ferruh" , "Ananyev, Konstantin" , "gaetan.rivet@6wind.com" , "Wu, Jingjing" , "thomas@monjalon.net" , "motih@mellanox.com" CC: "jblunck@infradead.org" , "shreyansh.jain@nxp.com" , "dev@dpdk.org" , "Zhang, Helin" Thread-Topic: [PATCH V16 3/4] eal/linux: uevent parse and process Thread-Index: AQHTxPSqdH/6cd0ZoEK1um3Wkh1ka6PlxVoAgAFz7RA= Date: Thu, 29 Mar 2018 13:32:01 +0000 Message-ID: References: <1521610066-12966-3-git-send-email-jia.guo@intel.com> <1522063256-3997-1-git-send-email-jia.guo@intel.com> <1522063256-3997-4-git-send-email-jia.guo@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOTM0YTBlYWMtYWY3ZC00MDczLWIyZGItZGIxNGYwOWUwMTAyIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiI3elNoVHg5XC8xdmFqRXN4b1J2aXp1QnN3cHlVTjBQVmRBbm1sdUxCTkMrenBkU1wvV2ZUcUt5Uld1TGNsbUZqeVAifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.200.100 dlp-reaction: no-action x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH V16 3/4] eal/linux: uevent parse and process 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: Thu, 29 Mar 2018 13:32:07 -0000 Two additional input along with Jianfeng's existing comments; > -----Original Message----- > From: Tan, Jianfeng > Sent: Wednesday, March 28, 2018 5:16 PM > To: Guo, Jia ; stephen@networkplumber.org; Richardson, > Bruce ; Yigit, Ferruh ; > Ananyev, Konstantin ; gaetan.rivet@6wind.co= m; > Wu, Jingjing ; thomas@monjalon.net; > motih@mellanox.com; Van Haaren, Harry > Cc: jblunck@infradead.org; shreyansh.jain@nxp.com; dev@dpdk.org; Zhang, > Helin > Subject: Re: [PATCH V16 3/4] eal/linux: uevent parse and process >=20 > BTW, adding new .c file needs to update meson.build now. >=20 > On 3/26/2018 7:20 PM, Jeff Guo wrote: > > In order to handle the uevent which have been detected from the kernel > > side, add uevent parse and process function to translate the uevent int= o > > device event, which user has subscribe to monitor. > > > > Signed-off-by: Jeff Guo > > --- > > 1.move all linux specific together > > --- > > lib/librte_eal/linuxapp/eal/eal_dev.c | 214 > +++++++++++++++++++++++++++++++++- > > 1 file changed, 211 insertions(+), 3 deletions(-) > > > > diff --git a/lib/librte_eal/linuxapp/eal/eal_dev.c > b/lib/librte_eal/linuxapp/eal/eal_dev.c >=20 > > +static bool monitor_not_started =3D true; This variable should be named "monitor_started", as it is a static var it w= ill be zero by default, and the following code is easier to read: if ( !not_started ) becomes if (started) > > int __rte_experimental > > rte_dev_event_monitor_start(void) > > { > > - /* TODO: start uevent monitor for linux */ > > + int ret; > > + > > + if (!monitor_not_started) > > + return 0; > > + > > + intr_handle.fd =3D dev_uev_monitor_fd_new(); > > + intr_handle.type =3D RTE_INTR_HANDLE_DEV_EVENT; dev_uev_monitor_fd_new() can return -1 on error, we should check for that c= ase here.