From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff Guo Subject: Re: [PATCH V5 5/7] bus: add helper to handle sigbus Date: Mon, 9 Jul 2018 13:31:04 +0800 Message-ID: <9d66f5be-8fc9-c42f-660c-c1109ed76de9@intel.com> References: <1498711073-42917-1-git-send-email-jia.guo@intel.com> <1530776333-30318-1-git-send-email-jia.guo@intel.com> <1530776333-30318-6-git-send-email-jia.guo@intel.com> <7A795063ED59344FA044FE7D577A3D9878C73D@SHSMSX101.ccr.corp.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: "He, Shaopeng" , "stephen@networkplumber.org" , "Richardson, Bruce" , "Yigit, Ferruh" , "Ananyev, Konstantin" , "gaetan.rivet@6wind.com" , "Wu, Jingjing" , "thomas@monjalon.net" , "motih@mellanox.com" , "matan@mellanox.com" , "Van Haaren, Harry" , "Zhang, Qi Z" , "Iremonger, Bernard" Return-path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 731827EC7 for ; Mon, 9 Jul 2018 07:31:27 +0200 (CEST) In-Reply-To: <7A795063ED59344FA044FE7D577A3D9878C73D@SHSMSX101.ccr.corp.intel.com> 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, shaopeng thanks for your review. On 7/6/2018 11:22 PM, He, Shaopeng wrote: >> -----Original Message----- >> From: Guo, Jia >> Sent: Thursday, July 5, 2018 3:39 PM >> >> This patch aim to add a helper to iterate all buses to find the >> corresponding bus to handle the sigbus error. >> > [...] > >> + bus = rte_bus_find(NULL, bus_handle_sigbus, failure_addr); >> + /* failed to handle the sigbus, pass the new errno. */ >> + if (bus && rte_errno == -1) >> + return -1; >> + else if (!bus) >> + ret = 1; > Change the compare order, code will be a little bit shorter? > if (!bus) > ret = 1 > else if (rte_errno == -1) > return -1; > > [...] make sense. > Acked-by: Shaopeng He >