Replace the UIO driver with the VFIO driver on ECS and ECS Bare Metal Instance (EBM) to fix DPDK runtime errors.
Prerequisites
-
Huge pages are configured on the instance.
-
DPDK is installed on the instance.
Background
DPDK applications on sixth-generation instance types (such as g6, c6, and r6) and later may encounter runtime errors. For example, pktgen-dpdk may fail to detect the NIC bound to the igb_uio driver. If you see the following error, replace the UIO driver with the VFIO driver.
EAL: eal_parse_sysfs_value(): cannot open sysfs value /sys/bus/pci/devices/0000:00:06.0/uio/uio0/portio/port0/start
Procedure
-
Connect to your ECS or EBM instance. See Log on to a Linux instance using Workbench.
-
Check the GRUB configuration.
cat /proc/cmdline -
Add
intel_iommu=onto/etc/default/grub.-
Open the file.
sudo vim /etc/default/grub -
Press
ito enter insert mode. Addintel_iommu=onto theGRUB_CMDLINE_LINUXparameter. Save and close the file.Example of the modified configuration:

-
Apply the configuration.
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
-
Restart the instance and reconnect after it starts.
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-pci -
Enable
noiommu_mode.sudo bash -c 'echo 1 > /sys/module/vfio/parameters/enable_unsafe_noiommu_mode' -
Get the
bus-infovalue of the NIC.ethtool -i ethXReplace
ethXwith the target NIC ID. Example foreth1:
-
Bind the NIC to the
vfio-pcidriver. Navigate to theusertoolsdirectory in your DPDK installation directory and run:sudo ./dpdk-devbind.py -b vfio-pci 0000:00:06.0NoteReplace
0000:00:06.0with the actualbus-infovalue of your NIC.Run
./dpdk-devbind.py --statusto verify. The following output shows0000:00:06.0bound tovfio-pci:
-
Start the DPDK application. Navigate to the
build/appdirectory in your DPDK installation directory and run the command for your version.-
For DPDK 18.02 and later:
sudo ./testpmd -w 0000:00:06.0 -c 0x3 -- --total-num-mbufs=2048 -ai -
For versions earlier than DPDK 18.02:
sudo ./testpmd -w 0000:00:06.0 -c 0x3 -- --total-num-mbufs=2048 --disable-hw-vlan -ai
Note-w 0000:00:06.0specifies the NIC.total-num-mbufs=2048must match your huge page size. Replace both with your actual values.Example of a running DPDK application:

-
