From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Van Haaren, Harry" Subject: Re: [PATCH V16 3/4] eal/linux: uevent parse and process 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> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: "jblunck@infradead.org" , "shreyansh.jain@nxp.com" , "dev@dpdk.org" , "Zhang, Helin" 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" 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) In-Reply-To: Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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.