From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [67.231.154.164]) by dpdk.org (Postfix) with ESMTP id C731D1B43A for ; Mon, 9 Jul 2018 15:51:12 +0200 (CEST) X-Virus-Scanned: Proofpoint Essentials engine Received: from webmail.solarflare.com (webmail.solarflare.com [12.187.104.26]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1-us1.ppe-hosted.com (Proofpoint Essentials ESMTP Server) with ESMTPS id 6FC95B0005C; Mon, 9 Jul 2018 13:51:11 +0000 (UTC) Received: from [192.168.1.16] (85.187.13.33) by ocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server (TLS) id 15.0.1044.25; Mon, 9 Jul 2018 06:51:01 -0700 To: Jeff Guo , , , , , , , , , , , , , , , CC: , , , 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> From: Andrew Rybchenko Message-ID: Date: Mon, 9 Jul 2018 16:50:56 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <1531137666-10351-7-git-send-email-jia.guo@intel.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [85.187.13.33] X-ClientProxiedBy: ocex03.SolarFlarecom.com (10.20.40.36) To ocex03.SolarFlarecom.com (10.20.40.36) X-MDID: 1531144272-f7-xeRGbT0nf 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: Mon, 09 Jul 2018 13:51:13 -0000 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.