xref: /dpdk/doc/guides/cryptodevs/qat.rst (revision 9cd9d3e702fba4700539c1a2eddac13dd14ecf70)
15630257fSFerruh Yigit..  SPDX-License-Identifier: BSD-3-Clause
27d5ef3bbSDamian Nowak    Copyright(c) 2015-2019 Intel Corporation.
31703e94aSDeclan Doherty
4ae20c073SDeepak Kumar JainIntel(R) QuickAssist (QAT) Crypto Poll Mode Driver
5ae20c073SDeepak Kumar Jain==================================================
61703e94aSDeclan Doherty
759ad25feSFiona TraheQAT documentation consists of three parts:
859ad25feSFiona Trahe
9bfd84d7eSArek Kusztal* Details of the symmetric and asymmetric crypto services below.
1043628b3dSDavid Marchand* Details of the :doc:`compression service <../compressdevs/qat_comp>`
1159ad25feSFiona Trahe  in the compressdev drivers section.
1259ad25feSFiona Trahe* Details of building the common QAT infrastructure and the PMDs to support the
1359ad25feSFiona Trahe  above services. See :ref:`building_qat` below.
1459ad25feSFiona Trahe
1559ad25feSFiona Trahe
1659ad25feSFiona TraheSymmetric Crypto Service on QAT
1759ad25feSFiona Trahe-------------------------------
1859ad25feSFiona Trahe
19bfd84d7eSArek KusztalThe QAT symmetric crypto PMD (hereafter referred to as `QAT SYM [PMD]`) provides
20bfd84d7eSArek Kusztalpoll mode crypto driver support for the following hardware accelerator devices:
21f546c1edSFiona Trahe
22f546c1edSFiona Trahe* ``Intel QuickAssist Technology DH895xCC``
23f546c1edSFiona Trahe* ``Intel QuickAssist Technology C62x``
24f546c1edSFiona Trahe* ``Intel QuickAssist Technology C3xxx``
25259310f3SFiona Trahe* ``Intel QuickAssist Technology D15xx``
26*9cd9d3e7SAdam Dybkowski* ``Intel QuickAssist Technology P5xxx``
271703e94aSDeclan Doherty
281703e94aSDeclan Doherty
291703e94aSDeclan DohertyFeatures
3059ad25feSFiona Trahe~~~~~~~~
311703e94aSDeclan Doherty
32bfd84d7eSArek KusztalThe QAT SYM PMD has support for:
331703e94aSDeclan Doherty
341703e94aSDeclan DohertyCipher algorithms:
351703e94aSDeclan Doherty
36e1b7f509SFiona Trahe* ``RTE_CRYPTO_CIPHER_3DES_CBC``
37e1b7f509SFiona Trahe* ``RTE_CRYPTO_CIPHER_3DES_CTR``
38fddf3804SDeepak Kumar Jain* ``RTE_CRYPTO_CIPHER_AES128_CBC``
39fddf3804SDeepak Kumar Jain* ``RTE_CRYPTO_CIPHER_AES192_CBC``
40fddf3804SDeepak Kumar Jain* ``RTE_CRYPTO_CIPHER_AES256_CBC``
41fddf3804SDeepak Kumar Jain* ``RTE_CRYPTO_CIPHER_AES128_CTR``
42fddf3804SDeepak Kumar Jain* ``RTE_CRYPTO_CIPHER_AES192_CTR``
43fddf3804SDeepak Kumar Jain* ``RTE_CRYPTO_CIPHER_AES256_CTR``
447d5ef3bbSDamian Nowak* ``RTE_CRYPTO_CIPHER_AES_XTS``
45fddf3804SDeepak Kumar Jain* ``RTE_CRYPTO_CIPHER_SNOW3G_UEA2``
46db0e952aSDeepak Kumar Jain* ``RTE_CRYPTO_CIPHER_NULL``
47d4f27453SDeepak Kumar Jain* ``RTE_CRYPTO_CIPHER_KASUMI_F8``
486cd8b4d8SArek Kusztal* ``RTE_CRYPTO_CIPHER_DES_CBC``
49d18ab45fSFiona Trahe* ``RTE_CRYPTO_CIPHER_AES_DOCSISBPI``
50d18ab45fSFiona Trahe* ``RTE_CRYPTO_CIPHER_DES_DOCSISBPI``
51d9b7d5bbSArek Kusztal* ``RTE_CRYPTO_CIPHER_ZUC_EEA3``
521703e94aSDeclan Doherty
531703e94aSDeclan DohertyHash algorithms:
541703e94aSDeclan Doherty
551703e94aSDeclan Doherty* ``RTE_CRYPTO_AUTH_SHA1_HMAC``
56ebdbe12fSDeepak Kumar Jain* ``RTE_CRYPTO_AUTH_SHA224_HMAC``
571703e94aSDeclan Doherty* ``RTE_CRYPTO_AUTH_SHA256_HMAC``
58d905ee32SDeepak Kumar Jain* ``RTE_CRYPTO_AUTH_SHA384_HMAC``
591703e94aSDeclan Doherty* ``RTE_CRYPTO_AUTH_SHA512_HMAC``
601703e94aSDeclan Doherty* ``RTE_CRYPTO_AUTH_AES_XCBC_MAC``
61a38dfe97SDeepak Kumar Jain* ``RTE_CRYPTO_AUTH_SNOW3G_UIA2``
6261ec5181SArek Kusztal* ``RTE_CRYPTO_AUTH_MD5_HMAC``
63db0e952aSDeepak Kumar Jain* ``RTE_CRYPTO_AUTH_NULL``
64d4f27453SDeepak Kumar Jain* ``RTE_CRYPTO_AUTH_KASUMI_F9``
652fa64f84SArek Kusztal* ``RTE_CRYPTO_AUTH_AES_GMAC``
66d9b7d5bbSArek Kusztal* ``RTE_CRYPTO_AUTH_ZUC_EIA3``
6791c1daa4STomasz Cel* ``RTE_CRYPTO_AUTH_AES_CMAC``
681703e94aSDeclan Doherty
69b79e4c00SPablo de LaraSupported AEAD algorithms:
70655c901bSAndrea Grandi
71b79e4c00SPablo de Lara* ``RTE_CRYPTO_AEAD_AES_GCM``
727bd6f76eSTomasz Cel* ``RTE_CRYPTO_AEAD_AES_CCM``
73b79e4c00SPablo de Lara
741703e94aSDeclan Doherty
75bcd7e3e8SAdam DybkowskiSupported Chains
76bcd7e3e8SAdam Dybkowski~~~~~~~~~~~~~~~~
77bcd7e3e8SAdam Dybkowski
78bcd7e3e8SAdam DybkowskiAll the usual chains are supported and also some mixed chains:
79bcd7e3e8SAdam Dybkowski
80bcd7e3e8SAdam Dybkowski.. table:: Supported hash-cipher chains for wireless digest-encrypted cases
81bcd7e3e8SAdam Dybkowski
82bcd7e3e8SAdam Dybkowski   +------------------+-----------+-------------+----------+----------+
83bcd7e3e8SAdam Dybkowski   | Cipher algorithm | NULL AUTH | SNOW3G UIA2 | ZUC EIA3 | AES CMAC |
84bcd7e3e8SAdam Dybkowski   +==================+===========+=============+==========+==========+
85bcd7e3e8SAdam Dybkowski   | NULL CIPHER      | Y         | 3           | 3        | Y        |
86bcd7e3e8SAdam Dybkowski   +------------------+-----------+-------------+----------+----------+
87bcd7e3e8SAdam Dybkowski   | SNOW3G UEA2      | 3         | Y           | 3        | 3        |
88bcd7e3e8SAdam Dybkowski   +------------------+-----------+-------------+----------+----------+
89bcd7e3e8SAdam Dybkowski   | ZUC EEA3         | 3         | 3           | 2&3      | 3        |
90bcd7e3e8SAdam Dybkowski   +------------------+-----------+-------------+----------+----------+
91bcd7e3e8SAdam Dybkowski   | AES CTR          | Y         | 3           | 3        | Y        |
92bcd7e3e8SAdam Dybkowski   +------------------+-----------+-------------+----------+----------+
93bcd7e3e8SAdam Dybkowski
94bcd7e3e8SAdam Dybkowski* The combinations marked as "Y" are supported on all QAT hardware versions.
95bcd7e3e8SAdam Dybkowski* The combinations marked as "2&3" are supported on GEN2/GEN3 QAT hardware only.
96bcd7e3e8SAdam Dybkowski* The combinations marked as "3" are supported on GEN3 QAT hardware only.
97bcd7e3e8SAdam Dybkowski
98bcd7e3e8SAdam Dybkowski
991703e94aSDeclan DohertyLimitations
10059ad25feSFiona Trahe~~~~~~~~~~~
1011703e94aSDeclan Doherty
1021703e94aSDeclan Doherty* Only supports the session-oriented API implementation (session-less APIs are not supported).
1032142e6dcSPablo de Lara* SNOW 3G (UEA2), KASUMI (F8) and ZUC (EEA3) supported only if cipher length and offset fields are byte-multiple.
1049333cfbaSPablo de Lara* SNOW 3G (UIA2) and ZUC (EIA3) supported only if hash length and offset fields are byte-multiple.
1058831895bSFiona Trahe* No BSD support as BSD QAT kernel driver not available.
106d9b7d5bbSArek Kusztal* ZUC EEA3/EIA3 is not supported by dh895xcc devices
1072a7bb4fdSFiona Trahe* Maximum additional authenticated data (AAD) for GCM is 240 bytes long and must be passed to the device in a buffer rounded up to the nearest block-size multiple (x16) and padded with zeros.
108026f21c0SFiona Trahe* Queue-pairs are thread-safe on Intel CPUs but Queues are not (that is, within a single
109026f21c0SFiona Trahe  queue-pair all enqueues to the TX queue must be done from one thread and all dequeues
110026f21c0SFiona Trahe  from the RX queue must be done from one thread, but enqueues and dequeues may be done
111026f21c0SFiona Trahe  in different threads.)
112aa983f03SAdam Dybkowski* A GCM limitation exists, but only in the case where there are multiple
113aa983f03SAdam Dybkowski  generations of QAT devices on a single platform.
114aa983f03SAdam Dybkowski  To optimise performance, the GCM crypto session should be initialised for the
115aa983f03SAdam Dybkowski  device generation to which the ops will be enqueued. Specifically if a GCM
116aa983f03SAdam Dybkowski  session is initialised on a GEN2 device, but then attached to an op enqueued
117aa983f03SAdam Dybkowski  to a GEN3 device, it will work but cannot take advantage of hardware
118aa983f03SAdam Dybkowski  optimisations in the GEN3 device. And if a GCM session is initialised on a
119aa983f03SAdam Dybkowski  GEN3 device, then attached to an op sent to a GEN1/GEN2 device, it will not be
120aa983f03SAdam Dybkowski  enqueued to the device and will be marked as failed. The simplest way to
121aa983f03SAdam Dybkowski  mitigate this is to use the bdf whitelist to avoid mixing devices of different
122aa983f03SAdam Dybkowski  generations in the same process if planning to use for GCM.
1231703e94aSDeclan Doherty
124bb44fb6fSFiona TraheExtra notes on KASUMI F9
12559ad25feSFiona Trahe~~~~~~~~~~~~~~~~~~~~~~~~
1261703e94aSDeclan Doherty
127bb44fb6fSFiona TraheWhen using KASUMI F9 authentication algorithm, the input buffer must be
128aa38c849SFiona Traheconstructed according to the
129aa38c849SFiona Trahe`3GPP KASUMI specification <http://cryptome.org/3gpp/35201-900.pdf>`_
130aa38c849SFiona Trahe(section 4.4, page 13). The input buffer has to have COUNT (4 bytes),
131aa38c849SFiona TraheFRESH (4 bytes), MESSAGE and DIRECTION (1 bit) concatenated. After the DIRECTION
132aa38c849SFiona Trahebit, a single '1' bit is appended, followed by between 0 and 7 '0' bits, so that
133aa38c849SFiona Trahethe total length of the buffer is multiple of 8 bits. Note that the actual
134aa38c849SFiona Trahemessage can be any length, specified in bits.
135bb44fb6fSFiona Trahe
136bb44fb6fSFiona TraheOnce this buffer is passed this way, when creating the crypto operation,
137aa38c849SFiona Trahelength of data to authenticate "op.sym.auth.data.length" must be the length
138bb44fb6fSFiona Traheof all the items described above, including the padding at the end.
139aa38c849SFiona TraheAlso, offset of data to authenticate "op.sym.auth.data.offset"
140bb44fb6fSFiona Trahemust be such that points at the start of the COUNT bytes.
141bb44fb6fSFiona Trahe
142f81cbc20SArek KusztalAsymmetric Crypto Service on QAT
143f81cbc20SArek Kusztal--------------------------------
144bb44fb6fSFiona Trahe
145bfd84d7eSArek KusztalThe QAT asymmetric crypto PMD (hereafter referred to as `QAT ASYM [PMD]`) provides
146bfd84d7eSArek Kusztalpoll mode crypto driver support for the following hardware accelerator devices:
147f81cbc20SArek Kusztal
148bfd84d7eSArek Kusztal* ``Intel QuickAssist Technology DH895xCC``
149bfd84d7eSArek Kusztal* ``Intel QuickAssist Technology C62x``
150bfd84d7eSArek Kusztal* ``Intel QuickAssist Technology C3xxx``
151bfd84d7eSArek Kusztal* ``Intel QuickAssist Technology D15xx``
152*9cd9d3e7SAdam Dybkowski* ``Intel QuickAssist Technology P5xxx``
153bfd84d7eSArek Kusztal
154bfd84d7eSArek KusztalThe QAT ASYM PMD has support for:
155bfd84d7eSArek Kusztal
156bfd84d7eSArek Kusztal* ``RTE_CRYPTO_ASYM_XFORM_MODEX``
157bfd84d7eSArek Kusztal* ``RTE_CRYPTO_ASYM_XFORM_MODINV``
158fb70b33bSArek Kusztal
159f81cbc20SArek KusztalLimitations
160f81cbc20SArek Kusztal~~~~~~~~~~~
161bb44fb6fSFiona Trahe
162bfd84d7eSArek Kusztal* Big integers longer than 4096 bits are not supported.
163026f21c0SFiona Trahe* Queue-pairs are thread-safe on Intel CPUs but Queues are not (that is, within a single
164026f21c0SFiona Trahe  queue-pair all enqueues to the TX queue must be done from one thread and all dequeues
165026f21c0SFiona Trahe  from the RX queue must be done from one thread, but enqueues and dequeues may be done
166026f21c0SFiona Trahe  in different threads.)
167e2c5f4eaSArek Kusztal* RSA-2560, RSA-3584 are not supported
168bfd84d7eSArek Kusztal
16959ad25feSFiona Trahe.. _building_qat:
17059ad25feSFiona Trahe
17159ad25feSFiona TraheBuilding PMDs on QAT
17259ad25feSFiona Trahe--------------------
173bb44fb6fSFiona Trahe
17402545b6cSFiona TraheA QAT device can host multiple acceleration services:
17502545b6cSFiona Trahe
17602545b6cSFiona Trahe* symmetric cryptography
17702545b6cSFiona Trahe* data compression
178f81cbc20SArek Kusztal* asymmetric cryptography
17902545b6cSFiona Trahe
18002545b6cSFiona TraheThese services are provided to DPDK applications via PMDs which register to
18102545b6cSFiona Traheimplement the corresponding cryptodev and compressdev APIs. The PMDs use
18202545b6cSFiona Trahecommon QAT driver code which manages the QAT PCI device. They also depend on a
18302545b6cSFiona TraheQAT kernel driver being installed on the platform, see :ref:`qat_kernel` below.
1841703e94aSDeclan Doherty
185bb44fb6fSFiona Trahe
18602545b6cSFiona TraheConfiguring and Building the DPDK QAT PMDs
18702545b6cSFiona Trahe~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18802545b6cSFiona Trahe
18902545b6cSFiona Trahe
19002545b6cSFiona TraheFurther information on configuring, building and installing DPDK is described
19143628b3dSDavid Marchand:doc:`here <../linux_gsg/build_dpdk>`.
19202545b6cSFiona Trahe
19302545b6cSFiona Trahe
19402545b6cSFiona TraheQuick instructions for QAT cryptodev PMD are as follows:
195d6740135SEoin Breen
196d6740135SEoin Breen.. code-block:: console
197d6740135SEoin Breen
198f546c1edSFiona Trahe	cd to the top-level DPDK directory
19902545b6cSFiona Trahe	make defconfig
200bb44fb6fSFiona Trahe	sed -i 's,\(CONFIG_RTE_LIBRTE_PMD_QAT_SYM\)=n,\1=y,' build/.config
201bfd84d7eSArek Kusztal	or/and
202bfd84d7eSArek Kusztal	sed -i 's,\(CONFIG_RTE_LIBRTE_PMD_QAT_ASYM\)=n,\1=y,' build/.config
203d6740135SEoin Breen	make
204d6740135SEoin Breen
20502545b6cSFiona TraheQuick instructions for QAT compressdev PMD are as follows:
206bb44fb6fSFiona Trahe
20702545b6cSFiona Trahe.. code-block:: console
208bb44fb6fSFiona Trahe
20902545b6cSFiona Trahe	cd to the top-level DPDK directory
21002545b6cSFiona Trahe	make defconfig
21102545b6cSFiona Trahe	make
212bb44fb6fSFiona Trahe
213bb44fb6fSFiona Trahe
2145f40555bSTomasz Jozwiak.. _building_qat_config:
2155f40555bSTomasz Jozwiak
2167ce27b9eSFiona TraheBuild Configuration
2177ce27b9eSFiona Trahe~~~~~~~~~~~~~~~~~~~
2187ce27b9eSFiona Trahe
2197ce27b9eSFiona TraheThese are the build configuration options affecting QAT, and their default values:
2207ce27b9eSFiona Trahe
2217ce27b9eSFiona Trahe.. code-block:: console
2227ce27b9eSFiona Trahe
2237ce27b9eSFiona Trahe	CONFIG_RTE_LIBRTE_PMD_QAT=y
2247ce27b9eSFiona Trahe	CONFIG_RTE_LIBRTE_PMD_QAT_SYM=n
225bfd84d7eSArek Kusztal	CONFIG_RTE_LIBRTE_PMD_QAT_ASYM=n
2267ce27b9eSFiona Trahe	CONFIG_RTE_PMD_QAT_MAX_PCI_DEVICES=48
2274e8f2d6aSFiona Trahe	CONFIG_RTE_PMD_QAT_COMP_IM_BUFFER_SIZE=65536
2287ce27b9eSFiona Trahe
2297ce27b9eSFiona TraheCONFIG_RTE_LIBRTE_PMD_QAT must be enabled for any QAT PMD to be built.
2307ce27b9eSFiona Trahe
231bfd84d7eSArek KusztalBoth QAT SYM PMD and QAT ASYM PMD have an external dependency on libcrypto, so are not
232bfd84d7eSArek Kusztalbuilt by default. CONFIG_RTE_LIBRTE_PMD_QAT_SYM/ASYM should be enabled to build them.
2337ce27b9eSFiona Trahe
2347ce27b9eSFiona TraheThe QAT compressdev PMD has no external dependencies, so needs no configuration
2357ce27b9eSFiona Traheoptions and is built by default.
2367ce27b9eSFiona Trahe
2377ce27b9eSFiona TraheThe number of VFs per PF varies - see table below. If multiple QAT packages are
2387ce27b9eSFiona Traheinstalled on a platform then CONFIG_RTE_PMD_QAT_MAX_PCI_DEVICES should be
2397ce27b9eSFiona Traheadjusted to the number of VFs which the QAT common code will need to handle.
240bfd84d7eSArek Kusztal
241bfd84d7eSArek Kusztal.. Note::
242bfd84d7eSArek Kusztal
243bfd84d7eSArek Kusztal        There are separate config items (not QAT-specific) for max cryptodevs
244bfd84d7eSArek Kusztal        CONFIG_RTE_CRYPTO_MAX_DEVS and max compressdevs CONFIG_RTE_COMPRESS_MAX_DEVS,
245bfd84d7eSArek Kusztal        if necessary these should be adjusted to handle the total of QAT and other
246bfd84d7eSArek Kusztal        devices which the process will use. In particular for crypto, where each
247bfd84d7eSArek Kusztal        QAT VF may expose two crypto devices, sym and asym, it may happen that the
248bfd84d7eSArek Kusztal        number of devices will be bigger than MAX_DEVS and the process will show an error
249bfd84d7eSArek Kusztal        during PMD initialisation. To avoid this problem CONFIG_RTE_CRYPTO_MAX_DEVS may be
250bfd84d7eSArek Kusztal        increased or -w, pci-whitelist domain:bus:devid:func option may be used.
251bfd84d7eSArek Kusztal
2527ce27b9eSFiona Trahe
2534e8f2d6aSFiona TraheQAT compression PMD needs intermediate buffers to support Deflate compression
2544e8f2d6aSFiona Trahewith Dynamic Huffman encoding. CONFIG_RTE_PMD_QAT_COMP_IM_BUFFER_SIZE
2554e8f2d6aSFiona Trahespecifies the size of a single buffer, the PMD will allocate a multiple of these,
2565f40555bSTomasz Jozwiakplus some extra space for associated meta-data. For GEN2 devices, 20 buffers are
2575f40555bSTomasz Jozwiakallocated while for GEN1 devices, 12 buffers are allocated, plus 1472 bytes overhead.
2584e8f2d6aSFiona Trahe
2594e8f2d6aSFiona Trahe.. Note::
2604e8f2d6aSFiona Trahe
2614e8f2d6aSFiona Trahe	If the compressed output of a Deflate operation using Dynamic Huffman
2624e8f2d6aSFiona Trahe        Encoding is too big to fit in an intermediate buffer, then the
263a720e674STomasz Jozwiak	operation will fall back to fixed compression rather than failing the operation.
264a720e674STomasz Jozwiak	To avoid this less performant case, applications should configure
265a720e674STomasz Jozwiak	the intermediate buffer size to be larger than the expected input data size
266a720e674STomasz Jozwiak	(compressed output size is usually unknown, so the only option is to make
267a720e674STomasz Jozwiak	larger than the input size).
2684e8f2d6aSFiona Trahe
269bb44fb6fSFiona Trahe
27047c3f7a4SArek KusztalRunning QAT PMD with minimum threshold for burst size
27147c3f7a4SArek Kusztal~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
27247c3f7a4SArek Kusztal
27347c3f7a4SArek KusztalIf only a small number or packets can be enqueued. Each enqueue causes an expensive MMIO write.
27447c3f7a4SArek KusztalThese MMIO write occurrences can be optimised by setting any of the following parameters:
27547c3f7a4SArek Kusztal
27647c3f7a4SArek Kusztal- qat_sym_enq_threshold
27747c3f7a4SArek Kusztal- qat_asym_enq_threshold
27847c3f7a4SArek Kusztal- qat_comp_enq_threshold
27947c3f7a4SArek Kusztal
28047c3f7a4SArek KusztalWhen any of these parameters is set rte_cryptodev_enqueue_burst function will
28147c3f7a4SArek Kusztalreturn 0 (thereby avoiding an MMIO) if the device is congested and number of packets
28247c3f7a4SArek Kusztalpossible to enqueue is smaller.
28347c3f7a4SArek KusztalTo use this feature the user must set the parameter on process start as a device additional parameter::
28447c3f7a4SArek Kusztal
28547c3f7a4SArek Kusztal  -w 03:01.1,qat_sym_enq_threshold=32,qat_comp_enq_threshold=16
28647c3f7a4SArek Kusztal
28747c3f7a4SArek KusztalAll parameters can be used with the same device regardless of order. Parameters are separated
28847c3f7a4SArek Kusztalby comma. When the same parameter is used more than once first occurrence of the parameter
28947c3f7a4SArek Kusztalis used.
29047c3f7a4SArek KusztalMaximum threshold that can be set is 32.
29147c3f7a4SArek Kusztal
29247c3f7a4SArek Kusztal
293bb44fb6fSFiona TraheDevice and driver naming
29459ad25feSFiona Trahe~~~~~~~~~~~~~~~~~~~~~~~~
295bb44fb6fSFiona Trahe
296bfd84d7eSArek Kusztal* The qat cryptodev symmetric crypto driver name is "crypto_qat".
297bfd84d7eSArek Kusztal* The qat cryptodev asymmetric crypto driver name is "crypto_qat_asym".
298bb44fb6fSFiona Trahe
299bfd84d7eSArek KusztalThe "rte_cryptodev_devices_get()" returns the devices exposed by either of these drivers.
300bfd84d7eSArek Kusztal
301bfd84d7eSArek Kusztal* Each qat sym crypto device has a unique name, in format
302aa38c849SFiona Trahe  "<pci bdf>_<service>", e.g. "0000:41:01.0_qat_sym".
303bfd84d7eSArek Kusztal* Each qat asym crypto device has a unique name, in format
304bfd84d7eSArek Kusztal  "<pci bdf>_<service>", e.g. "0000:41:01.0_qat_asym".
305aa38c849SFiona Trahe  This name can be passed to "rte_cryptodev_get_dev_id()" to get the device_id.
306bb44fb6fSFiona Trahe
307bb44fb6fSFiona Trahe.. Note::
308bb44fb6fSFiona Trahe
309bfd84d7eSArek Kusztal	The cryptodev driver name is passed to the dpdk-test-crypto-perf tool in the "-devtype" parameter.
310bb44fb6fSFiona Trahe
311bb44fb6fSFiona Trahe	The qat crypto device name is in the format of the slave parameter passed to the crypto scheduler.
312bb44fb6fSFiona Trahe
313df8cca46SFiona Trahe* The qat compressdev driver name is "compress_qat".
314bb44fb6fSFiona Trahe  The rte_compressdev_devices_get() returns the devices exposed by this driver.
315bb44fb6fSFiona Trahe
316bb44fb6fSFiona Trahe* Each qat compression device has a unique name, in format
317bb44fb6fSFiona Trahe  <pci bdf>_<service>, e.g. "0000:41:01.0_qat_comp".
318bb44fb6fSFiona Trahe  This name can be passed to rte_compressdev_get_dev_id() to get the device_id.
319bb44fb6fSFiona Trahe
32002545b6cSFiona Trahe.. _qat_kernel:
32102545b6cSFiona Trahe
32202545b6cSFiona TraheDependency on the QAT kernel driver
32302545b6cSFiona Trahe~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
32402545b6cSFiona Trahe
32502545b6cSFiona TraheTo use QAT an SRIOV-enabled QAT kernel driver is required. The VF
32602545b6cSFiona Trahedevices created and initialised by this driver will be used by the QAT PMDs.
32702545b6cSFiona Trahe
32802545b6cSFiona TraheInstructions for installation are below, but first an explanation of the
32902545b6cSFiona Traherelationships between the PF/VF devices and the PMDs visible to
33002545b6cSFiona TraheDPDK applications.
33102545b6cSFiona Trahe
33202545b6cSFiona TraheEach QuickAssist PF device exposes a number of VF devices. Each VF device can
333bfd84d7eSArek Kusztalenable one symmetric cryptodev PMD and/or one asymmetric cryptodev PMD and/or
334bfd84d7eSArek Kusztalone compressdev PMD.
33502545b6cSFiona TraheThese QAT PMDs share the same underlying device and pci-mgmt code, but are
33602545b6cSFiona Traheenumerated independently on their respective APIs and appear as independent
33702545b6cSFiona Trahedevices to applications.
33802545b6cSFiona Trahe
33902545b6cSFiona Trahe.. Note::
34002545b6cSFiona Trahe
34102545b6cSFiona Trahe   Each VF can only be used by one DPDK process. It is not possible to share
34202545b6cSFiona Trahe   the same VF across multiple processes, even if these processes are using
34302545b6cSFiona Trahe   different acceleration services.
34402545b6cSFiona Trahe
34502545b6cSFiona Trahe   Conversely one DPDK process can use one or more QAT VFs and can expose both
34602545b6cSFiona Trahe   cryptodev and compressdev instances on each of those VFs.
34702545b6cSFiona Trahe
348bb44fb6fSFiona Trahe
349bb44fb6fSFiona TraheAvailable kernel drivers
35059ad25feSFiona Trahe~~~~~~~~~~~~~~~~~~~~~~~~
351bb44fb6fSFiona Trahe
352ab3dec55SFiona TraheKernel drivers for each device for each service are listed in the following table. (Scroll right
353ab3dec55SFiona Traheto see the full table)
354bb44fb6fSFiona Trahe
3551703e94aSDeclan Doherty
356f546c1edSFiona Trahe.. _table_qat_pmds_drivers:
357f546c1edSFiona Trahe
358f5160653SArek Kusztal.. table:: QAT device generations, devices and drivers
359f546c1edSFiona Trahe
360ab3dec55SFiona Trahe   +-----+-----+-----+-----+----------+---------------+---------------+------------+--------+------+--------+--------+
361ab3dec55SFiona Trahe   | S   | A   | C   | Gen | Device   | Driver/ver    | Kernel Module | Pci Driver | PF Did | #PFs | VF Did | VFs/PF |
362ab3dec55SFiona Trahe   +=====+=====+=====+=====+==========+===============+===============+============+========+======+========+========+
363ab3dec55SFiona Trahe   | Yes | No  | No  | 1   | DH895xCC | linux/4.4+    | qat_dh895xcc  | dh895xcc   | 435    | 1    | 443    | 32     |
364ab3dec55SFiona Trahe   +-----+-----+-----+-----+----------+---------------+---------------+------------+--------+------+--------+--------+
365bfd84d7eSArek Kusztal   | Yes | Yes | No  | "   | "        | 01.org/4.2.0+ | "             | "          | "      | "    | "      | "      |
366ab3dec55SFiona Trahe   +-----+-----+-----+-----+----------+---------------+---------------+------------+--------+------+--------+--------+
367bfd84d7eSArek Kusztal   | Yes | Yes | Yes | "   | "        | 01.org/4.3.0+ | "             | "          | "      | "    | "      | "      |
368ab3dec55SFiona Trahe   +-----+-----+-----+-----+----------+---------------+---------------+------------+--------+------+--------+--------+
369ab3dec55SFiona Trahe   | Yes | No  | No  | 2   | C62x     | linux/4.5+    | qat_c62x      | c6xx       | 37c8   | 3    | 37c9   | 16     |
370ab3dec55SFiona Trahe   +-----+-----+-----+-----+----------+---------------+---------------+------------+--------+------+--------+--------+
371bfd84d7eSArek Kusztal   | Yes | Yes | Yes | "   | "        | 01.org/4.2.0+ | "             | "          | "      | "    | "      | "      |
372ab3dec55SFiona Trahe   +-----+-----+-----+-----+----------+---------------+---------------+------------+--------+------+--------+--------+
373ab3dec55SFiona Trahe   | Yes | No  | No  | 2   | C3xxx    | linux/4.5+    | qat_c3xxx     | c3xxx      | 19e2   | 1    | 19e3   | 16     |
374ab3dec55SFiona Trahe   +-----+-----+-----+-----+----------+---------------+---------------+------------+--------+------+--------+--------+
375bfd84d7eSArek Kusztal   | Yes | Yes | Yes | "   | "        | 01.org/4.2.0+ | "             | "          | "      | "    | "      | "      |
376ab3dec55SFiona Trahe   +-----+-----+-----+-----+----------+---------------+---------------+------------+--------+------+--------+--------+
377ab3dec55SFiona Trahe   | Yes | No  | No  | 2   | D15xx    | p             | qat_d15xx     | d15xx      | 6f54   | 1    | 6f55   | 16     |
378ab3dec55SFiona Trahe   +-----+-----+-----+-----+----------+---------------+---------------+------------+--------+------+--------+--------+
379*9cd9d3e7SAdam Dybkowski   | Yes | No  | No  | 3   | P5xxx    | p             | qat_p5xxx     | p5xxx      | 18a0   | 1    | 18a1   | 128    |
380ab3dec55SFiona Trahe   +-----+-----+-----+-----+----------+---------------+---------------+------------+--------+------+--------+--------+
381f546c1edSFiona Trahe
382ab3dec55SFiona TraheThe first 3 columns indicate the service:
383ab3dec55SFiona Trahe
384ab3dec55SFiona Trahe* S = Symmetric crypto service (via cryptodev API)
385ab3dec55SFiona Trahe* A = Asymmetric crypto service  (via cryptodev API)
386ab3dec55SFiona Trahe* C = Compression service (via compressdev API)
387f546c1edSFiona Trahe
388f546c1edSFiona TraheThe ``Driver`` column indicates either the Linux kernel version in which
389f546c1edSFiona Trahesupport for this device was introduced or a driver available on Intel's 01.org
390ab3dec55SFiona Trahewebsite. There are both linux in-tree and 01.org kernel drivers available for some
391259310f3SFiona Trahedevices. p = release pending.
392f546c1edSFiona Trahe
393f546c1edSFiona TraheIf you are running on a kernel which includes a driver for your device, see
394f546c1edSFiona Trahe`Installation using kernel.org driver`_ below. Otherwise see
395f546c1edSFiona Trahe`Installation using 01.org QAT driver`_.
396f546c1edSFiona Trahe
397f546c1edSFiona Trahe
398f546c1edSFiona TraheInstallation using kernel.org driver
39959ad25feSFiona Trahe~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
400f546c1edSFiona Trahe
401f546c1edSFiona TraheThe examples below are based on the C62x device, if you have a different device
402f546c1edSFiona Traheuse the corresponding values in the above table.
403f546c1edSFiona Trahe
404f546c1edSFiona TraheIn BIOS ensure that SRIOV is enabled and either:
405f546c1edSFiona Trahe
406f546c1edSFiona Trahe* Disable VT-d or
407f546c1edSFiona Trahe* Enable VT-d and set ``"intel_iommu=on iommu=pt"`` in the grub file.
408f546c1edSFiona Trahe
409f546c1edSFiona TraheCheck that the QAT driver is loaded on your system, by executing::
410f546c1edSFiona Trahe
411f546c1edSFiona Trahe    lsmod | grep qa
412f546c1edSFiona Trahe
413f546c1edSFiona TraheYou should see the kernel module for your device listed, e.g.::
414f546c1edSFiona Trahe
415f546c1edSFiona Trahe    qat_c62x               5626  0
416f546c1edSFiona Trahe    intel_qat              82336  1 qat_c62x
417f546c1edSFiona Trahe
418f546c1edSFiona TraheNext, you need to expose the Virtual Functions (VFs) using the sysfs file system.
419f546c1edSFiona Trahe
420f546c1edSFiona TraheFirst find the BDFs (Bus-Device-Function) of the physical functions (PFs) of
421f546c1edSFiona Traheyour device, e.g.::
422f546c1edSFiona Trahe
423f546c1edSFiona Trahe    lspci -d:37c8
424f546c1edSFiona Trahe
425f546c1edSFiona TraheYou should see output similar to::
426f546c1edSFiona Trahe
427f546c1edSFiona Trahe    1a:00.0 Co-processor: Intel Corporation Device 37c8
428f546c1edSFiona Trahe    3d:00.0 Co-processor: Intel Corporation Device 37c8
429f546c1edSFiona Trahe    3f:00.0 Co-processor: Intel Corporation Device 37c8
430f546c1edSFiona Trahe
431f546c1edSFiona TraheEnable the VFs for each PF by echoing the number of VFs per PF to the pci driver::
432f546c1edSFiona Trahe
433f546c1edSFiona Trahe     echo 16 > /sys/bus/pci/drivers/c6xx/0000:1a:00.0/sriov_numvfs
434f546c1edSFiona Trahe     echo 16 > /sys/bus/pci/drivers/c6xx/0000:3d:00.0/sriov_numvfs
435f546c1edSFiona Trahe     echo 16 > /sys/bus/pci/drivers/c6xx/0000:3f:00.0/sriov_numvfs
436f546c1edSFiona Trahe
437f546c1edSFiona TraheCheck that the VFs are available for use. For example ``lspci -d:37c9`` should
438f546c1edSFiona Trahelist 48 VF devices available for a ``C62x`` device.
439f546c1edSFiona Trahe
440f546c1edSFiona TraheTo complete the installation follow the instructions in
441f546c1edSFiona Trahe`Binding the available VFs to the DPDK UIO driver`_.
442f546c1edSFiona Trahe
443f546c1edSFiona Trahe.. Note::
444f546c1edSFiona Trahe
445f546c1edSFiona Trahe   If the QAT kernel modules are not loaded and you see an error like ``Failed
446f546c1edSFiona Trahe   to load MMP firmware qat_895xcc_mmp.bin`` in kernel logs, this may be as a
447f546c1edSFiona Trahe   result of not using a distribution, but just updating the kernel directly.
448f546c1edSFiona Trahe
449f546c1edSFiona Trahe   Download firmware from the `kernel firmware repo
450f546c1edSFiona Trahe   <http://git.kernel.org/cgit/linux/kernel/git/firmware/linux-firmware.git/tree/>`_.
451f546c1edSFiona Trahe
452f546c1edSFiona Trahe   Copy qat binaries to ``/lib/firmware``::
453f546c1edSFiona Trahe
454f546c1edSFiona Trahe      cp qat_895xcc.bin /lib/firmware
455f546c1edSFiona Trahe      cp qat_895xcc_mmp.bin /lib/firmware
456f546c1edSFiona Trahe
457f546c1edSFiona Trahe   Change to your linux source root directory and start the qat kernel modules::
458f546c1edSFiona Trahe
459f546c1edSFiona Trahe      insmod ./drivers/crypto/qat/qat_common/intel_qat.ko
460f546c1edSFiona Trahe      insmod ./drivers/crypto/qat/qat_dh895xcc/qat_dh895xcc.ko
461f546c1edSFiona Trahe
462f546c1edSFiona Trahe
463f546c1edSFiona Trahe.. Note::
464f546c1edSFiona Trahe
465f546c1edSFiona Trahe   If you see the following warning in ``/var/log/messages`` it can be ignored:
466f546c1edSFiona Trahe   ``IOMMU should be enabled for SR-IOV to work correctly``.
467ae20c073SDeepak Kumar Jain
4681703e94aSDeclan Doherty
4691703e94aSDeclan DohertyInstallation using 01.org QAT driver
47059ad25feSFiona Trahe~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4711703e94aSDeclan Doherty
4721703e94aSDeclan DohertyDownload the latest QuickAssist Technology Driver from `01.org
473f546c1edSFiona Trahe<https://01.org/packet-processing/intel%C2%AE-quickassist-technology-drivers-and-patches>`_.
4741703e94aSDeclan DohertyConsult the *Getting Started Guide* at the same URL for further information.
4751703e94aSDeclan Doherty
4761703e94aSDeclan DohertyThe steps below assume you are:
4771703e94aSDeclan Doherty
478bb44fb6fSFiona Trahe* Building on a platform with one ``C62x`` device.
479bb44fb6fSFiona Trahe* Using package ``qat1.7.l.4.2.0-000xx.tar.gz``.
480bb44fb6fSFiona Trahe* On Fedora26 kernel ``4.11.11-300.fc26.x86_64``.
4811703e94aSDeclan Doherty
4821703e94aSDeclan DohertyIn the BIOS ensure that SRIOV is enabled and VT-d is disabled.
4831703e94aSDeclan Doherty
4841703e94aSDeclan DohertyUninstall any existing QAT driver, for example by running:
4851703e94aSDeclan Doherty
4861703e94aSDeclan Doherty* ``./installer.sh uninstall`` in the directory where originally installed.
4871703e94aSDeclan Doherty
4881703e94aSDeclan Doherty
4891703e94aSDeclan DohertyBuild and install the SRIOV-enabled QAT driver::
4901703e94aSDeclan Doherty
4911703e94aSDeclan Doherty    mkdir /QAT
4921703e94aSDeclan Doherty    cd /QAT
493f546c1edSFiona Trahe
494bb44fb6fSFiona Trahe    # Copy the package to this location and unpack
495bb44fb6fSFiona Trahe    tar zxof qat1.7.l.4.2.0-000xx.tar.gz
4961703e94aSDeclan Doherty
497bb44fb6fSFiona Trahe    ./configure --enable-icp-sriov=host
498bb44fb6fSFiona Trahe    make install
4991703e94aSDeclan Doherty
500bb44fb6fSFiona TraheYou can use ``cat /sys/kernel/debug/qat<your device type and bdf>/version/fw`` to confirm the driver is correctly installed and is using firmware version 4.2.0.
501bb44fb6fSFiona TraheYou can use ``lspci -d:37c9`` to confirm the presence of the 16 VF devices available per ``C62x`` PF.
502bb44fb6fSFiona Trahe
503bb44fb6fSFiona TraheConfirm the driver is correctly installed and is using firmware version 4.2.0::
504bb44fb6fSFiona Trahe
505bb44fb6fSFiona Trahe    cat /sys/kernel/debug/qat<your device type and bdf>/version/fw
506bb44fb6fSFiona Trahe
507bb44fb6fSFiona Trahe
508bb44fb6fSFiona TraheConfirm the presence of 48 VF devices - 16 per PF::
509bb44fb6fSFiona Trahe
510bb44fb6fSFiona Trahe    lspci -d:37c9
511bb44fb6fSFiona Trahe
5121703e94aSDeclan Doherty
5131703e94aSDeclan DohertyTo complete the installation - follow instructions in `Binding the available VFs to the DPDK UIO driver`_.
5141703e94aSDeclan Doherty
515f546c1edSFiona Trahe.. Note::
516f546c1edSFiona Trahe
517f546c1edSFiona Trahe   If using a later kernel and the build fails with an error relating to
518f546c1edSFiona Trahe   ``strict_stroul`` not being available apply the following patch:
5191703e94aSDeclan Doherty
5201703e94aSDeclan Doherty   .. code-block:: diff
5211703e94aSDeclan Doherty
5221703e94aSDeclan Doherty      /QAT/QAT1.6/quickassist/utilities/downloader/Target_CoreLibs/uclo/include/linux/uclo_platform.h
5231703e94aSDeclan Doherty      + #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,5)
5241703e94aSDeclan Doherty      + #define STR_TO_64(str, base, num, endPtr) {endPtr=NULL; if (kstrtoul((str), (base), (num))) printk("Error strtoull convert %s\n", str); }
5251703e94aSDeclan Doherty      + #else
5261703e94aSDeclan Doherty      #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)
5271703e94aSDeclan Doherty      #define STR_TO_64(str, base, num, endPtr) {endPtr=NULL; if (strict_strtoull((str), (base), (num))) printk("Error strtoull convert %s\n", str); }
5281703e94aSDeclan Doherty      #else
5291703e94aSDeclan Doherty      #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25)
5301703e94aSDeclan Doherty      #define STR_TO_64(str, base, num, endPtr) {endPtr=NULL; strict_strtoll((str), (base), (num));}
5311703e94aSDeclan Doherty      #else
5321703e94aSDeclan Doherty      #define STR_TO_64(str, base, num, endPtr)                                 \
5331703e94aSDeclan Doherty           do {                                                               \
5341703e94aSDeclan Doherty                 if (str[0] == '-')                                           \
5351703e94aSDeclan Doherty                 {                                                            \
5361703e94aSDeclan Doherty                      *(num) = -(simple_strtoull((str+1), &(endPtr), (base))); \
5371703e94aSDeclan Doherty                 }else {                                                      \
5381703e94aSDeclan Doherty                      *(num) = simple_strtoull((str), &(endPtr), (base));      \
5391703e94aSDeclan Doherty                 }                                                            \
5401703e94aSDeclan Doherty           } while(0)
5411703e94aSDeclan Doherty      + #endif
5421703e94aSDeclan Doherty      #endif
5431703e94aSDeclan Doherty      #endif
5441703e94aSDeclan Doherty
5451703e94aSDeclan Doherty
546f546c1edSFiona Trahe.. Note::
5471703e94aSDeclan Doherty
548f546c1edSFiona Trahe   If the build fails due to missing header files you may need to do following::
5491703e94aSDeclan Doherty
550f546c1edSFiona Trahe      sudo yum install zlib-devel
551f546c1edSFiona Trahe      sudo yum install openssl-devel
552bb44fb6fSFiona Trahe      sudo yum install libudev-devel
5531703e94aSDeclan Doherty
554f546c1edSFiona Trahe.. Note::
5551703e94aSDeclan Doherty
556f546c1edSFiona Trahe   If the build or install fails due to mismatching kernel sources you may need to do the following::
5571703e94aSDeclan Doherty
558f546c1edSFiona Trahe      sudo yum install kernel-headers-`uname -r`
559f546c1edSFiona Trahe      sudo yum install kernel-src-`uname -r`
560f546c1edSFiona Trahe      sudo yum install kernel-devel-`uname -r`
5611703e94aSDeclan Doherty
562f2f639c6SDeepak Kumar Jain
5631703e94aSDeclan DohertyBinding the available VFs to the DPDK UIO driver
56459ad25feSFiona Trahe~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5651703e94aSDeclan Doherty
566f546c1edSFiona TraheUnbind the VFs from the stock driver so they can be bound to the uio driver.
5671703e94aSDeclan Doherty
568f546c1edSFiona TraheFor an Intel(R) QuickAssist Technology DH895xCC device
56959ad25feSFiona Trahe^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
570f546c1edSFiona Trahe
571f546c1edSFiona TraheThe unbind command below assumes ``BDFs`` of ``03:01.00-03:04.07``, if your
572f546c1edSFiona TraheVFs are different adjust the unbind command below::
5731703e94aSDeclan Doherty
5741703e94aSDeclan Doherty    for device in $(seq 1 4); do \
5751703e94aSDeclan Doherty        for fn in $(seq 0 7); do \
5761703e94aSDeclan Doherty            echo -n 0000:03:0${device}.${fn} > \
5771703e94aSDeclan Doherty            /sys/bus/pci/devices/0000\:03\:0${device}.${fn}/driver/unbind; \
5781703e94aSDeclan Doherty        done; \
5791703e94aSDeclan Doherty    done
5801703e94aSDeclan Doherty
581f546c1edSFiona TraheFor an Intel(R) QuickAssist Technology C62x device
58259ad25feSFiona Trahe^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5831703e94aSDeclan Doherty
584f546c1edSFiona TraheThe unbind command below assumes ``BDFs`` of ``1a:01.00-1a:02.07``,
585f546c1edSFiona Trahe``3d:01.00-3d:02.07`` and ``3f:01.00-3f:02.07``, if your VFs are different
586f546c1edSFiona Traheadjust the unbind command below::
587ae20c073SDeepak Kumar Jain
588ae20c073SDeepak Kumar Jain    for device in $(seq 1 2); do \
589ae20c073SDeepak Kumar Jain        for fn in $(seq 0 7); do \
590ae20c073SDeepak Kumar Jain            echo -n 0000:1a:0${device}.${fn} > \
591ae20c073SDeepak Kumar Jain            /sys/bus/pci/devices/0000\:1a\:0${device}.${fn}/driver/unbind; \
592ae20c073SDeepak Kumar Jain
593ae20c073SDeepak Kumar Jain            echo -n 0000:3d:0${device}.${fn} > \
594ae20c073SDeepak Kumar Jain            /sys/bus/pci/devices/0000\:3d\:0${device}.${fn}/driver/unbind; \
595ae20c073SDeepak Kumar Jain
596ae20c073SDeepak Kumar Jain            echo -n 0000:3f:0${device}.${fn} > \
597ae20c073SDeepak Kumar Jain            /sys/bus/pci/devices/0000\:3f\:0${device}.${fn}/driver/unbind; \
598ae20c073SDeepak Kumar Jain        done; \
599ae20c073SDeepak Kumar Jain    done
600ae20c073SDeepak Kumar Jain
601259310f3SFiona TraheFor Intel(R) QuickAssist Technology C3xxx or D15xx device
60259ad25feSFiona Trahe^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
603ae20c073SDeepak Kumar Jain
604f546c1edSFiona TraheThe unbind command below assumes ``BDFs`` of ``01:01.00-01:02.07``, if your
605f546c1edSFiona TraheVFs are different adjust the unbind command below::
606f2f639c6SDeepak Kumar Jain
607f2f639c6SDeepak Kumar Jain    for device in $(seq 1 2); do \
608f2f639c6SDeepak Kumar Jain        for fn in $(seq 0 7); do \
609f2f639c6SDeepak Kumar Jain            echo -n 0000:01:0${device}.${fn} > \
610f2f639c6SDeepak Kumar Jain            /sys/bus/pci/devices/0000\:01\:0${device}.${fn}/driver/unbind; \
611f2f639c6SDeepak Kumar Jain        done; \
612f2f639c6SDeepak Kumar Jain    done
613f2f639c6SDeepak Kumar Jain
614f546c1edSFiona TraheBind to the DPDK uio driver
61559ad25feSFiona Trahe^^^^^^^^^^^^^^^^^^^^^^^^^^^
616f2f639c6SDeepak Kumar Jain
617f546c1edSFiona TraheInstall the DPDK igb_uio driver, bind the VF PCI Device id to it and use lspci
618f546c1edSFiona Traheto confirm the VF devices are now in use by igb_uio kernel driver,
619f546c1edSFiona Trahee.g. for the C62x device::
620f546c1edSFiona Trahe
621f546c1edSFiona Trahe    cd to the top-level DPDK directory
622f546c1edSFiona Trahe    modprobe uio
623f546c1edSFiona Trahe    insmod ./build/kmod/igb_uio.ko
624f546c1edSFiona Trahe    echo "8086 37c9" > /sys/bus/pci/drivers/igb_uio/new_id
625f546c1edSFiona Trahe    lspci -vvd:37c9
626cb4a1d14SEoin Breen
627cb4a1d14SEoin Breen
628f546c1edSFiona TraheAnother way to bind the VFs to the DPDK UIO driver is by using the
629f546c1edSFiona Trahe``dpdk-devbind.py`` script::
630cb4a1d14SEoin Breen
631f546c1edSFiona Trahe    cd to the top-level DPDK directory
632c6dab2a8SThomas Monjalon    ./usertools/dpdk-devbind.py -b igb_uio 0000:03:01.1
6339333cfbaSPablo de Lara
634b1c9177bSFiona TraheTesting
635b1c9177bSFiona Trahe~~~~~~~
636b1c9177bSFiona Trahe
637bfd84d7eSArek KusztalQAT SYM crypto PMD can be tested by running the test application::
638b1c9177bSFiona Trahe
639b1c9177bSFiona Trahe    make defconfig
640a9de470cSBruce Richardson    make -j
641b1c9177bSFiona Trahe    cd ./build/app
642b1c9177bSFiona Trahe    ./test -l1 -n1 -w <your qat bdf>
643b1c9177bSFiona Trahe    RTE>>cryptodev_qat_autotest
644b1c9177bSFiona Trahe
645bfd84d7eSArek KusztalQAT ASYM crypto PMD can be tested by running the test application::
646bfd84d7eSArek Kusztal
647bfd84d7eSArek Kusztal    make defconfig
648bfd84d7eSArek Kusztal    make -j
649bfd84d7eSArek Kusztal    cd ./build/app
650bfd84d7eSArek Kusztal    ./test -l1 -n1 -w <your qat bdf>
651bfd84d7eSArek Kusztal    RTE>>cryptodev_qat_asym_autotest
652bfd84d7eSArek Kusztal
653b1c9177bSFiona TraheQAT compression PMD can be tested by running the test application::
654b1c9177bSFiona Trahe
655b1c9177bSFiona Trahe    make defconfig
656b1c9177bSFiona Trahe    sed -i 's,\(CONFIG_RTE_COMPRESSDEV_TEST\)=n,\1=y,' build/.config
657a9de470cSBruce Richardson    make -j
658b1c9177bSFiona Trahe    cd ./build/app
659b1c9177bSFiona Trahe    ./test -l1 -n1 -w <your qat bdf>
660b1c9177bSFiona Trahe    RTE>>compressdev_autotest
661b1c9177bSFiona Trahe
6629333cfbaSPablo de Lara
6635394c11dSFiona TraheDebugging
66459ad25feSFiona Trahe~~~~~~~~~
6655394c11dSFiona Trahe
6665394c11dSFiona TraheThere are 2 sets of trace available via the dynamic logging feature:
6675394c11dSFiona Trahe
6685394c11dSFiona Trahe* pmd.qat_dp exposes trace on the data-path.
6695394c11dSFiona Trahe* pmd.qat_general exposes all other trace.
6705394c11dSFiona Trahe
6715394c11dSFiona Trahepmd.qat exposes both sets of traces.
6725394c11dSFiona TraheThey can be enabled using the log-level option (where 8=maximum log level) on
6735394c11dSFiona Trahethe process cmdline, e.g. using any of the following::
6745394c11dSFiona Trahe
6755394c11dSFiona Trahe    --log-level="pmd.qat_general,8"
6765394c11dSFiona Trahe    --log-level="pmd.qat_dp,8"
6775394c11dSFiona Trahe    --log-level="pmd.qat,8"
6785394c11dSFiona Trahe
6795394c11dSFiona Trahe.. Note::
6805394c11dSFiona Trahe
6815394c11dSFiona Trahe    The global RTE_LOG_DP_LEVEL overrides data-path trace so must be set to
6825394c11dSFiona Trahe    RTE_LOG_DEBUG to see all the trace. This variable is in config/rte_config.h
6835394c11dSFiona Trahe    for meson build and config/common_base for gnu make.
6845394c11dSFiona Trahe    Also the dynamic global log level overrides both sets of trace, so e.g. no
6855394c11dSFiona Trahe    QAT trace would display in this case::
6865394c11dSFiona Trahe
6875394c11dSFiona Trahe	--log-level="7" --log-level="pmd.qat_general,8"
688