Activating virtual functions may fail with errors. Use these examples to resolve common problems.
write error: No such file or directory
If it fails with the following error, it is most likely because the Link-Virtualization™ Software driver is not
loaded.
echo $NUMVF > /sys/bus/pci/devices/$DEV/sriov_numvfs -bash: echo: write error: No such file or directoryTo check whether the Link-Virtualization™ Software driver is loaded, run:
lsmod |grep nt3Load the driver if it is not loaded.
/opt/napatech3/bin/ntload.sh Loading nt3gd driver [Done] Creating driver device file [Done] Loading nt3gd_netdev driver [Done] Creating driver device file [Done]
write error: Cannot allocate memory
It may fail with the following error in 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 memoryYou will find the following error messages in /var/log/dmesg:
nt3gd 0000:03:00.0: sriov configure (res=3) nt3gd 0000:03:00.0: not enough MMIO resources for SR-IOV nt3gd 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.
pci=reallocUpdate grub and reboot the server.
grub2-mkconfig -o /boot/grub2/grub.cfg rebootVerify 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 fileIt is most likely because the noclobber option is enabled by default. To check this option, run:
set -o | grep noclobberAn output example
noclobber onThis 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 noclobberOr you can bypass the noclobber restriction by using the >| redirection operator.
echo $NUMVF >| /sys/bus/pci/devices/$DEV/sriov_numvfs