QAT Acceleration for Encryption and Compression
Intel QAT (QuickAssist Technology) can provide extended accelerated encryptionand compression services by offloading the actual encryption and compressionrequest(s) to the hardware QuickAssist accelerators, which are more efficientin terms of cost and power than general purpose CPUs for those specificcompute-intensive workloads.
See QAT Support for Compression and QAT based Encryption for RGW.
QAT in the Software Stack
Application developers can access QuickAssist features through the QAT API.The QAT API is the top-level API for QuickAssist technology, and enables easyinterfacing between the customer application and the QuickAssist accelerationdriver.
The QAT API accesses the QuickAssist driver, which in turn drives theQuickAssist Accelerator hardware. The QuickAssist driver is responsible forexposing the acceleration services to the application software.
A user can write directly to the QAT API, or the use of QAT can be done viaframeworks that have been enabled by others including Intel (for example, zlib,OpenSSL libcrypto, and the Linux Kernel Crypto Framework).
QAT Environment Setup
- QuickAssist Accelerator hardware is necessary to make use of acceleratedencryption and compression services. And QAT driver in kernel space have tobe loaded to drive the hardware.
The driver package can be downloaded from Intel Quickassist Technology.
- The implementation for QAT based encryption is directly base on QAT API whichis included the driver package. But QAT support for compression depends onQATzip project, which is a user space library which builds on top of the QATAPI. QATZip can support several compression algorithm, including deflate,snappy, lz4, etc..
See QATzip.
Implementation
- QAT based Encryption for RGW
OpenSSL support for RGW encryption has been merged into Ceph, and Intel alsoprovides one QAT Engine for OpenSSL. So, theoretically speaking, QAT basedencryption in Ceph can be directly supported through OpenSSl+QAT Engine.
But the QAT Engine for OpenSSL currently supports chained operations only, andso Ceph will not be able to utilize QAT hardware feature for crypto operationsbased on OpenSSL crypto plugin. As a result, one QAT plugin based on nativeQAT API is added into crypto framework.
- QAT Support for Compression
As mentioned above, QAT support for compression is based on QATzip library inuser space, which is designed to take full advantage of the performance providedby QuickAssist Technology. Unlike QAT based encryption, QAT based compressionis supported through a tool class for QAT acceleration rather than a compressorplugin. The common tool class will be shared among zip, snappy, lz4 compressorplugins, and can transparently accelerate the existing compression types. Souser is allowed to use it to speed up the existing compression types as long asthe QAT hardware is available and QAT is capable to handle them.
Configuration
- QAT based Encryption for RGW
Edit the Ceph configuration file to make use of QAT based crypto plugin:
- plugin crypto accelerator = crypto_qat
- QAT Support for Compression
One CMake option have to be used to trigger QAT based compression:
- -DWITH_QATZIP=ON
Edit the Ceph configuration file to enable QAT support for compression:
- qat compressor enabled=true