xref: /dpdk/doc/guides/compressdevs/zlib.rst (revision 8809f78c7dd9f33a44a4f89c58fc91ded34296ed)
10baf9204SShally Verma..  SPDX-License-Identifier: BSD-3-Clause
20baf9204SShally Verma    Copyright(c) 2018 Cavium Networks.
30baf9204SShally Verma
40baf9204SShally VermaZLIB Compression Poll Mode Driver
50baf9204SShally Verma==================================
60baf9204SShally Verma
7*8809f78cSBruce RichardsonThe ZLIB PMD (**librte_compress_zlib**) provides poll mode compression &
80baf9204SShally Vermadecompression driver based on SW zlib library,
90baf9204SShally Verma
100baf9204SShally VermaFeatures
110baf9204SShally Verma--------
120baf9204SShally Verma
130baf9204SShally VermaZLIB PMD has support for:
140baf9204SShally Verma
150baf9204SShally VermaCompression/Decompression algorithm:
160baf9204SShally Verma
170baf9204SShally Verma* DEFLATE
180baf9204SShally Verma
190baf9204SShally VermaHuffman code type:
200baf9204SShally Verma
210baf9204SShally Verma* FIXED
220baf9204SShally Verma* DYNAMIC
230baf9204SShally Verma
240baf9204SShally VermaWindow size support:
250baf9204SShally Verma
260baf9204SShally Verma* Min - 256 bytes
270baf9204SShally Verma* Max - 32K
280baf9204SShally Verma
290baf9204SShally VermaLimitations
300baf9204SShally Verma-----------
310baf9204SShally Verma
320baf9204SShally Verma* Scatter-Gather and Stateful not supported.
330baf9204SShally Verma
340baf9204SShally VermaInstallation
350baf9204SShally Verma------------
360baf9204SShally Verma
370baf9204SShally Verma* To build DPDK with ZLIB library, the user is required to download the ``libz`` library.
380baf9204SShally Verma* Use following command for installation.
390baf9204SShally Verma
400baf9204SShally Verma* For Fedora users::
410baf9204SShally Verma     sudo yum install zlib-devel
420baf9204SShally Verma* For Ubuntu users::
430baf9204SShally Verma     sudo apt-get install zlib1g-dev
440baf9204SShally Verma
450baf9204SShally Verma* Once downloaded, the user needs to build the library.
460baf9204SShally Verma
470baf9204SShally Verma* To build from sources
480baf9204SShally Verma  download zlib sources from http://zlib.net/ and do following before building DPDK::
490baf9204SShally Verma
500baf9204SShally Verma    make
510baf9204SShally Verma    sudo make install
520baf9204SShally Verma
530baf9204SShally VermaInitialization
540baf9204SShally Verma--------------
550baf9204SShally Verma
560baf9204SShally VermaTo use the PMD in an application, user must:
570baf9204SShally Verma
580baf9204SShally Verma* Call ``rte_vdev_init("compress_zlib")`` within the application.
590baf9204SShally Verma
600baf9204SShally Verma* Use ``--vdev="compress_zlib"`` in the EAL options, which will call ``rte_vdev_init()`` internally.
610baf9204SShally Verma
620baf9204SShally VermaThe following parameter (optional) can be provided in the previous two calls:
630baf9204SShally Verma
640baf9204SShally Verma* ``socket_id:`` Specify the socket where the memory for the device is going to be allocated
650baf9204SShally Verma  (by default, socket_id will be the socket where the core that is creating the PMD is running on).
66