From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f43.google.com (mail-pa0-f43.google.com [209.85.220.43]) by dpdk.org (Postfix) with ESMTP id 9A02695DD for ; Thu, 7 Jan 2016 17:34:08 +0100 (CET) Received: by mail-pa0-f43.google.com with SMTP id ho8so1666041pac.2 for ; Thu, 07 Jan 2016 08:34:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mvista-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version:content-type :content-transfer-encoding; bh=QwSrfQoq4/Adwsxzb3ieVVsJWWbYU0LdQ5YsWvkfeCY=; b=oB6qU6AXUogXQzoxT3/b3IjMCRfpG+njs0TnyNUiQmbkl88oSN4RnKkMXukZ4eUV5Z BU1Aawk/NmSOyvKJ8wPp8/JJsS90fnfsV08SZFQYgTb3sSotRmj+G8OQ3mAY5LQj2eF7 oDt6mi48daPRb5sGGXK6VpitaN35LbSG0C6wN7DzXXuAdt+HxNw0LvUVTdHTRPdfpFHl T0hCecqMsgoJUIQ7/8eebqEKJ/GDd3+7XeQjsuIVI/5CA64EAraxPEw1eUrSMfh0xuOo utN2D8vLBXzoSihC863yhHRf5319rQ9FYanPyLiaycyUyhHmpvYg5dl0FALkvjAxchbk VPsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-type:content-transfer-encoding; bh=QwSrfQoq4/Adwsxzb3ieVVsJWWbYU0LdQ5YsWvkfeCY=; b=RE5S58wXcVGvjDDkKQFzczRGXU4RLLMhr8CtFMoeBWIP2Poe5mcdz3Xcz/f7VBl1qF OdQIlYCCtDToJhkX8gyHpiw6nEyQkljqkijQM1OFvZMTE5H2tB7Z2oIwAqGNH2+ESjzY piY5V9T40sZxQdzMD6inH8u4D5Y2uv5BKL1QhAE/jzIlCuheCYItGjxaZIcGWgb45FiF ELqxoLndaAsBuua+pC9uWjfjAcqttgqgwg32xC13cxK094tzCeAXcDXV/kzuMBofY0L4 B4MlNnS++Swq1V0szJJRA5ZjzXX7ztvJ7AaHUHq7yABCieYNPW/na/Qm78CdhTYjSEiW tbIw== X-Gm-Message-State: ALoCoQn5herNRNvj+pWFe7EAAdnUZoZG+MakwAoVifUUx6xiruotjmr+UZjJZfMf1eW6EXbm58tkbOuBbHoYlaKafiO80Fktxg== X-Received: by 10.66.158.129 with SMTP id wu1mr152867796pab.146.1452184447812; Thu, 07 Jan 2016 08:34:07 -0800 (PST) Received: from santosh-Latitude-E5530-non-vPro.mvista.com ([111.93.218.67]) by smtp.gmail.com with ESMTPSA id yn8sm159454163pac.32.2016.01.07.08.34.04 (version=TLS1_1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 07 Jan 2016 08:34:06 -0800 (PST) From: Santosh Shukla To: dev@dpdk.org Date: Thu, 7 Jan 2016 22:02:57 +0530 Message-Id: <1452184390-5994-1-git-send-email-sshukla@mvista.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3 00/12] Add virtio support for arm/arm64 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, 07 Jan 2016 16:34:09 -0000 This v3 patch uses vfio-noiommu-way to access virtio-net pci interface. Tested for arm64 thunderX platform. Patch builds for x86/i386/arm/armv8/thunderX. The patchset has below dependancy: - Kernel should be patched with Alex vfio-noiommu patch, available at linuz-next [1]. - Anatoly's dpdk patch for vfio-noimmu, Included in this patch series but not for review :), It exist in this patchset only for user to pick complete blob and try it out. Some Caveat: - Only for x86 platform: Either of the config should be enable RTE_EAL_VFIO or IGB_UIO Right now by default both enabled. It lead to virtio pmd driver init error, as because v3 appraoch depends on RTE_PCI_DRV_NEED_MAPPING flag so ioport resource field wont update for IGB_UO case. I am working on below approach - Introduce new drv_flag which does not do mapping (as v3 vfio approach doesn't care for mapping) and only initializes pci interface for PCI bars (in particualr ioport pci bar) rd/wr operation. It will be useful to rd/wr pci bars, Currently required for vfio/virtio case. v3: Major changes: - Patch set uses vfio-noimmu approach to access virtio ioport bar - Dropped rte_io.h abstraction changes done in v2 series as because vfio-noimmu doesn't do rd/wr access on mmaped memory so wont care for x86 style api ie.. in/out[b,w,l] Although I am working on other patch series which will get rid of ifdef "sys/io.h" clutter. Patch summary: - Top 3 patches are old v2 patch - 4 to 9 patches are vfio/virtio specifics. - 10th patch is v2 patch - Last patch is build fix patch of anatoly(s) vfio-noiommu patch. v2: - Removed ifdef arm.. clutter from igb_uio / virtio_ethedev files - Introduced rte_io.h header file in generic/ and arch specifics i.e.. for armv7 --> rte_io_32.h, for armv8 --> rte_io_64.h. - Removed RTE_ARCH_X86 ifdef clutter too and added rte_io.h header which nothing but wraps sys/io.h for x86_64 and i686 - Moved all the RTE_ARCH_ARM/64 dependancy for igb_uio case to separate header file named igbuio_ioport_misc.h. Now igb_uio.c will call only three function - igbuio_iomap - igbuio_ioport_register - igbuio_ioport_unregister - Moved ARM/64 specific definition to include/exec-env/rte_virt_ioport.h header - Included virtio_ioport.c/h; has all private and public api required to map iopci bar for non-x86 arch. Tested on thunderX and x86_64 both. Private api includes: - virtio_map_ioport - virtio_set_ioport_addr Public api includes: - virtio_ioport_init - virtio_ioport_unmap - Last patch is the miscllanious format specifier fix identifid for 64bit case during regression. v1: - First patch adds RTE_VIRTIO_INC_VECTOR config, much needed for archs like arm/arm64 as they don't support vectored implementation, also wont able to build. - Second patch is in-general fix for i686. - Third patch is to emulate x86-style of {in,out}[b,w,l] api support for armv7/v8. As virtio-net-pci pmd driver uses those apis for port rd/wr {b,w,l} - Fourth patch to enable VIRTIO_PMD feature in armv7/v8/thunderX config. - Fifth patch to disable iopl syscall, As arm/arm64 linux kernel doesn't support them. - Sixth patch introduces ioport memdevice called /dev/igb_ioport by which virtio pmd driver could able to rd/wr PCI_IOBAR. {applicable for arm/arm64 only, tested for arm64 as of now} [1] https://lwn.net/Articles/660745/ Anatoly Burakov (1): vfio: Support for no-IOMMU mode Rizwan Ansari (1): eal: pci: vfio: fix build error Santosh Shukla (10): virtio: Introduce config RTE_VIRTIO_INC_VECTOR config: i686: set RTE_VIRTIO_INC_VECTOR=n linuxapp: eal: arm: Always return 0 for rte_eal_iopl_init() linuxapp/vfio: ignore mapping for ioport region virtio_pci.h: build fix for sys/io.h for non-x86 arch eal: pci: vfio: add rd/wr func for pci bar space virtio: vfio: add api support to rd/wr ioport bar virtio: Add capability to initialize driver for vfio interface virtio: vfio: Enable RTE_PCI_DRV_NEED_MAPPING flag in driver config: armv7/v8: Enable RTE_LIBRTE_VIRTIO_PMD config/common_linuxapp | 1 + config/defconfig_arm-armv7a-linuxapp-gcc | 6 +- config/defconfig_arm64-armv8a-linuxapp-gcc | 6 +- config/defconfig_i686-native-linuxapp-gcc | 1 + config/defconfig_i686-native-linuxapp-icc | 1 + drivers/net/virtio/Makefile | 2 +- drivers/net/virtio/virtio_ethdev.c | 15 +- drivers/net/virtio/virtio_pci.h | 11 ++ drivers/net/virtio/virtio_rxtx.c | 7 + drivers/net/virtio/virtio_vfio.h | 146 ++++++++++++++++++ lib/librte_eal/common/include/rte_pci.h | 38 +++++ lib/librte_eal/linuxapp/eal/Makefile | 1 + lib/librte_eal/linuxapp/eal/eal.c | 3 + lib/librte_eal/linuxapp/eal/eal_pci.c | 28 ++++ lib/librte_eal/linuxapp/eal/eal_pci_init.h | 28 ++++ lib/librte_eal/linuxapp/eal/eal_pci_vfio.c | 191 +++++++++++++++++------- lib/librte_eal/linuxapp/eal/eal_pci_vfio_dma.c | 84 +++++++++++ lib/librte_eal/linuxapp/eal/eal_vfio.h | 5 + 18 files changed, 517 insertions(+), 57 deletions(-) create mode 100644 drivers/net/virtio/virtio_vfio.h create mode 100644 lib/librte_eal/linuxapp/eal/eal_pci_vfio_dma.c -- 1.7.9.5