1 .. SPDX-License-Identifier: BSD-3-Clause
2 Copyright(c) 2018 Intel Corporation.
4 ISA-L Compression Poll Mode Driver
5 ==================================
7 The ISA-L PMD (**librte_compress_isal**) provides poll mode compression &
8 decompression driver support for utilizing Intel ISA-L library,
9 which implements the deflate algorithm for both Deflate(compression) and Inflate(decompression).
15 ISA-L PMD has support for:
17 Compression/Decompression algorithm:
35 To enable a checksum in the driver, the compression and/or decompression xform
36 structure, rte_comp_xform, must be filled with either of the CompressDev
37 checksum flags supported. ::
39 compress_xform->compress.chksum = RTE_COMP_CHECKSUM_CRC32
41 decompress_xform->decompress.chksum = RTE_COMP_CHECKSUM_CRC32
45 compress_xform->compress.chksum = RTE_COMP_CHECKSUM_ADLER32
47 decompress_xform->decompress.chksum = RTE_COMP_CHECKSUM_ADLER32
49 If you request a checksum for compression or decompression,
50 the checksum field in the operation structure, ``op->output_chksum``,
51 will be filled with the checksum.
55 For the compression case above, your output buffer will need to be large enough to hold the compressed data plus a scratchpad for the checksum at the end, the scratchpad is 8 bytes for CRC32 and 4 bytes for Adler32.
59 The ISA-L levels have been mapped to somewhat correspond to the same ZLIB level,
60 i.e. ZLIB L1 gives a compression ratio similar to ISA-L L1.
61 Compressdev level 0 enables "No Compression", which passes the uncompressed
62 data to the output buffer, plus deflate headers.
63 The ISA-L library does not support this, therefore compressdev level 0 is not supported.
65 The compressdev API has 10 levels, 0-9. ISA-L has 4 levels of compression, 0-3.
66 As a result the level mappings from the API to the PMD are shown below.
68 .. _table_ISA-L_compression_levels:
70 .. table:: Level mapping from Compressdev to ISA-L PMD.
72 +-------------+----------------------------------------------+-----------------------------------------------+
73 | Compressdev | PMD Functionality | Internal ISA-L |
74 | API Level | | Level |
75 +=============+==============================================+===============================================+
76 | 0 | No compression, Not Supported | --- |
77 +-------------+----------------------------------------------+-----------------------------------------------+
78 | 1 | Dynamic (Fast compression) | 1 |
79 +-------------+----------------------------------------------+-----------------------------------------------+
81 | | (Higher compression ratio) | |
82 +-------------+----------------------------------------------+-----------------------------------------------+
84 | | (Best compression ratio) | (Level 2 if |
85 | | | no AVX512/AVX2) |
86 +-------------+----------------------------------------------+-----------------------------------------------+
87 | 4 | Dynamic (Best compression ratio) | Same as above |
88 +-------------+----------------------------------------------+-----------------------------------------------+
89 | 5 | Dynamic (Best compression ratio) | Same as above |
90 +-------------+----------------------------------------------+-----------------------------------------------+
91 | 6 | Dynamic (Best compression ratio) | Same as above |
92 +-------------+----------------------------------------------+-----------------------------------------------+
93 | 7 | Dynamic (Best compression ratio) | Same as above |
94 +-------------+----------------------------------------------+-----------------------------------------------+
95 | 8 | Dynamic (Best compression ratio) | Same as above |
96 +-------------+----------------------------------------------+-----------------------------------------------+
97 | 9 | Dynamic (Best compression ratio) | Same as above |
98 +-------------+----------------------------------------------+-----------------------------------------------+
102 The above table only shows mapping when API calls for dynamic compression.
103 For fixed compression, regardless of API level, internally ISA-L level 0 is always used.
109 * Compressdev level 0, no compression, is not supported.
114 * To build DPDK with Intel's ISA-L library, the user is required to download the library from `<https://github.com/01org/isa-l>`_.
116 * Once downloaded, the user needs to build the library, the ISA-L autotools are usually sufficient::
121 * make can be used to install the library on their system, before building DPDK::
126 * To build with meson, the **libisal.pc** file, must be copied into "pkgconfig",
127 e.g. /usr/lib/pkgconfig or /usr/lib64/pkgconfig depending on your system,
128 for meson to find the ISA-L library. The **libisal.pc** is located in library sources::
130 cp isal/libisal.pc /usr/lib/pkgconfig/
136 To use the PMD in an application, user must:
138 * Call ``rte_vdev_init("compress_isal")`` within the application.
140 * Use ``--vdev="compress_isal"`` in the EAL options, which will call ``rte_vdev_init()`` internally.
142 The following parameter (optional) can be provided in the previous two calls:
144 * ``socket_id:`` Specify the socket where the memory for the device is going to be allocated
145 (by default, socket_id will be the socket where the core that is creating the PMD is running on).