0
votes

Using Ubuntu 20.04.2 LTS and and DPDK 21.02 and following DPDK doc, I performed these commands

sudo modprobe vfio-pci enable_sriov=1
dpdk-devbind.py --bind=vfio-pci 0000:02:00.0
echo 1 > /sys/bus/pci/devices/0000:02:00.0/sriov_numvfs

but trying to create a VF I have this error

alessio@ganimede:~$ sudo su
root@ganimede:/home/alessio# echo 1 > /sys/bus/pci/devices/0000:02:00.0/sriov_numvfs
bash: echo: write error: No such file or directory

even in this way

cd /sys/bus/pci/devices/0000:02:00.0
echo 1 > sriov_numvfs

even if /sys/bus/pci/devices/0000:02:00.0/sriov_numvfs exist. NOTE: with dmesg I see this error

[ 1071.155309] vfio-pci 0000:02:00.0: Driver does not support SRIOV configuration via sysfs

If I try without binding vfio-pci driver but just using kernel one (ixgbe), it works. But using these VF as DPDK ports on my process, it doesn't work, I have to check but seems that packets are not more received.

NOTE: without VF my DPDK process works using vfio-pci driver.

NEW INFO: In this way it works! There was a bug, MAC was wrong and using VF this bug caused application failure. So the question loose part of its interest, in this way works, just the curiosity to know why suggested procedure on DPDK docs does not work.

It is an HOST OS, NIC info are:

driver: ixgbe
version: 5.1.0-k
firmware-version: 0x800003e1

cat /proc/cmdline

BOOT_IMAGE=/vmlinuz-5.4.0-72-generic root=/dev/mapper/ubuntu--vg-ubuntu--lv ro maybe-ubiquity default_hugepagesz=1G hugepagesz=1G hugepages=8 hugepagesz=2M hugepages=1024 intel_iommu=on iommu=pt isolcpus=2,3,4,5,6,7,8,9

Any idea? Thanks

2
can you please share the following information, is the OS host or guest OS, what are kernel cmdline, what is NIC being used? firmware used? as per the question, vfio create is failing on OS or DPDK pF creating VF fails? - Vipin Varghese
are there any updates? - Vipin Varghese

2 Answers

0
votes

For Intel NIC like 82599, X522, and others VF (virtual function) ports can be created from PF (physical function) ports when it is either bind with ixgbe or uio driver like igb_uio. As configuring the Admin queue to set aside rx and tx queue and configure parameter for VF port requires the PF driver.

Unbind from ixgbe (kernel) |igb_uio (dpdk) loses the ability to do so. One maps to vfio-pci for basic functions and Host pass through. Hence the first step dpdk-devbind.py --bind=vfio-pci 0000:02:00.0, is causing the loose of SRIOV VF crete function.

Solution: please bind the device back to kernel ixgbe and create VF. The VF can be bind with vfio-pci for PCIe pass through or running on userspace.

0
votes

I think, this is not universally true any more. This says "Since Linux version 5.7, the vfio-pci module supports the creation of virtual functions."