[dpdk-dev] [PATCH v3 00/12] Add virtio support for arm/arm64

Santosh Shukla sshukla at mvista.com
Thu Jan 7 17:32:57 CET 2016


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



More information about the dev mailing list