Ensuring that Intel® QuickAssist Technology stack is working correctly on RHEL

Updated -

Environment

  • Red Hat Enterprise Linux 8
  • Red Hat Enterprise Linux 9
  • Red Hat Enterprise Linux 10

Intel® QuickAssist Technology Library (QATlib) contains user space libraries that allow access for Intel® QAT devices. The libraries also expose Intel® QAT APIs and sample code. To get QATlib up and running:

  1. Create the qat user group.

    $ sudo groupadd qat
    
  2. Add your user to the qat group to use QATlib functionalities as non-root user.

    $ sudo usermod -a -G qat <YOUR_USER>
    
  3. Set the maximum amount of locked memory for your user to 200MB.

    # echo `whoami` - memlock 200000 >> /etc/security/limits.conf
    
  4. Add the intel_iommu=on parameter to the kernel command-line.

    $ sudo grubby --update-kernel=ALL --args="intel_iommu=on"
    
  5. Make sure you have the needed firmware files qat_4xxx.bin and qat_4xxx_mmp.bin. We already ship these with the linux-firmware package since versions 20230404-114.git2e92a49f.el8_8 or 20230310-133.el9_2. It is sufficient to just update this package and reboot if needed.

  6. If the driver did not load automatically after reboot, load it manually.

    $ modprobe qat_4xxx
    

    Verify that the qat_4xxx firmware was loaded correctly.

    $ dmesg -i -e | grep qat_4xxx
    
  7. Enable and start the qat service and verify the service is running correctly.

    $ sudo systemctl enable --now qat
    $ systemctl is-enabled qat && systemctl is-active qat
    enabled
    active
    

Additional configuration and fine-tuning

It may be necessary to reconfigure QAT device(s) with the following (unsupported, unshipped) Intel script used to control the qatlib stack:

https://intel.github.io/quickassist/_downloads/74bdfa2cd6bb4987b51a4f550d8f26ba/qat

mentioned in the following Intel documentation:

https://intel.github.io/quickassist/qatlib/configuration.html

and follow this configuration guide. Check out this guide for details on possible configurations. This can be necessary due to the following qatengine error (zero engines are configured for enc/decryption):

QAT HW initialization Failed.
speed: unable to load provider qatprovider
80F28A3AFA7F0000:error:410000CF:lib(130)::reason(207):qat_hw_init.c:547:
80F28A3AFA7F0000:error:078C0105:common libcrypto routines:provider_init:init fail:crypto/provider_core.c:1045:name=qatprovider

or the following qatzip error (zero engines are configured for de/compression):

[error] cpaDcGetInstances() - : Invalid API Param - numInstances is 0

To use the above script, download the script and run:

### RHEL-10
dnf install -y python3 python3-prettytable python3-packaging

### RHEL-9: python3-prettytable is not compatible with the "qat" script
### OR if python3-prettytable or python3-packaging are not available
dnf install -y python3 python3-pip
pip3 install prettytable packaging

### check engines status
python3 qat --status

### set all engines to enc/decryption ("sym;asym" mode)
python3 qat --config --mode 1

### set all engines to de/compression ("dc" mode)
python3 qat --config --mode 2

Additional resources about utilities from the QAT ecosystem:

For more information about installing QATlib, see the GitHub qatlib/INSTALL page.
For more information about the QATlib technology in general, see Intel® QuickAssist Technology Library (QATlib).
For introduction and description of the QAT OpenSSL Engine, see Intel® QuickAssist Technology(QAT) OpenSSL* Engine.
For introduction and description of the QATzip library, see Intel® QuickAssist Technology (QAT) QATzip Library.
For list if supported devices, see Supported Devices.
Intel QAT Configuration and Tuning Guide.

Comments