Multi Channel DMA Intel® FPGA IP for PCI Express* Design Example User Guide

ID 683517
Date 6/09/2025
Public
Document Table of Contents

3.5.8.1.1. Install the Linux Kernel Driver

Both UIO and VFIO drivers are supported. Either one can be used.

User Space I/O (UIO): A kernel base module that the PCIe device uses to expose its resources to the user space.

Virtual Function I/O (VFIO) driver: An IOMMU/device agnostic framework for exposing direct device access to the user space in a secure, IOMMU-protected environment.

Steps for UIO driver installation:

  1. In the host system, install the UIO driver by running the following command if you are proceeding with UIO support. If you are proceeding with VFIO, this step is not required:

    $ sudo modprobe uio

  2. Install "make".
    1. Check if "make" is installed using the following command:

      $ make --version

    2. Install "make" using the following command:

      $ sudo apt install make

  3. Build the mcdma kernel driver and load:
    1. $ make clean all -C p0_software/kernel/driver/kmod/mcdma-custom-driver
    2. $ sudo insmod p0_software/kernel/driver/kmod/mcdma-custom-driver/ifc_uio.ko
  4. Verify whether the driver is loaded or not:

    $ lspci -d 1172:000 -v | grep ifc_uio

    (Kernel driver in use: ifc_uio)

Steps for VFIO driver installation:

This section can be bypassed if you are proceeding with UIO. Unlike UIO, the design example with and without SR-IOV enabled needs to be handled differently when using the VFIO Linux Kernel driver. PFs and their VFs should not be bound to the VFIO driver at the same time. PFs should bind to the ifc_uio driver, and VFs should bind to the VFIO driver.

  1. To use the VFIO Linux Kernel driver for the design example with SR-IOV enabled, create two copies of the software driver, p0_software, which is generated along with the design example in the host system, one for PFs and the other for VFs. If you are testing a design example without SR-IOV, skip to step 4.
  2. Follow the steps outlined in Steps for UIO driver installation to install the UIO Linux kernel driver for PFs, then follow the instructions in Enable Virtual Function to enable the VFs.
  3. Unbind the VFs from ifc_uio by using the following command:

    $ echo "<bdf>" | sudo tee /sys/bus/pci/devices/<bdf>/driver/unbind

    E.g: echo "0000:01:00.0" | sudo tee /sys/bus/pci/devices/0000\:01\:00.0/driver/unbind

  4. Before installing the VFIO driver, undefine UIO_SUPPORT in

    p0_software/user/common/mk/common.mk as shown below:

    __cflags += -UUIO_SUPPORT

    Note: For design examples with SR-IOV enabled or PFs which are bound to the ifc_uio driver, use a separate copy of the p0_software folder to undefine UIO_SUPPORT for the VFIO Linux Kernel driver installation.
  5. Install the vfio-pci module by running the following command:

    $ sudo modprobe vfio-pci

  6. Bind the device to vfio-pci using the following command:

    $ echo <PCI Vendor ID> <PCI Device ID> | sudo tee /sys/bus/pci/drivers/vfio-pci/new_id

    Example: echo 1172 0000 | sudo tee /sys/bus/pci/drivers/vfio-pci/new_id