| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
QATzip is a user-space library built on top of the Intel® QuickAssist Technology (QAT) user-space library. It provides extended compression and decompression capabilities by offloading these operations to Intel® QAT Accelerators. QATzip generates data in the standard gzip* format (RFC1952) with extended headers, in lz4* blocks and the lz4* frame format, or in the standard zstd* frame format. The resulting data can be decompressed using any compliant gzip*, lz4*, or zstd* implementation. QATzip is optimized to fully leverage the performance benefits of Intel® QuickAssist Technology.
| Data Format | Algorithm | QAT Device | Description |
|---|---|---|---|
| QZ_DEFLATE_4B | deflate* | QAT 1.x (Gen2/Gen3) and later | Raw DEFLATE* with a 4-byte length header. |
| QZ_DEFLATE_GZIP | deflate* | QAT 1.x (Gen2/Gen3) and later | DEFLATE* wrapped by a gzip* header and footer. |
| QZ_DEFLATE_GZIP_EXT | deflate* | QAT 1.x (Gen2/Gen3) and later | DEFLATE* wrapped by a QAT gzip* extension header and footer. |
| QZ_DEFLATE_RAW | deflate* | QAT 1.x (Gen2/Gen3) and later | Raw DEFLATE*. Compression only; decompression falls back to software. |
| QZ_LZ4 | lz4* | QAT 2.x (Gen4) and later | LZ4* data wrapped in an lz4* frame. |
| QZ_LZ4s | lz4s* | QAT 2.x (Gen4) and later | LZ4s* blocks. |
| QZ_LZ4_BLOCK | lz4* | QAT 5.x (Gen6) only | Raw LZ4* blocks, with no frame header or footer. |
| QZ_ZSTD | zstd* | QAT 5.x (Gen6) only | ZSTD* data wrapped in a zstd* frame. |
For the raw block layout used by QZ_LZ4_BLOCK, see the lz4* block format.
Where a specification defines a standard frame, QATzip emits it exactly, so the compressed stream can be decoded by any compliant gzip*, lz4*, or zstd* implementation. The frame layout produced for each entry in Supported Formats is shown below.
Gzip* (QZ_DEFLATE_GZIP) — a 10-byte header and an 8-byte footer, per RFC1952:
| ID1(0x1F) (1B) | ID2(0x8B) (1B) | Compression Method (8 = DEFLATE*) (1B) | Flags (1B) | Modification Time (4B) | Extra Flags (1B) | OS (1B) | Deflate Block | CRC32 (4B) | ISIZE (4B) |
Gzip* extended (QZ_DEFLATE_GZIP_EXT) — the standard gzip* header followed by a 14-byte Intel® extra field recording the chunk and block sizes:
| XLEN (2B) | SI1('Q') (1B) | SI2('Z') (1B) | Length of subheader (2B) | Intel(R) defined field 'Chunksize' (4B) | Intel(R) defined field 'Blocksize' (4B) |
4-byte header (QZ_DEFLATE_4B) — a deflate block prefixed by its compressed length:
| Intel(R) defined Header (4B) | deflate block |
Raw deflate* (QZ_DEFLATE_RAW) — a bare deflate block with no header or footer. Compression is offloaded; decompression falls back to software.
LZ4* frame (QZ_LZ4) — a standard lz4* frame. QAT 2.x (Gen4) and later:
| MagicNb (4B) | FLG (1B) | BD (1B) | CS (8B) | HC (1B) | lz4 Block | EndMark (4B) |
LZ4s* (QZ_LZ4s) — lz4s* sequences, which require a user-supplied post-processing callback to produce the final output. QAT 2.x (Gen4) and later.
LZ4* block (QZ_LZ4_BLOCK) — raw lz4* blocks with no frame header or footer. QAT 5.x (Gen6) only.
ZSTD* (QZ_ZSTD) — a standard zstd* frame, generated and consumed directly by QAT hardware with no post-processing. QAT 5.x (Gen6) only.
Note: Enabling this mode in low-stress scenarios or for workloads below 8 KB may reduce throughput.
The following table shows how standard software zlib* compression levels map to QATzip levels for QAT.
| Software zlib* Levels | QAT 1.x Equivalent | QAT 2.x & later Equivalent |
|---|---|---|
| 1 - 4 | QATzip Level 1 | QATzip Level 1 |
| 5 | QATzip Level 5 | QATzip Level 1 |
| 6 - 8 | QATzip Level 5 | QATzip Level 6 |
| 9 | QATzip Level 9 | QATzip Level 9 |
| 10 - 12 | Unsupported | QATzip Level 9 |
Refer to QAT Compression levels, which summarizes how a QATzip level translates to hardware-accelerated levels for each QAT generation.
This QATzip library supports compression and decompression offload on platforms with the following QAT acceleration devices:
Distributions such as Fedora 34+, RHEL 8.4+ & 9.0+, CentOS 9 Stream, SUSE SLES15 SP3+, Ubuntu 24.04+, and Debian 13+ ship the qatzip package in their repositories. That package is built against the QAT_HW qatlib in-tree driver, which supports 4xxx, 401xx, 402xx, 420xx, and 6xxx devices.
See the QATlib installation guide for detailed instructions.
From RPM (Fedora 34+, RHEL 8.4+, CentOS 9+, Ubuntu 24.04+, Debian 13+):
# RHEL-based
sudo dnf install -y qatzip qatzip-devel
# Debian-based
sudo apt -y install qatzip libqatzip3 libqatzip-devFrom Source Code:
cd QATzip/
export QZ_ROOT=$(pwd)
./autogen.sh
./configure
make clean && make && sudo make installRefer to the QAT Installation Guide for detailed setup instructions.
Note: For non-root users, see the non-root user guide. When SVM is disabled, QAT hardware requires DMA-accessible memory. Use QAT USDM component to allocate and free DMA-able memory (see the USDM settings guide).
Install dependencies:
# RHEL-based
sudo dnf install -y autoconf autoconf-archive automake libtool zlib-devel lz4-devel numactl-devel libzstd-devel
# Debian-based
sudo apt -y install autoconf autoconf-archive automake libtool zlib1g-dev liblz4-dev libnuma-dev libzstd-devConfigure:
cd QATzip/
export QZ_ROOT=$(pwd)
export ICP_ROOT=/QAT/PACKAGE/PATH
./autogen.sh
./configure # Run ./configure -h for optionsBuild and install:
make clean && make && sudo make installNote: The image is built with the QATlib in-tree driver.
Note: This section applies only to out-of-tree QAT packages. For in-tree QATlib, see the QATlib configuration guide.
The QATzip library requires a [SHIM] section in its configuration file. Set the environment variable QAT_SECTION_NAME=SHIM or use the provided configuration templates.
Update configuration:
Locate example configuration files:
$QZ_ROOT/config_file/$YOUR_PLATFORM/$CONFIG_TYPE/*.conf
Copy and apply:
sudo cp $QZ_ROOT/config_file/$YOUR_PLATFORM/$CONFIG_TYPE/*.conf /etc
sudo service qat_service restartFor more details, see the QAT Programmer's Guide.
To enable the lz4s + postprocessing pipeline, compile qzstd, a sample application supporting ZSTD format compression/decompression.
Prerequisites: Install the zstd static library before proceeding.
Build:
cd $QZ_ROOT
./autogen.sh
./configure --enable-lz4s-postprocessing
make clean && make qzstdTest:
qzstd $your_input_fileVerify QATzip functionality using qzip tests below:
qzip -k $your_input_file -O gzipext -A deflateCompress with ZSTD* or LZ4* block format (QAT 5.x (Gen6) only):
# Native ZSTD frame
qzip -k $your_input_file -A zstd -O zstd
# Raw LZ4 block
qzip -k $your_input_file -A lz4bk -O lz4bkCompress with a dictionary (QAT 5.x (Gen6) only; dictionary file is capped at 32 KB):
qzip -k $your_input_file -A zstd -O zstd -D $your_dictionary_fileCompress files to 7z:
qzip -O 7z FILE1 FILE2 FILE3... -o result.7zCompress directories to 7z:
qzip -O 7z DIR1 DIR2 DIR3... -o result.7zDecompress 7z archive:
qzip -d result.7zDecompress directory with gzip/gzipext files:
Use the -R option to recursively decompress gzip/gzipext files within a directory:
qzip -d -R DIRRun the performance test script (uses the qatzip-test app):
cd $QZ_ROOT/test/performance_tests
./run_perf_test.shBefore testing, update the following in run_perf_test.sh:
Refer to QATzip-man.pdf in the docs folder. The qzip and qatzip-test man pages are available in the man folder. For additional QAT documentation, see the QAT documentation site.
Intel, Intel Atom, and Xeon are trademarks of Intel Corporation in the U.S. and/or other countries.
*Other names and brands may be claimed as the property of others.
Copyright © 2016-2026, Intel Corporation. All rights reserved.
| Back | FazBrowse Home | New Git URL |