From mboxrd@z Thu Jan 1 00:00:00 1970 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) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Jul 2018 22:31:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,329,1526367600"; d="scan'208";a="55381251" Received: from jguo15x-mobl3.ccr.corp.intel.com (HELO [10.67.68.84]) ([10.67.68.84]) by orsmga008.jf.intel.com with ESMTP; 08 Jul 2018 22:31:05 -0700 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" 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> Cc: "jblunck@infradead.org" , "shreyansh.jain@nxp.com" , "dev@dpdk.org" , "Zhang, Helin" From: Jeff Guo Message-ID: <9d66f5be-8fc9-c42f-660c-c1109ed76de9@intel.com> Date: Mon, 9 Jul 2018 13:31:04 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <7A795063ED59344FA044FE7D577A3D9878C73D@SHSMSX101.ccr.corp.intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH V5 5/7] bus: add helper to handle sigbus 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: Mon, 09 Jul 2018 05:31:27 -0000 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 >