From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Ananyev, Konstantin" Subject: Re: [PATCH V4 5/9] bus: add helper to handle sigbus Date: Fri, 29 Jun 2018 12:21:39 +0000 Message-ID: <2601191342CEEE43887BDE71AB977258C0C43C71@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> <2601191342CEEE43887BDE71AB977258C0C43A49@irsmsx105.ger.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: "jblunck@infradead.org" , "shreyansh.jain@nxp.com" , "dev@dpdk.org" , "Zhang, Helin" 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" Return-path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 224071B56F for ; Fri, 29 Jun 2018 14:21:42 +0200 (CEST) In-Reply-To: Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > -----Original Message----- > From: Guo, Jia > Sent: Friday, June 29, 2018 12:23 PM > To: Ananyev, Konstantin ; stephen@networkpl= umber.org; Richardson, Bruce > ; Yigit, Ferruh ; gae= tan.rivet@6wind.com; Wu, Jingjing > ; thomas@monjalon.net; motih@mellanox.com; matan@m= ellanox.com; Van Haaren, Harry > ; Zhang, Qi Z ; He, Sha= openg ; Iremonger, Bernard > > Cc: jblunck@infradead.org; shreyansh.jain@nxp.com; dev@dpdk.org; Zhang, H= elin > Subject: Re: [PATCH V4 5/9] bus: add helper to handle sigbus >=20 > hi, konstantin >=20 >=20 > On 6/29/2018 6:51 PM, Ananyev, Konstantin wrote: > >> +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? >=20 > restore old_errno just use to let caller know that the generic sigbus > still not handler by bus hotplug handler, that involve find a bus > handle but failed and can not find a hander, and can corresponding use > the previous sigbus handler to process it. > that is also unwser your question in other patch. do you think that make > sense? Sorry, still don't understand the intention. Suppose rte_bus_find() will return NULL, in that case you'll setup rte_errn= o to what it was before calling that function. If the returned bus is not NULL, but bus_find() set's an rte_errno, you still would restore rte_ernno? What is the prupose? Why do you need to touch rte_errno at all in that function? Konstantin >=20 > >> + > >> + return ret; > >> +}