From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id D50C8AFD6 for ; Mon, 19 May 2014 17:52:08 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 19 May 2014 08:52:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.98,868,1392192000"; d="scan'208";a="542927585" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga002.jf.intel.com with ESMTP; 19 May 2014 08:52:06 -0700 Received: from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com [10.237.217.46]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id s4JFq5bY003629; Mon, 19 May 2014 16:52:05 +0100 Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id s4JFq5VU025021; Mon, 19 May 2014 16:52:05 +0100 Received: (from aburakov@localhost) by sivswdev02.ir.intel.com with id s4JFq4Qa025017; Mon, 19 May 2014 16:52:04 +0100 From: Anatoly Burakov To: dev@dpdk.org Date: Mon, 19 May 2014 16:51:33 +0100 Message-Id: <1400514709-24087-1-git-send-email-anatoly.burakov@intel.com> X-Mailer: git-send-email 1.7.0.7 In-Reply-To: References: Subject: [dpdk-dev] [PATCH v2 00/16] Add VFIO support to DPDK X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 May 2014 15:52:11 -0000 This patchset adds support for using VFIO instead of IGB_UIO to map the device BARs. VFIO is a kernel 3.6+ driver allowing secure DMA from userspace by means of using IOMMU instead of working directly with physical memory like igb_uio does. Short summary: * Adding support for VFIO in EAL PCI code * Adding new command-line parameter for VFIO interrupt type * Adding support for VFIO in setup.sh * Renaming igb_uio_bind to dpdk_nic_bind and adding support for VFIO there * Removing PCI ID list from igb_uio, effectively making it another generic PCI driver similar to pci_stub, vfio-pci et al * Adding autotest for VFIO interrupt types * Making igb_uio and VFIO compilation optional v2 changes: fixed a couple of resource leaks Based off commit 356cb732d5381140f42ef8b55492339579854986 Anatoly Burakov (16): Separate igb_uio mapping into a separate file Distinguish between legitimate failures and non-fatal errors Rename RTE_PCI_DRV_NEED_IGB_UIO to RTE_PCI_DRV_NEED_MAPPING Make igb_uio compilation optional Moved interrupt type out of igb_uio Add support for VFIO in Linuxapp targets Add support for VFIO interrupts, add VFIO header Add support for mapping devices through VFIO. Enable VFIO device binding Added support for selecting VFIO interrupt type from EAL command-line Make --no-huge use mmap instead of malloc Adding unit tests for VFIO EAL command-line parameter Removed PCI ID table from igb_uio Renamed igb_uio_bind to dpdk_nic_bind Added support for VFIO drivers in dpdk_nic_bind.py Adding support for VFIO to setup.sh app/test/test_eal_flags.c | 24 + app/test/test_pci.c | 4 +- config/defconfig_i686-default-linuxapp-gcc | 2 + config/defconfig_i686-default-linuxapp-icc | 2 + config/defconfig_x86_64-default-linuxapp-gcc | 2 + config/defconfig_x86_64-default-linuxapp-icc | 2 + lib/librte_eal/bsdapp/eal/eal_pci.c | 2 +- lib/librte_eal/common/Makefile | 1 + lib/librte_eal/common/eal_common_pci.c | 16 +- lib/librte_eal/common/include/rte_pci.h | 7 +- .../common/include/rte_pci_dev_feature_defs.h | 46 ++ .../common/include/rte_pci_dev_features.h | 40 ++ lib/librte_eal/linuxapp/Makefile | 2 + lib/librte_eal/linuxapp/eal/Makefile | 6 +- lib/librte_eal/linuxapp/eal/eal.c | 33 + lib/librte_eal/linuxapp/eal/eal_interrupts.c | 203 ++++++- lib/librte_eal/linuxapp/eal/eal_memory.c | 8 +- lib/librte_eal/linuxapp/eal/eal_pci.c | 486 ++------------ lib/librte_eal/linuxapp/eal/eal_pci_uio.c | 403 +++++++++++ lib/librte_eal/linuxapp/eal/eal_pci_vfio.c | 719 ++++++++++++++++++++ lib/librte_eal/linuxapp/eal/eal_pci_vfio_socket.c | 367 ++++++++++ .../linuxapp/eal/include/eal_internal_cfg.h | 3 + lib/librte_eal/linuxapp/eal/include/eal_pci_init.h | 120 ++++ lib/librte_eal/linuxapp/eal/include/eal_vfio.h | 55 ++ .../linuxapp/eal/include/exec-env/rte_interrupts.h | 3 + lib/librte_eal/linuxapp/igb_uio/igb_uio.c | 70 +-- lib/librte_pmd_e1000/em_ethdev.c | 2 +- lib/librte_pmd_e1000/igb_ethdev.c | 4 +- lib/librte_pmd_ixgbe/ixgbe_ethdev.c | 4 +- lib/librte_pmd_vmxnet3/vmxnet3_ethdev.c | 2 +- tools/{igb_uio_bind.py => dpdk_nic_bind.py} | 163 +++-- tools/setup.sh | 168 ++++- 32 files changed, 2380 insertions(+), 589 deletions(-) create mode 100644 lib/librte_eal/common/include/rte_pci_dev_feature_defs.h create mode 100644 lib/librte_eal/common/include/rte_pci_dev_features.h create mode 100644 lib/librte_eal/linuxapp/eal/eal_pci_uio.c create mode 100644 lib/librte_eal/linuxapp/eal/eal_pci_vfio.c create mode 100644 lib/librte_eal/linuxapp/eal/eal_pci_vfio_socket.c create mode 100644 lib/librte_eal/linuxapp/eal/include/eal_pci_init.h create mode 100644 lib/librte_eal/linuxapp/eal/include/eal_vfio.h rename tools/{igb_uio_bind.py => dpdk_nic_bind.py} (82%)