This topic explains how to use the VFIO driver instead of the UIO driver on Elastic Compute Service (ECS) and Elastic Compute Service Bare Metal instances to resolve runtime issues with Data Plane Development Kit (DPDK) applications.
Prerequisites
Huge pages are configured for the instance. For more information, see How do I adjust the huge page size on a Linux ECS instance?
DPDK is installed on the instance. For more information about DPDK, see Data Plane Development Kit (DPDK*).
Background information
When you deploy DPDK applications on sixth-generation instance types (such as g6, c6, and r6) and later, including General-purpose compute instance types, you may encounter runtime errors. For example, when using the pktgen-dpdk tool for packet forwarding tests, the tool may fail to detect the Network Interface Controller (NIC) bound to the igb_uio driver. If you receive the following error message, use the VFIO driver instead of the UIO driver to resolve the issue.
EAL: eal_parse_sysfs_value(): cannot open sysfs value /sys/bus/pci/devices/0000:00:06.0/uio/uio0/portio/port0/startProcedure
Connect to your ECS instance or ECS Bare Metal Instance.
For more information, see Connect to a Linux instance using Workbench.
Check the GRand Unified Bootloader (GRUB) configuration.
cat /proc/cmdlineAdd
intel_iommu=onto the/etc/default/grubconfiguration file.Open the configuration file.
sudo vim /etc/default/grubPress
ito enter insert mode, addintel_iommu=onto theGRUB_CMDLINE_LINUXparameter, and then save and close the file.The following figure shows an example of the modified configuration.

Apply the new configuration.
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
Run the following command to restart the instance. After the instance restarts, connect to it again.
rebootWarningThe restart operation stops the instance for a short period of time and may interrupt services that are running on the instance. We recommend that you restart the instance during off-peak hours.
Load the VFIO and VFIO-PCI drivers.
sudo modprobe vfio && \ sudo modprobe vfio-pciConfigure the
noiommu_mode.sudo bash -c 'echo 1 > /sys/module/vfio/parameters/enable_unsafe_noiommu_mode'View and record the
bus-infovalue of the NIC.ethtool -i ethXReplace
ethXwith the target NIC's ID. The following figure shows an example for theeth1NIC.
To bind the NIC to the
vfio-pcidriver, navigate to theusertoolsdirectory in your DPDK installation directory and run the following command.sudo ./dpdk-devbind.py -b vfio-pci 0000:00:06.0Note0000:00:06.0is thebus-infovalue that specifies the target NIC. Replace it with your actual value.After the binding is complete, you can run
./dpdk-devbind.py --statusto check the binding status. The following example output indicates that the NIC at0000:00:06.0is bound to thevfio-pcidriver.
To start the DPDK application, navigate to the
build/appdirectory in your DPDK installation directory, and then run the command for your DPDK version.For DPDK 18.02 and later:
sudo ./testpmd -w 0000:00:06.0 -c 0x3 -- --total-num-mbufs=2048 -aiFor versions earlier than DPDK 18.02:
sudo ./testpmd -w 0000:00:06.0 -c 0x3 -- --total-num-mbufs=2048 --disable-hw-vlan -ai
NoteIn the command,
-w 0000:00:06.0specifies the NIC andtotal-num-mbufs=2048must match the configured HugePages size. Replace these values with your actual values.The following figure shows an example of a running DPDK application.

