From patchwork Fri Aug 17 10:51:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Guo, Jia" X-Patchwork-Id: 43776 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0C1F210A3; Fri, 17 Aug 2018 12:54:17 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id EEC7598 for ; Fri, 17 Aug 2018 12:54:14 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Aug 2018 03:54:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,250,1531810800"; d="scan'208";a="73536775" Received: from jeffguo-z170x-ud5.sh.intel.com (HELO localhost.localdomain) ([10.67.104.10]) by FMSMGA003.fm.intel.com with ESMTP; 17 Aug 2018 03:54:11 -0700 From: Jeff Guo 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 Cc: jblunck@infradead.org, shreyansh.jain@nxp.com, dev@dpdk.org, jia.guo@intel.com, helin.zhang@intel.com Date: Fri, 17 Aug 2018 18:51:26 +0800 Message-Id: <1534503091-31910-1-git-send-email-jia.guo@intel.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Subject: [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: , 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 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. 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(-)