From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 224D21F5 for ; Thu, 29 Jan 2015 10:28:32 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP; 29 Jan 2015 01:25:14 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,862,1389772800"; d="scan'208";a="446917613" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by FMSMGA003.fm.intel.com with ESMTP; 29 Jan 2015 01:14:37 -0800 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id t0T9SMU2027875 for ; Thu, 29 Jan 2015 17:28:22 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id t0T9SJRC017216 for ; Thu, 29 Jan 2015 17:28:21 +0800 Received: (from dyzhou@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t0T9SJ9c017212 for dev@dpdk.org; Thu, 29 Jan 2015 17:28:19 +0800 From: Danny Zhou To: dev@dpdk.org Date: Thu, 29 Jan 2015 17:28:16 +0800 Message-Id: <1422523699-17181-1-git-send-email-danny.zhou@intel.com> X-Mailer: git-send-email 1.7.4.1 Subject: [dpdk-dev] [PATCH 0/3] Enable uio_pci_generic support 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: Thu, 29 Jan 2015 09:28:33 -0000 Linux kernel provides UIO as well as VFIO mechanism to support writing user space device driver. Comparing to UIO which is available since 2.6.32 kernel, the VFIO is introduced into kernel since version 3.6.0 with better interrupt and memory protection (build on top of Intel VT-d technology) supports. Basically, UIO and VFIO do two common things below: 1) Map PCIe device's I/O memory space to user space driver 2) Support device interrupt notification mechanism that notifies user space driver/application when a device interrupt triggers. To run an DPDK application and make use of VFIO, two in_kernel modules vfio and vfio-pci module must be loaded. To use UIO, a DPDK kernel module igb_uio, which was there since DPDK is invented, must be loaded to attach to in_kernel uio module. As an solution to deprecate igb_uio, this patch serials leverage the uio_pci_generic in_kernel module to support DPDK user space PMD in a generic fashion (similar to how VFIO works), to remove user space DPDK dependency on GPL code igb_uio in kernel. Example to bind Network Ports to uio_pci_generic: modprobe uio modprobe uio_pci_generic /* to bind device 08:00.0, to the uio_pci_generic driver */ ./tools/dpdk_nic_bind.py -b uio_pci_generic 08:00.0 Note: this patch set does not remove igb_uio support due to igb_uio supports creating maximum number of SR-IOV VFs (Virtual Functions) by using max_vfs kernel parameter on older kernels (kernel 3.7.x and below). Specifically, igb_uio explicitly calls pci_enable_sriov() to create VFs, while it is not invoked in either uio or uio_pci_generic kernel modules. On kernel 3.8.x and above, user can use the standard sysfs to enable VFs. For examples: #echo $num_vf_enabled > /sys/class/net/$dev/device/sriov_numvfs //enable VFs #echo 0 > /sys/class/net/$dev/device/sriov_numvfs //disable VFs Danny Zhou (3): eal: add interrupt enable/disable routines for uio_pci_generic eal: enable uio_pci_generic support tools: enable binding NIC device to uio_pci_generic lib/librte_eal/common/include/rte_pci.h | 1 + lib/librte_eal/linuxapp/eal/eal_interrupts.c | 68 +++++-- lib/librte_eal/linuxapp/eal/eal_pci.c | 2 +- lib/librte_eal/linuxapp/eal/eal_pci_uio.c | 202 +++++++++++---------- .../linuxapp/eal/include/exec-env/rte_interrupts.h | 10 +- tools/dpdk_nic_bind.py | 2 +- 6 files changed, 172 insertions(+), 113 deletions(-) -- 1.8.1.4