I am using dpdk to do user space network IO. But I cannot bind eth0 to vfio-pci.
My environment
What I have done
ifconfig eth0 down
dpdk/usertools/dpdk-devbind.py --status
and getnetwork devices using kernel driver
===================================
0000:02:02.0 '82545EM Gigabit Ethernet Controller (Copper) 100f' if=eth1 drv=e1000 unused=vfio-pci *Active*
Other Network devices
=====================
0000:03:00.0 'VMXNET3 Ethernet Controller 07b0' unused=vmxnet3,vfio-pci
No 'Baseband' devices detected
==============================
No 'Crypto' devices detected
============================
No 'DMA' devices detected
=========================
No 'Eventdev' devices detected
==============================
No 'Mempool' devices detected
=============================
No 'Compress' devices detected
==============================
No 'Misc (rawdev)' devices detected
===================================
No 'Regex' devices detected
===========================
dpdk/usertools/dpdk-devbind.py -b vfio-pci 0000:03:00.0
and getError: bind failed for 0000:03:00.0 - Cannot bind to driver vfio-pci: [Errno 22] Invalid argument
echo 0000:03:00.0 >> /sys/bus/pci/drivers/vfio-pci/bind
and get error echo: write error: Invalid argument
My question is: what is wrong, and how to fix it?
Solve this problem. Bind network card to vfio-pci
You have to enable unsafe mode to bind via VFIO-pci if there is no IOMMU available on the system, VFIO can still be used, but it has to be loaded with an additional module parameter:
modprobe vfio enable_unsafe_noiommu_mode=1
Alternatively, one can also enable this option in an already loaded kernel module:
echo 1 > /sys/module/vfio/parameters/enable_unsafe_noiommu_mode