From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Guo, Jia" Subject: Re: [PATCH V16 3/4] eal/linux: uevent parse and process Date: Thu, 29 Mar 2018 23:03:03 +0800 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=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: "jblunck@infradead.org" , "shreyansh.jain@nxp.com" , "dev@dpdk.org" , "Zhang, Helin" To: "Van Haaren, Harry" , "Tan, Jianfeng" , "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 mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 36A492C12 for ; Thu, 29 Mar 2018 17:03:09 +0200 (CEST) In-Reply-To: List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" hi, harry thanks for your review. On 3/29/2018 9:32 PM, Van Haaren, Harry wrote: > 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.com; >> 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 >> >> BTW, adding new .c file needs to update meson.build now. >> >> 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 into >>> 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 >> >>> +static bool monitor_not_started = true; > This variable should be named "monitor_started", as it is a static var it will be zero by default, > and the following code is easier to read: > > if ( !not_started ) becomes if (started) > make sense. > >>> 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 = dev_uev_monitor_fd_new(); >>> + intr_handle.type = RTE_INTR_HANDLE_DEV_EVENT; > dev_uev_monitor_fd_new() can return -1 on error, we should check for that case here. > you are right.