From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 9024298 for ; Tue, 21 Aug 2018 08:45:40 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Aug 2018 23:45:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,268,1531810800"; d="scan'208";a="83538370" Received: from jguo15x-mobl3.ccr.corp.intel.com (HELO [10.67.68.71]) ([10.67.68.71]) by orsmga001.jf.intel.com with ESMTP; 20 Aug 2018 23:45:34 -0700 To: =?UTF-8?Q?Ga=c3=abtan_Rivet?= References: <1534503091-31910-1-git-send-email-jia.guo@intel.com> <20180820091533.yl2wzmvzfxqwo2po@bidouze.vm.6wind.com> Cc: stephen@networkplumber.org, bruce.richardson@intel.com, ferruh.yigit@intel.com, konstantin.ananyev@intel.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, jblunck@infradead.org, shreyansh.jain@nxp.com, dev@dpdk.org, helin.zhang@intel.com From: Jeff Guo Message-ID: <1c5769b1-e196-a209-e19e-b0ea4cb51c4a@intel.com> Date: Tue, 21 Aug 2018 14:45:32 +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: <20180820091533.yl2wzmvzfxqwo2po@bidouze.vm.6wind.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH v1 0/5] Enable hotplug in vfio 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, 21 Aug 2018 06:45:41 -0000 hi, gaetan On 8/20/2018 5:15 PM, Gaëtan Rivet wrote: > Hi Jeff, > > On Fri, Aug 17, 2018 at 06:51:26PM +0800, Jeff Guo wrote: >> As we may know that the process of hotplug is different between igb_uio >> and vfio. For igb_uio, it could use uevent notification and memory >> failure handle mechanism for hotplug. But for vfio, when device is be >> hotplug-out, the uevent can not be detected immediately, because of the >> vfio kernel module will use a special mechanism to guaranty the pci >> device would not be deleted until the user space release the resources, >> so it will use another event “req notifier” at first to notify user space >> to release resources for hotplug. >> >> This patch will add a new interrupt type of req notifier in eal interrupt, >> and add the new interrupt handler in pci device to handle the req device >> event. When the req notifier be detected, it can trigger the device event >> callback process to process for hotplug. With this mechanism, hotplug >> could be enable in vfio. >> > The REQ event seems VFIO specific. > Why not leave it within the PCI bus, around the vfio glue, and leave the > EAL unmodified? Sorry i don' t see if there are any problem. Firstly, as we can see the eal interrupt type, it cover the ext/uio/vfio/dev event types, which are not general for all platform/bus/driver type. so i think base on the current framework, the interrupt type structure should be considerate as combined set, it could extend for other adding interrupts case by case. And secondly, i don't know what is your way about leave it within the PCI bus, because i need to use the eal interrupt epoll to process this req interrupt which is familiar with other interrupts. What do you think about that, if you still have better suggestion, please detail it for clarify. >> Jeff Guo (5): >> eal: add a new req notifier to eal interrupt >> eal: add a new req event to device event >> eal: modify device event callback process func >> pci: add req handler field to generic pci device >> vfio: enable vfio hotplug by req notifier handler >> >> drivers/bus/pci/linux/pci_vfio.c | 104 +++++++++++++++++++++ >> drivers/bus/pci/pci_common.c | 10 ++ >> drivers/bus/pci/rte_bus_pci.h | 1 + >> lib/librte_eal/common/eal_common_dev.c | 5 +- >> lib/librte_eal/common/eal_private.h | 12 --- >> lib/librte_eal/common/include/rte_dev.h | 20 +++- >> lib/librte_eal/common/include/rte_eal_interrupts.h | 1 + >> lib/librte_eal/linuxapp/eal/eal_dev.c | 2 +- >> lib/librte_eal/linuxapp/eal/eal_interrupts.c | 71 ++++++++++++++ >> lib/librte_ethdev/rte_ethdev.c | 3 +- >> 10 files changed, 212 insertions(+), 17 deletions(-) >> >> -- >> 2.7.4 >>