From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff Guo Subject: [PATCH v2 0/4] Enable hotplug in vfio Date: Tue, 2 Oct 2018 20:42:16 +0800 Message-ID: <1538484140-96886-1-git-send-email-jia.guo@intel.com> References: <1534503091-31910-1-git-send-email-jia.guo@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: jblunck@infradead.org, shreyansh.jain@nxp.com, dev@dpdk.org, jia.guo@intel.com, helin.zhang@intel.com, jerin.jacob@caviumnetworks.com To: 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, anatoly.burakov@intel.com Return-path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id D40E44C96 for ; Tue, 2 Oct 2018 14:38:38 +0200 (CEST) In-Reply-To: <1534503091-31910-1-git-send-email-jia.guo@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 hot-unplug. But for vfio, when device is be hot-unplugged, 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 hot-unplug. With this mechanism, hotplug could be enable in vfio. patchset history: v3->v2: change some commit log and coding style and typo. v2->v1: change the rte_dev_event_callback_prcess from internal to external api for bus or app usage. change some code logic. Jeff Guo (4): eal: add a new req notifier to eal interrupt eal: modify device event callback process func pci: add req handler field to generic pci device vfio: enable vfio hotplug by req notifier handler app/test-pmd/testpmd.c | 4 +- drivers/bus/pci/linux/pci_vfio.c | 111 +++++++++++++++++++++ drivers/bus/pci/pci_common.c | 10 ++ drivers/bus/pci/rte_bus_pci.h | 1 + lib/librte_eal/bsdapp/eal/eal_dev.c | 8 ++ 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 | 18 +++- 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_eal/rte_eal_version.map | 1 + 12 files changed, 226 insertions(+), 18 deletions(-) -- 2.7.4