Common Problems and Solutions Activating Virtual Functions

Getting Started with Napatech Link-Virtualization™ Software

Napatech SmartNIC
Content Type
Getting Started
Getting Started Guide
Capture Software Version
Link-Virtualization™ Software 4.5

Activating virtual functions may fail with errors. Use these examples to resolve common problems.

write error: Cannot allocate memory

It may fail with the following error with some old servers or some servers with old BIOS versions.
echo $NUMVF > /sys/bus/pci/devices/$DEV/sriov_numvfs
-bash: echo: write error: Cannot allocate memory
You will find the following error messages in /var/log/dmesg:
vfio-pci 0000:03:00.0: sriov configure (res=3)
vfio-pci 0000:03:00.0: not enough MMIO resources for SR-IOV
vfio-pci 0000:03:00.0: sriov configure (res=-12)
It is because the BIOS is not providing enough MMIO space for VFs. You may have to upgrade BIOS. This issue can also be resolved by adding the kernel parameter, pci=realloc. It enables reallocating PCI bridge resources to accommodate required resource. Edit the /etc/default/grub file and append the following kernel parameter to the existing GRUB_CMDLINE_LINUX line.
Update grub and reboot the server.
grub2-mkconfig -o /boot/grub2/grub.cfg
Verify the kernel parameters.
cat /proc/cmdline

cannot overwrite existing file

It may fail with the following error.
echo $NUMVF > /sys/bus/pci/devices/$DEV/sriov_numvfs
-bash: /sys/bus/pci/devices/<device_ID>/sriov_numvfs: cannot overwrite existing file
It is most likely because the noclobber option is enabled by default. To check this option, run:
set -o | grep noclobber
An output example
noclobber       on
This means that overwriting the contents of a file using shell redirection ( the > and >> operators) is not allowed in a command line interface. To disable the noclobber option, run:
set +o noclobber
Or you can bypass the noclobber restriction by using the >| redirection operator.
echo $NUMVF >| /sys/bus/pci/devices/$DEV/sriov_numvfs