Virtualization with OOT

This section describes the steps required to enable QAT in a virtualized environment using the OOT package. Details on setting up virtualization with the in-tree stack are included in Running in a Virtual Machine section of QATlib User’s Guide.

Installing Intel QAT on the Host

Note

For complete installation instructions refer to the Getting Started Guide.

Assuming the Intel QAT package dependencies are met, the following steps can be performed to install the Intel QAT driver:

  1. Obtain the official released Intel QAT package: Intel® QuickAssist Technology Driver for Linux* - HW Version 2.0

  2. Configure the Intel QAT driver to enable the SR-IOV feature on the host using the following command:

    ./configure --enable-icp-sriov=host
    
  3. Install the Intel QAT software using the following command:

    sudo make -j install
    
  4. Add your user to the qat group by running the below command, and re-login to make the change effective.

    sudo usermod -a -G qat `whoami`
    sudo su -l $USER
    
  5. Verify the Virtual Functions (VF) have been started using the following command:

    service qat_service status
    

    Note

    Refer to Supported Devices for list of supported devices.

Software Installation on the Host Demo

Here is a demonstration of how to install the Intel QAT software package on the host.


Passing-through the VF to the Guest

Note

When using libvirt, SR-IOV VFs are attached to a guest OS using a xml configuration file.

SR-IOV VF Configuration

Note

virt-manager GUI can be used to pass-through to the guest. The following steps utilize the libvirt command line utility to accomplish the same.

  1. Create the VF device file needed.

    vi VF1.xml
    

    Contents of the file should look like the following. The BDF on the <address bus=...> line will need to be updated for each VF to be mapped:

    <?xml version="1.0" encoding="UTF-8"?>
    <hostdev managed="yes" mode="subsystem" type="pci">
        <source>
        <address bus="0xe9" domain="0x0000" function="0x1" slot="0x00"/>
        </source>
    </hostdev>
    

    Note

    Repeat this process for additional VFs (either in the same file or separate files).

  2. Assign the VF to the guest Virtual Machine (VM).

    The following command removes the VF from the host and attaches the VF to the guest named $VM_NAME:

    virsh nodedev-dettach pci_0000_e9_00_1
    virsh attach-device {$VM_NAME} VF1.xml
    
  3. Remove the VF from the guest VM.

    The following commands can be used to remove the VF from the guest named $VM_NAME and re-attaches the VF to the host:

    virsh detach-device {$VM_NAME} VF1.xml
    virsh nodedev-reattach pci_0000_e9_00_1
    

Installing Intel QAT on the Guest

  1. Verify the Intel QAT devices are assigned.

    lspci | grep -E '4941|4943|4945|4947'
    
  2. Obtain the official released Intel QAT package: Intel® QuickAssist Technology Driver for Linux* - HW Version 2.0

  3. Configure the Intel QAT driver to enable the SR-IOV feature on the guest using the following command:

    ./configure --enable-icp-sriov=guest
    
  4. Install the Intel QAT software and sample codes using the following commands:

    sudo make -j install
    sudo make samples-install
    
  5. Add your user to the qat group by running the below command, and re-login to make the change effective.

    sudo usermod -a -G qat `whoami`
    sudo su -l $USER
    
  6. Verify the Intel QAT software stack has been installed by running the performance sample code:

    cpa_sample_code signOfLife=1 runTests=1|2|4|8|16|32
    

    Note

    Refer to Getting Started Guide for details on the runTests parameter.