173d9a4c9STomasz Jozwiak.. SPDX-License-Identifier: BSD-3-Clause 273d9a4c9STomasz Jozwiak Copyright(c) 2018 Intel Corporation. 373d9a4c9STomasz Jozwiak 473d9a4c9STomasz Jozwiakdpdk-test-compress-perf Tool 573d9a4c9STomasz Jozwiak============================ 673d9a4c9STomasz Jozwiak 773d9a4c9STomasz JozwiakThe ``dpdk-test-compress-perf`` tool is a Data Plane Development Kit (DPDK) 873d9a4c9STomasz Jozwiakutility that allows measuring performance parameters of PMDs available in the 91b3268a3STomasz Jozwiakcompress tree. User can use multiple cores to run tests on but only 101b3268a3STomasz Jozwiakone type of compression PMD can be measured during single application 111b3268a3STomasz Jozwiakexecution. The tool reads the data from a file (--input-file), 1273d9a4c9STomasz Jozwiakdumps all the file into a buffer and fills out the data of input mbufs, 1373d9a4c9STomasz Jozwiakwhich are passed to compress device with compression operations. 1473d9a4c9STomasz JozwiakThen, the output buffers are fed into the decompression stage, and the resulting 1573d9a4c9STomasz Jozwiakdata is compared against the original data (verification phase). After that, 1673d9a4c9STomasz Jozwiaka number of iterations are performed, compressing first and decompressing later, 1797c5ba4dSArtur Trybulato check the throughput rate (showing cycles/iteration, cycles/Byte and Gbps, 1897c5ba4dSArtur Trybulafor compression and decompression). 1997c5ba4dSArtur TrybulaAnother option: ``pmd-cyclecount``, gives the user the opportunity to measure 2097c5ba4dSArtur Trybulathe number of cycles per operation for the 3 phases: setup, enqueue_burst and 2197c5ba4dSArtur Trybuladequeue_burst, for both compression and decompression. An optional delay can be 2297c5ba4dSArtur Trybulainserted between enqueue and dequeue so no cycles are wasted in retries while 2397c5ba4dSArtur Trybulawaiting for a hardware device to finish. Although artificial, this allows 2497c5ba4dSArtur Trybulato measure the minimum offload cost which could be achieved in a perfectly 2597c5ba4dSArtur Trybulatuned system. Comparing the results of the two tests gives information about 2697c5ba4dSArtur Trybulathe trade-off between throughput and cycle-count. 2773d9a4c9STomasz Jozwiak 2873d9a4c9STomasz Jozwiak.. Note:: 2973d9a4c9STomasz Jozwiak 3073d9a4c9STomasz Jozwiak if the max-num-sgl-segs x seg_sz > input size then segments number in 3173d9a4c9STomasz Jozwiak the chain will be lower than value passed into max-num-sgl-segs. 3273d9a4c9STomasz Jozwiak 3373d9a4c9STomasz Jozwiak 3473d9a4c9STomasz JozwiakLimitations 3573d9a4c9STomasz Jozwiak~~~~~~~~~~~ 3673d9a4c9STomasz Jozwiak 37fedfef43STomasz Jozwiak* Stateful operation is not supported in this version. 3873d9a4c9STomasz Jozwiak 391b3268a3STomasz JozwiakEAL Options 401b3268a3STomasz Jozwiak~~~~~~~~~~~ 4173d9a4c9STomasz Jozwiak 421b3268a3STomasz JozwiakThe following are the EAL command-line options that can be used in conjunction 431b3268a3STomasz Jozwiakwith the ``dpdk-test-compress-perf`` application. 441b3268a3STomasz JozwiakSee the DPDK Getting Started Guides for more information on these options. 451b3268a3STomasz Jozwiak 461b3268a3STomasz Jozwiak* ``-c <COREMASK>`` or ``-l <CORELIST>`` 471b3268a3STomasz Jozwiak 481b3268a3STomasz Jozwiak Set the hexadecimal bitmask of the cores to run on. The corelist is a 491b3268a3STomasz Jozwiak list cores to use. 501b3268a3STomasz Jozwiak 511b3268a3STomasz Jozwiak.. Note:: 521b3268a3STomasz Jozwiak 531b3268a3STomasz Jozwiak One lcore is needed for process admin, tests are run on all other cores. 541b3268a3STomasz Jozwiak To run tests on two lcores, three lcores must be passed to the tool. 551b3268a3STomasz Jozwiak 56db27370bSStephen Hemminger* ``-a <PCI>`` 571b3268a3STomasz Jozwiak 58db27370bSStephen Hemminger Add a PCI device in allow list. 591b3268a3STomasz Jozwiak 601b3268a3STomasz Jozwiak* ``--vdev <driver><id>`` 611b3268a3STomasz Jozwiak 621b3268a3STomasz Jozwiak Add a virtual device. 631b3268a3STomasz Jozwiak 641b3268a3STomasz JozwiakApplication Options 651b3268a3STomasz Jozwiak~~~~~~~~~~~~~~~~~~~ 6673d9a4c9STomasz Jozwiak 6797c5ba4dSArtur Trybula ``--ptest [throughput/verify/pmd-cyclecount]``: set test type (default: throughput) 681a9b0f35STomasz Jozwiak 6973d9a4c9STomasz Jozwiak ``--driver-name NAME``: compress driver to use 7073d9a4c9STomasz Jozwiak 7173d9a4c9STomasz Jozwiak ``--input-file NAME``: file to compress and decompress 7273d9a4c9STomasz Jozwiak 7373d9a4c9STomasz Jozwiak ``--extended-input-sz N``: extend file data up to this size (default: no extension) 7473d9a4c9STomasz Jozwiak 7573d9a4c9STomasz Jozwiak ``--seg-sz N``: size of segment to store the data (default: 2048) 7673d9a4c9STomasz Jozwiak 7773d9a4c9STomasz Jozwiak ``--burst-sz N``: compress operation burst size 7873d9a4c9STomasz Jozwiak 7973d9a4c9STomasz Jozwiak ``--pool-sz N``: mempool size for compress operations/mbufs (default: 8192) 8073d9a4c9STomasz Jozwiak 8173d9a4c9STomasz Jozwiak ``--max-num-sgl-segs N``: maximum number of segments for each mbuf (default: 16) 8273d9a4c9STomasz Jozwiak 8373d9a4c9STomasz Jozwiak ``--num-iter N``: number of times the file will be compressed/decompressed (default: 10000) 8473d9a4c9STomasz Jozwiak 8573d9a4c9STomasz Jozwiak ``--operation [comp/decomp/comp_and_decomp]``: perform test on compression, decompression or both operations 8673d9a4c9STomasz Jozwiak 87*72c64a34SMichael Baum ``--algo [null/deflate/lzs/lz4]`` : perform test on algorithm null (DMA), deflate, lzs or lz4 (default: deflate) 88*72c64a34SMichael Baum 89fedfef43STomasz Jozwiak ``--huffman-enc [fixed/dynamic/default]``: Huffman encoding (default: dynamic) 9073d9a4c9STomasz Jozwiak 91*72c64a34SMichael Baum ``--lz4-flags N``: flags for LZ4, 92*72c64a34SMichael Baum see `LZ4 Frame Descriptor <https://github.com/lz4/lz4/blob/dev/doc/lz4_Frame_format.md#frame-descriptor>`_ (default: no flags) 93*72c64a34SMichael Baum 9473d9a4c9STomasz Jozwiak ``--compress-level N``: compression level, which could be a single value, list or range (default: range between 1 and 9) 9573d9a4c9STomasz Jozwiak 9673d9a4c9STomasz Jozwiak ``--window-sz N``: base two log value of compression window size (default: max supported by PMD) 9773d9a4c9STomasz Jozwiak 9852d4b732SAdam Dybkowski ``--external-mbufs``: allocate and use memzones as external buffers instead of keeping the data directly in mbuf areas 9952d4b732SAdam Dybkowski 10097c5ba4dSArtur Trybula ``--cc-delay-us N``: delay between enqueue and dequeue operations in microseconds, valid only for the cyclecount test (default: 500 us) 10197c5ba4dSArtur Trybula 10273d9a4c9STomasz Jozwiak ``-h``: prints this help 10373d9a4c9STomasz Jozwiak 10473d9a4c9STomasz Jozwiak 10573d9a4c9STomasz JozwiakRunning the Tool 10673d9a4c9STomasz Jozwiak---------------- 10773d9a4c9STomasz Jozwiak 10873d9a4c9STomasz JozwiakThe tool has a number of command line options. Here is the sample command line: 10973d9a4c9STomasz Jozwiak 11073d9a4c9STomasz Jozwiak.. code-block:: console 11173d9a4c9STomasz Jozwiak 11295fcf7bfSCiara Power ./<build_dir>/app/dpdk-test-compress-perf -l 4 -- --driver-name compress_qat --input-file test.txt --seg-sz 8192 11373d9a4c9STomasz Jozwiak --compress-level 1:1:9 --num-iter 10 --extended-input-sz 1048576 --max-num-sgl-segs 16 --huffman-enc fixed 114