7.1. Updating Settings Required for VFs
To use SR-IOV and pass a VF to a virtual machine, you must enable the Intel IOMMU
driver on the host. Complete the following steps to enable the Intel IOMMU driver:
1. Add
intel_iommu=on
to the
GRUB_CMDLINE_LINUX
entry by updating the GRUB
configuration file.
2. GRUB reads its configuration from either the
/boot/grub2/grub.cfg
file on
traditional BIOS-based machines or from the
/boot/efi/EFI/redhat/
grub.cfg
file on UEFI machines. Depending on your system, execute one of the
instructions below:
•
BIOS based machine:
grub2-mkconfig -o /boot/grub2/grub.cfg
•
UEFI based machine:
grub2-mkconfig -o /boot/efi/EFI/redhat/
grub.cfg
3. Restart to apply the new GRUB configuration file.
4. To verify the GRUB update, run the following command:
cat /proc/cmdline
The sample output below shows
intel_iommu=on
on the kernel command line.
Sample output:
BOOT_IMAGE=/vmlinuz-3.10.0-514.21.1.el7.x86_64
root=/dev/mapper/cl_<server_name>-root ro intel_iommu=on
crashkernel=auto rd.lvm.lv=cl_<server_name>/root
rd.lvm.lv=cl_<server_name>/swap rhgb quiet
7.2. Configuring the VF Port on the Host
By default, the PF controls the AFU port. The following procedure transfers AFU control
to the VF. After the transfer to VF control, applications running on the VM can access
the AFU.
In a multi-card system, if you want to configure the VF on only a single PCIe device,
run below command to find the device mapping for the specific PCIe:
ls -l /sys/class/fpga/intel-fpga-dev.*
Sample output:
/sys/class/fpga/intel-fpga-dev.0 -> ../../devices/
pci0000:36/0000:36:00.0/0000:37:00.0/fpga/intel-fpga-dev.0
/sys/class/fpga/intel-fpga-dev.1 -> ../../devices/pci0000:ae/
0000:ae:00.0/0000:af:00.0/fpga/intel-fpga-dev.1
To target PCIe
B:D.F (AF:00.0)
and
B:D.F (37:00.0)
in the following
commands, use instance id 1 and 0 instead of * respectively.
1. Run the following commands to export the required paths:
export port_path=$(find /sys/class/fpga/intel-fpga-dev.* \
-maxdepth 1 -follow -iname intel-fpga-port.*)
export link_path=$(readlink -m /$port_path/../)
export pci_path=$link_path/../../
7. Running the OPAE in a Virtualized Environment
UG-20202 | 2019.08.05
Intel Acceleration Stack Quick Start Guide: Intel FPGA Programmable
Acceleration Card D5005
21