From patchwork Mon Jul 15 07:52:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tiwei Bie X-Patchwork-Id: 56422 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 BEEA91B94F; Mon, 15 Jul 2019 09:54:11 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 7D43E322C for ; Mon, 15 Jul 2019 09:54:10 +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 fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Jul 2019 00:54:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,493,1557212400"; d="scan'208";a="175025601" Received: from npg-dpdk-virtio-tbie-2.sh.intel.com ([10.67.104.66]) by FMSMGA003.fm.intel.com with ESMTP; 15 Jul 2019 00:54:08 -0700 From: Tiwei Bie To: dev@dpdk.org Cc: ferruh.yigit@intel.com, anatoly.burakov@intel.com, bruce.richardson@intel.com, keith.wiles@intel.com, david.marchand@redhat.com, alejandro.lucero@netronome.com, cunming.liang@intel.com Date: Mon, 15 Jul 2019 15:52:09 +0800 Message-Id: <20190715075214.16616-1-tiwei.bie@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190403071844.21126-1-tiwei.bie@intel.com> References: <20190403071844.21126-1-tiwei.bie@intel.com> Subject: [dpdk-dev] [RFC v2 0/5] Add mdev (Mediated device) support in DPDK 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" Hi everyone, This is a draft implementation of the mdev (Mediated device [1]) support in DPDK PCI bus driver. Mdev is a way to virtualize devices in Linux kernel. Based on the device-api (mdev_type/device_api), there could be different types of mdev devices (e.g. vfio-pci). In this RFCv2, the PCI bus driver is extended to support scanning and probing the mdev devices whose device-api is "vfio-pci". +---------+ | PCI bus | +----+----+ | +--------+-------+-------+--------+ | | | | Physical PCI devices ... Mediated PCI devices ... RFCv2: - Let PCI bus scan mediated PCI devices directly - Address Keith's comments - Merge below patch into this series (David) http://patches.dpdk.org/patch/55927/ - Add internal representation of PCI device (David) - Minor fixes and improvements [1] https://github.com/torvalds/linux/blob/master/Documentation/vfio-mediated-device.txt Thanks, Tiwei Tiwei Bie (5): bus/pci: introduce an internal representation of PCI device bus/pci: avoid depending on private value in kernel source bus/pci: introduce helper for MMIO read and write eal: add a helper for reading string from sysfs bus/pci: add mdev support drivers/bus/pci/bsd/pci.c | 36 ++- drivers/bus/pci/linux/Makefile | 1 + drivers/bus/pci/linux/pci.c | 105 ++++++-- drivers/bus/pci/linux/pci_init.h | 29 ++- drivers/bus/pci/linux/pci_uio.c | 22 ++ drivers/bus/pci/linux/pci_vfio.c | 314 ++++++++++++++++++++---- drivers/bus/pci/linux/pci_vfio_mdev.c | 236 ++++++++++++++++++ drivers/bus/pci/meson.build | 3 +- drivers/bus/pci/pci_common.c | 31 +-- drivers/bus/pci/private.h | 22 ++ drivers/bus/pci/rte_bus_pci.h | 65 ++++- drivers/bus/pci/rte_bus_pci_version.map | 7 + lib/librte_eal/common/eal_filesystem.h | 10 + lib/librte_eal/freebsd/eal/eal.c | 22 ++ lib/librte_eal/linux/eal/eal.c | 39 ++- lib/librte_eal/rte_eal_version.map | 1 + 16 files changed, 838 insertions(+), 105 deletions(-) create mode 100644 drivers/bus/pci/linux/pci_vfio_mdev.c