Overview
The QAT hardware driver requires configuration files to define the number of crypto instances, services enabled, and memory management options. This page covers driver configuration for Out-of-Tree (OOT) drivers.In-tree drivers (qatlib) do not use configuration files. Instead, they are managed through policy settings in
/etc/sysconfig/qat. See the qatlib installation guide for details.Configuration Files Location
QAT driver configuration files are typically located in/etc and follow naming patterns like:
- QAT Gen4 (4xxx):
/etc/4xxx_dev0.conf,/etc/4xxx_dev1.conf, etc. - QAT Gen3 (c6xx):
/etc/c6xx_dev0.conf,/etc/c6xx_dev1.conf, etc. - QAT Gen2 (dh895xcc):
/etc/dh895xcc_dev0.conf, etc.
The update_config.sh Script
The QAT Engine includes a helper script to automatically configure driver settings for multi-process or multi-thread operation.Usage
Arguments
Operating mode:
multi_process or multi_threadServices to enable (see below for valid values)
Number of crypto instances to configure
Number of processes to configure (multi-process mode)
Limit device access:
0 (disabled) or 1 (enabled)ServicesEnabled Parameter
Valid values depend on your QAT device generation: QAT Gen4 Devices (4xxx, 401x, 402x):asym;sym- Asymmetric and symmetric cryptoasym- Asymmetric crypto onlysym- Symmetric crypto onlyasym;dc- Asymmetric crypto and compressionsym;dc- Symmetric crypto and compression
cy- Crypto services
Examples
Basic multi-process configuration:Key Configuration Parameters
ServicesEnabled
Defines which services the QAT device provides.- Use
symfor TLS/SSL acceleration (AES, HMAC) - Use
asymfor PKI operations (RSA, ECDSA, DH) - Use
asym;symfor both
NumberCyInstances
Specifies the number of crypto instances to create. Each instance can be used by a different thread or process.- Multi-thread: Set to the number of threads that will use QAT
- Multi-process: Set based on process count and workload
- General: More instances allow better parallelism but consume more resources
NumProcesses
Defines how many processes can use the QAT device (multi-process mode).This parameter is primarily relevant for multi-process configurations.
LimitDevAccess
Controls whether process access to the device is limited.0: No restrictions (default)1: Access limited to processes specified in configuration
Shared Virtual Memory (SVM)
QAT Gen4 devices (4xxx) support Shared Virtual Memory, which eliminates the need to copy buffers to pinned memory, enabling zero-copy operation.Prerequisites
BIOS Settings Required:- Enable Intel IOMMU support for SVM
- Enable VT-d (Virtualization Technology for Directed I/O)
- Enable ATS (Address Translation Services)
- QAT Gen4 devices only (4xxx, 401x, 402x)
Enabling SVM
Add these parameters to each QAT device configuration file:Enable Shared Virtual Memory:
1 (enabled), 0 (disabled)Enable Address Translation:
1 (enabled), 0 (disabled)With SVM enabled, the QAT engine can pass virtual addresses directly to the hardware, avoiding expensive memory copies.
User Space DMA-able Memory (USDM)
The QAT hardware driver requires pinned contiguous memory for DMA operations. This is provided by the User Space DMA-able Memory (USDM) component.Thread-Specific USDM
For multi-threaded applications, you can enable thread-specific memory allocations to avoid lock contention:Enables lockless thread-specific memory allocations
Enables larger memory slabs for better performance
Thread-specific USDM is beneficial for multi-threaded applications but not necessary for multi-process use cases.
USDM Configuration in Driver Config
The driver configuration file can specify USDM memory pool settings:update_config.sh script or installer and rarely need manual adjustment.
Configuration Section Names
By default, the QAT Engine looks for the[SHIM] section in the driver configuration file. You can change this using the SET_CONFIGURATION_SECTION_NAME engine message:
This message must be sent after engine creation but before initialization.
Multi-Process vs Multi-Thread
Multi-Process Configuration
Use when:- Running multiple separate processes (e.g., web server worker processes)
- Using forking models (Apache, Nginx workers)
Multi-Thread Configuration
Use when:- Single process with multiple threads
- Thread pools for crypto operations
Multi-threaded applications should enable thread-specific USDM in the driver for best performance.
Complete Configuration Example
Here’s a complete configuration file for QAT Gen4 in multi-thread mode:Applying Configuration Changes
After modifying configuration files, restart the QAT service:Verifying Configuration
Check that instances were created correctly:Troubleshooting
Configuration Not Loading
- Check file permissions: configuration files should be readable
- Verify file syntax: no typos in parameter names
- Check service status:
sudo service qat_service status - Review logs:
dmesg | grep qat
Insufficient Instances
If you see errors about no available instances:- Increase
NumberCyInstancesin configuration - Restart QAT service
- Verify with
adf_ctl status
SVM Not Working
- Verify BIOS settings (IOMMU, VT-d, ATS)
- Check kernel boot parameters:
intel_iommu=on - Confirm QAT Gen4 device
- Verify OOT driver (not qatlib)