From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 3344E1B3BA for ; Fri, 29 Jun 2018 12:51:31 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Jun 2018 03:51:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,285,1526367600"; d="scan'208";a="62567690" Received: from irsmsx109.ger.corp.intel.com ([163.33.3.23]) by fmsmga002.fm.intel.com with ESMTP; 29 Jun 2018 03:51:28 -0700 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.126]) by IRSMSX109.ger.corp.intel.com ([169.254.13.225]) with mapi id 14.03.0319.002; Fri, 29 Jun 2018 11:51:27 +0100 From: "Ananyev, Konstantin" To: "Guo, Jia" , "stephen@networkplumber.org" , "Richardson, Bruce" , "Yigit, Ferruh" , "gaetan.rivet@6wind.com" , "Wu, Jingjing" , "thomas@monjalon.net" , "motih@mellanox.com" , "matan@mellanox.com" , "Van Haaren, Harry" , "Zhang, Qi Z" , "He, Shaopeng" , "Iremonger, Bernard" CC: "jblunck@infradead.org" , "shreyansh.jain@nxp.com" , "dev@dpdk.org" , "Zhang, Helin" Thread-Topic: [PATCH V4 5/9] bus: add helper to handle sigbus Thread-Index: AQHUD5SkzkmIjiEBsEqWe7YtejsRYqR3Dq7Q Date: Fri, 29 Jun 2018 10:51:27 +0000 Message-ID: <2601191342CEEE43887BDE71AB977258C0C43A49@irsmsx105.ger.corp.intel.com> References: <1498711073-42917-1-git-send-email-jia.guo@intel.com> <1530268248-7328-1-git-send-email-jia.guo@intel.com> <1530268248-7328-6-git-send-email-jia.guo@intel.com> In-Reply-To: <1530268248-7328-6-git-send-email-jia.guo@intel.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMzk1NjEzNTEtZGZmMC00YWExLTk5YmYtM2M2YjFhZDNkZGRjIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoianNveWpOeDlUeEp3c3FDZ041eCsxK3ZlS3RcL3RqVDlWUDdORXZ1XC9mbHpGaU1kWjZZOHd1dXE4R2xvM2Y5WEo4In0= x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.200.100 dlp-reaction: no-action x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH V4 5/9] 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, 29 Jun 2018 10:51:31 -0000 > +int > +rte_bus_sigbus_handler(const void *failure_addr) > +{ > + struct rte_bus *bus; > + int old_errno =3D rte_errno; > + int ret =3D 0; > + > + rte_errno =3D 0; > + > + bus =3D rte_bus_find(NULL, bus_handle_sigbus, failure_addr); > + if (bus =3D=3D NULL) { > + RTE_LOG(ERR, EAL, "No bus can handle the sigbus error!"); > + ret =3D -1; > + } else if (rte_errno !=3D 0) { > + RTE_LOG(ERR, EAL, "Failed to handle the sigbus error!"); > + ret =3D -1; > + } > + > + /* if sigbus not be handled, return back old errno. */ > + if (ret) > + rte_errno =3D old_errno; Hmm, not sure why we need to set/restore rte_errno here? > + > + return ret; > +}