Skip to content

Enable uio_pci_generic support

Zhou Danny dpdk-dev 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 2 repliesIn review
  2. v13 patches 4 repliesSuperseded

Changes in v2 from the cover letter

- Change variable name of kernel driver with precise comment
- Fix a union definition error in v1 patchset
- Move redefined macro IORESOURCE_MEM to rte_pci.h with comment

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3eal: enable uio_pci_generic supportlib/librte_eal/common/include/rte_pci.h lib/librte_eal/linuxapp/eal/eal_pci.c lib/librte_eal/linuxapp/eal/eal_pci_uio.c +1 more+122 -982 replies
2/3eal: add interrupt enable/disable routines for uio_pci_genericlib/librte_eal/linuxapp/eal/eal_interrupts.c+52 -160 replies
3/3tools: enable binding NIC device to uio_pci_generictools/dpdk_nic_bind.py+1 -10 replies

Reviews trailers per patch

None of the 3 patches has a Reviewed-by or Acked-by.

PatchQun Wan
SeriesT-b T-b
1/3T-b
2/3T-b
3/3T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/3] Enable uio_pci_generic support

v2 changes:
- Change variable name of kernel driver with precise comment
- Fix a union definition error in v1 patchset
- Move redefined macro IORESOURCE_MEM to rte_pci.h with comment

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: enable uio_pci_generic support
eal: add interrupt enable/disable routines for uio_pci_generic
tools: enable binding NIC device to uio_pci_generic

 lib/librte_eal/common/include/rte_pci.h            |   4 +
 lib/librte_eal/linuxapp/eal/eal_interrupts.c       |  68 +++++--
 lib/librte_eal/linuxapp/eal/eal_pci.c              |   4 +-
 lib/librte_eal/linuxapp/eal/eal_pci_uio.c          | 204 +++++++++++----------
 .../linuxapp/eal/include/exec-env/rte_interrupts.h |   8 +-
 tools/dpdk_nic_bind.py                             |   2 +-
 6 files changed, 175 insertions(+), 115 deletions(-)
Signature · 1 line
1.8.1.4