From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 408F91BDFB for ; Fri, 6 Jul 2018 17:22:13 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Jul 2018 08:22:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,316,1526367600"; d="scan'208";a="62772605" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by FMSMGA003.fm.intel.com with ESMTP; 06 Jul 2018 08:22:05 -0700 Received: from fmsmsx155.amr.corp.intel.com (10.18.116.71) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 6 Jul 2018 08:22:05 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX155.amr.corp.intel.com (10.18.116.71) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 6 Jul 2018 08:22:04 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.57]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.81]) with mapi id 14.03.0319.002; Fri, 6 Jul 2018 23:22:03 +0800 From: "He, Shaopeng" To: "Guo, Jia" , "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" CC: "jblunck@infradead.org" , "shreyansh.jain@nxp.com" , "dev@dpdk.org" , "Zhang, Helin" Thread-Topic: [PATCH V5 5/7] bus: add helper to handle sigbus Thread-Index: AQHUFDOcZ760RfM9aE2zMlslSYMHsKSCTZUw Date: Fri, 6 Jul 2018 15:22:01 +0000 Message-ID: <7A795063ED59344FA044FE7D577A3D9878C73D@SHSMSX101.ccr.corp.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> In-Reply-To: <1530776333-30318-6-git-send-email-jia.guo@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.200.100 dlp-reaction: no-action x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMzc3MjRmYWUtZmY3OC00ZWY4LThjYzQtNTFmYzBkNDI3Yzg5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiTFdSMm5XMlFKWVBPXC9wV0dPcGVoVTAraG1temM2ZDVDdU9TWlZXdFZKbnVjd0NNbHEwbmhqazhnWjhTMjc1b2kifQ== x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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: Fri, 06 Jul 2018 15:22:13 -0000 > -----Original Message----- > From: Guo, Jia > Sent: Thursday, July 5, 2018 3:39 PM >=20 > This patch aim to add a helper to iterate all buses to find the > corresponding bus to handle the sigbus error. >=20 [...] > + bus =3D rte_bus_find(NULL, bus_handle_sigbus, failure_addr); > + /* failed to handle the sigbus, pass the new errno. */ > + if (bus && rte_errno =3D=3D -1) > + return -1; > + else if (!bus) > + ret =3D 1; Change the compare order, code will be a little bit shorter? if (!bus) ret =3D 1 else if (rte_errno =3D=3D -1) return -1; [...] Acked-by: Shaopeng He