From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff Guo Subject: Re: [PATCH v1 5/5] vfio: enable vfio hotplug by req notifier handler Date: Sat, 29 Sep 2018 13:51:39 +0800 Message-ID: <980bc22f-760e-623d-b985-876d93604f6e@intel.com> References: <1534503091-31910-1-git-send-email-jia.guo@intel.com> <1534503091-31910-6-git-send-email-jia.guo@intel.com> <5ee29fb1-3e92-1555-e1ae-77d5d137c26d@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Cc: jblunck@infradead.org, shreyansh.jain@nxp.com, dev@dpdk.org, helin.zhang@intel.com To: "Burakov, Anatoly" , 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, arybchenko@solarflare.com Return-path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id EA08A1B0F9 for ; Sat, 29 Sep 2018 07:52:43 +0200 (CEST) In-Reply-To: <5ee29fb1-3e92-1555-e1ae-77d5d137c26d@intel.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Anatoly, thanks for your review, please see comment as below. On 9/26/2018 8:28 PM, Burakov, Anatoly wrote: > On 17-Aug-18 11:51 AM, Jeff Guo wrote: >> This patch will add req notifier processing to enable hotplug for vfio. >> When device is be hotplug-out, the vfio kernel module will sent req >> notifier to request user space to release the allocated resources. It >> could use the bus failure mechanism to trigger the currently hotplug >> procedure of user space. After that, vfio kernel module will detect the >> device disappear, and then release the kernel resource of the device. >> >> Signed-off-by: Jeff Guo >> --- > > > >> +     * resources before resources be released in kernel, so it can >> directly >> +     * call the bus failure handler to use the specific mechanism in >> +     * user space to handle it. >> +     */ >> +    ret = bus->memory_failure_handler(device); >> +    if (ret) { >> +        RTE_LOG(ERR, EAL, "Can not handle failure for " >> +            "device (%s)\n", device->name); >> +        return; > > Return is not needed here :) > > Otherwise, LGTM > yes, will modify it.