xref: /dpdk/doc/guides/compressdevs/isal.rst (revision 250c9eb3ca895127f21a729caf4a928eb2f04d2c)
1..  SPDX-License-Identifier: BSD-3-Clause
2    Copyright(c) 2018 Intel Corporation.
3
4ISA-L Compression Poll Mode Driver
5==================================
6
7The ISA-L PMD (**librte_pmd_isal_comp**) provides poll mode compression &
8decompression driver support for utilizing Intel ISA-L library,
9which implements the deflate algorithm for both Deflate(compression) and Inflate(decompression).
10
11
12Features
13--------
14
15ISA-L PMD has support for:
16
17Compression/Decompression algorithm:
18
19    * DEFLATE
20
21Huffman code type:
22
23    * FIXED
24    * DYNAMIC
25
26Window size support:
27
28    * 32K
29
30Level guide:
31
32The ISA-L levels have been mapped to somewhat correspond to the same ZLIB level,
33i.e. ZLIB L1 gives a compression ratio similar to ISA-L L1.
34Compressdev level 0 enables "No Compression", which passes the uncompressed
35data to the output buffer, plus deflate headers.
36The ISA-L library does not support this, therefore compressdev level 0 is not supported.
37
38The compressdev API has 10 levels, 0-9. ISA-L has 4 levels of compression, 0-3.
39As a result the level mappings from the API to the PMD are shown below.
40
41.. _table_ISA-L_compression_levels:
42
43.. table:: Level mapping from Compressdev to ISA-L PMD.
44
45   +-------------+----------------------------------------------+-----------------------------------------------+
46   | Compressdev | PMD Functionality                            | Internal ISA-L                                |
47   | API Level   |                                              | Level                                         |
48   +=============+==============================================+===============================================+
49   | 0           | No compression, Not Supported                | ---                                           |
50   +-------------+----------------------------------------------+-----------------------------------------------+
51   | 1           | Dynamic (Fast compression)                   | 1                                             |
52   +-------------+----------------------------------------------+-----------------------------------------------+
53   | 2           | Dynamic                                      | 2                                             |
54   |             | (Higher compression ratio)                   |                                               |
55   +-------------+----------------------------------------------+-----------------------------------------------+
56   | 3           | Dynamic                                      | 3                                             |
57   |             | (Best compression ratio)                     | (Level 2 if                                   |
58   |             |                                              | no AVX512/AVX2)                               |
59   +-------------+----------------------------------------------+-----------------------------------------------+
60   | 4           | Dynamic (Best compression ratio)             | Same as above                                 |
61   +-------------+----------------------------------------------+-----------------------------------------------+
62   | 5           | Dynamic (Best compression ratio)             | Same as above                                 |
63   +-------------+----------------------------------------------+-----------------------------------------------+
64   | 6           | Dynamic (Best compression ratio)             | Same as above                                 |
65   +-------------+----------------------------------------------+-----------------------------------------------+
66   | 7           | Dynamic (Best compression ratio)             | Same as above                                 |
67   +-------------+----------------------------------------------+-----------------------------------------------+
68   | 8           | Dynamic (Best compression ratio)             | Same as above                                 |
69   +-------------+----------------------------------------------+-----------------------------------------------+
70   | 9           | Dynamic (Best compression ratio)             | Same as above                                 |
71   +-------------+----------------------------------------------+-----------------------------------------------+
72
73.. Note::
74
75 The above table only shows mapping when API calls for dynamic compression.
76 For fixed compression, regardless of API level, internally ISA-L level 0 is always used.
77
78Limitations
79-----------
80
81* Chained mbufs will not be supported until a future release, meaning max data size being passed to PMD through a single mbuf is 64K - 1. If data is larger than this it will need to be split up and sent as multiple operations.
82
83* Compressdev level 0, no compression, is not supported.
84
85* Checksums will not be supported until future release.
86
87Installation
88------------
89
90* To build DPDK with Intel's ISA-L library, the user is required to download the library from `<https://github.com/01org/isa-l>`_.
91
92* Once downloaded, the user needs to build the library, the ISA-L autotools are usually sufficient::
93
94    ./autogen.sh
95    ./configure
96
97* make can  be used to install the library on their system, before building DPDK::
98
99    make
100    sudo make install
101
102* To build with meson, the **libisal.pc** file, must be copied into "pkgconfig",
103  e.g. /usr/lib/pkgconfig or /usr/lib64/pkgconfig depending on your system,
104  for meson to find the ISA-L library. The **libisal.pc** is located in library sources::
105
106    cp isal/libisal.pc /usr/lib/pkgconfig/
107
108
109Initialization
110--------------
111
112In order to enable this virtual compression PMD, user must:
113
114* Set ``CONFIG_RTE_LIBRTE_PMD_ISAL=y`` in config/common_base.
115
116To use the PMD in an application, user must:
117
118* Call ``rte_vdev_init("compress_isal")`` within the application.
119
120* Use ``--vdev="compress_isal"`` in the EAL options, which will call ``rte_vdev_init()`` internally.
121
122The following parameter (optional) can be provided in the previous two calls:
123
124* ``socket_id:`` Specify the socket where the memory for the device is going to be allocated
125  (by default, socket_id will be the socket where the core that is creating the PMD is running on).
126