From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id C0BA63195 for ; Thu, 4 Oct 2018 04:32:32 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Oct 2018 19:32:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,338,1534834800"; d="scan'208";a="76041848" Received: from jguo15x-mobl.ccr.corp.intel.com (HELO [10.249.174.2]) ([10.249.174.2]) by fmsmga008.fm.intel.com with ESMTP; 03 Oct 2018 19:31: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" , "arybchenko@solarflare.com" , "Lu, Wenzhuo" , "Burakov, Anatoly" , "jerin.jacob@caviumnetworks.com" Cc: "jblunck@infradead.org" , "shreyansh.jain@nxp.com" , "dev@dpdk.org" , "Zhang, Helin" References: <1498711073-42917-1-git-send-email-jia.guo@intel.com> <1538483726-96411-1-git-send-email-jia.guo@intel.com> <1538483726-96411-7-git-send-email-jia.guo@intel.com> <2601191342CEEE43887BDE71AB9772580102FE0C4F@IRSMSX106.ger.corp.intel.com> From: Jeff Guo Message-ID: <2481d277-0a4c-9a61-41cf-5959b9359d25@intel.com> Date: Thu, 4 Oct 2018 10:31:11 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <2601191342CEEE43887BDE71AB9772580102FE0C4F@IRSMSX106.ger.corp.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Subject: Re: [dpdk-dev] [PATCH v12 6/7] eal: add failure handle mechanism for hot-unplug 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: Thu, 04 Oct 2018 02:32:33 -0000 On 10/2/2018 9:34 PM, Ananyev, Konstantin wrote: > Hi Jeff, > > Looks ok to me in general, just one thing I missed before: > >> +static void sigbus_handler(int signum, siginfo_t *info, >> + void *ctx __rte_unused) >> +{ >> + int ret; >> + >> + RTE_LOG(INFO, EAL, "Thread[%d] catch SIGBUS, fault address:%p\n", >> + (int)pthread_self(), info->si_addr); >> + >> + rte_spinlock_lock(&failure_handle_lock); >> + ret = rte_bus_sigbus_handler(info->si_addr); >> + rte_spinlock_unlock(&failure_handle_lock); >> + if (ret == -1) { >> + rte_exit(EXIT_FAILURE, >> + "Failed to handle SIGBUS for hot-unplug, " >> + "(rte_errno: %s)!", strerror(rte_errno)); >> + } else if (ret == 1) { >> + if (sigbus_action_old.sa_handler) >> + (*(sigbus_action_old.sa_handler))(signum); > Shouldn't we check sigbus_action_old.sa_flags here,and based on that > invoke either sa_handler() or sa_sigaction()? > Konstantin you are right here, konstantin. We should not assume the old action should always be sa_handler. There is a flags check missing here. Thanks. >> + else >> + rte_exit(EXIT_FAILURE, >> + "Failed to handle generic SIGBUS!"); >> + } >> + >> + RTE_LOG(INFO, EAL, "Success to handle SIGBUS for hot-unplug!\n"); >> +}