From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 21BEA1B512 for ; Fri, 29 Jun 2018 13:23:33 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Jun 2018 04:23:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,285,1526367600"; d="scan'208";a="67366129" Received: from jguo15x-mobl3.ccr.corp.intel.com (HELO [10.67.68.42]) ([10.67.68.42]) by fmsmga004.fm.intel.com with ESMTP; 29 Jun 2018 04:23:13 -0700 To: "Ananyev, Konstantin" , "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" 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> Cc: "jblunck@infradead.org" , "shreyansh.jain@nxp.com" , "dev@dpdk.org" , "Zhang, Helin" From: "Guo, Jia" Message-ID: Date: Fri, 29 Jun 2018 19:23:13 +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: <2601191342CEEE43887BDE71AB977258C0C43A49@irsmsx105.ger.corp.intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit 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 11:23:34 -0000 hi, konstantin 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 = rte_errno; >> + int ret = 0; >> + >> + rte_errno = 0; >> + >> + bus = rte_bus_find(NULL, bus_handle_sigbus, failure_addr); >> + if (bus == NULL) { >> + RTE_LOG(ERR, EAL, "No bus can handle the sigbus error!"); >> + ret = -1; >> + } else if (rte_errno != 0) { >> + RTE_LOG(ERR, EAL, "Failed to handle the sigbus error!"); >> + ret = -1; >> + } >> + >> + /* if sigbus not be handled, return back old errno. */ >> + if (ret) >> + rte_errno = old_errno; > Hmm, not sure why we need to set/restore rte_errno here? 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? >> + >> + return ret; >> +}