From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id CD5C820BD for ; Thu, 3 May 2018 05:17:31 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 May 2018 20:17:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,356,1520924400"; d="scan'208";a="51971642" Received: from jguo15x-mobl3.ccr.corp.intel.com (HELO [10.67.68.67]) ([10.67.68.67]) by fmsmga001.fm.intel.com with ESMTP; 02 May 2018 20:17:28 -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" , "Tan, Jianfeng" References: <1498711073-42917-1-git-send-email-jia.guo@intel.com> <1524058689-4954-1-git-send-email-jia.guo@intel.com> <1524058689-4954-3-git-send-email-jia.guo@intel.com> <2601191342CEEE43887BDE71AB977258AE918E93@IRSMSX102.ger.corp.intel.com> Cc: "jblunck@infradead.org" , "shreyansh.jain@nxp.com" , "dev@dpdk.org" , "Zhang, Helin" From: "Guo, Jia" Message-ID: Date: Thu, 3 May 2018 11:17:27 +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: <2601191342CEEE43887BDE71AB977258AE918E93@IRSMSX102.ger.corp.intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH V20 2/4] eal: add failure handler mechanism for hot plug 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, 03 May 2018 03:17:32 -0000 On 4/21/2018 12:16 AM, Ananyev, Konstantin wrote: >>> + >>> +static void sigbus_handler(int signum __rte_unused, siginfo_t *info, >>> + void *ctx __rte_unused) >>> +{ >>> + int ret; >>> + >>> + RTE_LOG(ERR, EAL, "SIGBUS error, fault address:%p\n", info->si_addr); >>> + ret = dev_uev_failure_process(NULL, info->si_addr); >> As now you can try to mmap/munmap same address from two or more different threads >> you probably need some synchronization here. >> Something simple as spinlock seems to be enough here. >> We might have one per device or might be even a global one would be ok here. >> >>> + if (!ret) >>> + RTE_LOG(DEBUG, EAL, >>> + "SIGBUS error is because of hot unplug!\n"); > Also if sigbus handler wasn't able to fix things - failure addr doesn't belong to > any devices, or remaping fails - we probably should invoke previously installed handler > or just apply default action. > Konstantin i think just exception here by exit for apply default action, and info that is a normal sigbus error should be ok. >>> +} >>> +