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 A01191B1AB for ; Tue, 10 Jul 2018 10:23:22 +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 fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Jul 2018 01:23:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,333,1526367600"; d="scan'208";a="53896726" Received: from jguo15x-mobl3.ccr.corp.intel.com (HELO [10.67.68.57]) ([10.67.68.57]) by fmsmga008.fm.intel.com with ESMTP; 10 Jul 2018 01:23:18 -0700 To: Andrew Rybchenko , stephen@networkplumber.org, bruce.richardson@intel.com, ferruh.yigit@intel.com, konstantin.ananyev@intel.com, gaetan.rivet@6wind.com, jingjing.wu@intel.com, thomas@monjalon.net, motih@mellanox.com, matan@mellanox.com, harry.van.haaren@intel.com, qi.z.zhang@intel.com, shaopeng.he@intel.com, bernard.iremonger@intel.com, wenzhuo.lu@intel.com References: <1498711073-42917-1-git-send-email-jia.guo@intel.com> <1531137666-10351-1-git-send-email-jia.guo@intel.com> <1531137666-10351-7-git-send-email-jia.guo@intel.com> Cc: jblunck@infradead.org, shreyansh.jain@nxp.com, dev@dpdk.org, helin.zhang@intel.com From: Jeff Guo Message-ID: Date: Tue, 10 Jul 2018 16:23:18 +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: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v7 6/7] eal: add failure handle mechanism for hotplug 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: Tue, 10 Jul 2018 08:23:23 -0000 On 7/9/2018 9:50 PM, Andrew Rybchenko wrote: > On 09.07.2018 15:01, Jeff Guo wrote: >> This patch introduces a failure handle mechanism to handle device >> hotplug removal event. >> >> First it can register sigbus handler when enable device event >> monitor. Once >> sigbus error be captured, it will check the failure address and >> accordingly >> remap the invalid memory for the corresponding device. Besed on this >> mechanism, it could guaranty the application not crash when the >> device be >> hotplug out. >> >> Signed-off-by: Jeff Guo >> Acked-by: Shaopeng He >> --- >> v7->v6: >> delete some unused part. >> --- >> lib/librte_eal/linuxapp/eal/eal_dev.c | 112 >> +++++++++++++++++++++++++++++++++- >> 1 file changed, 111 insertions(+), 1 deletion(-) >> >> diff --git a/lib/librte_eal/linuxapp/eal/eal_dev.c >> b/lib/librte_eal/linuxapp/eal/eal_dev.c >> index 1cf6aeb..0de3fb7 100644 >> --- a/lib/librte_eal/linuxapp/eal/eal_dev.c >> +++ b/lib/librte_eal/linuxapp/eal/eal_dev.c >> @@ -4,6 +4,8 @@ >> #include >> #include >> +#include >> +#include >> #include >> #include >> @@ -14,6 +16,10 @@ >> #include >> #include >> #include >> +#include >> +#include >> +#include >> +#include >> #include "eal_private.h" >> @@ -23,6 +29,16 @@ static bool monitor_started; >> #define EAL_UEV_MSG_LEN 4096 >> #define EAL_UEV_MSG_ELEM_LEN 128 >> +/* >> + * spinlock for device failure process, protect the bus and the device >> + * to avoid race condition. >> + */ >> +static rte_spinlock_t dev_failure_lock = RTE_SPINLOCK_INITIALIZER; > > Sorry, it is still too vague why the lock is required. It is just generic > words. Please, add details and describe circumstance when it is > required. let me check if i can do more for that.