Skip to content

Commit cc0159e

Browse files
fionatrahegcabiddu
authored andcommitted
QATlib: 23.08.0 release
Changes from 23.02.0 to 23.08.0: * Removal of following insecure algorithms: Diffie-Hellman and Elliptic curves less than 256-bits. * Additional configuration profiles, including sym which facilitates improved symmetric crypto performance. * DC Chaining (Hash then compress). * Bug Fixes. See Resolved section in README.md Signed-off-by: Fiona Trahe <[email protected]>
1 parent 39e19d4 commit cc0159e

File tree

92 files changed

+3901
-2460
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+3901
-2460
lines changed

INSTALL

Lines changed: 110 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
===============================================================================
22

33

4-
February 2023
4+
August 2023
55
===============================================================================
66

77

@@ -33,7 +33,7 @@ Licensing
3333

3434
This product is released under the BSD-3-Clause License.
3535

36-
Files within this project have various inbound licences, listed below:
36+
Files within this project have various inbound licenses, listed below:
3737
- Dual BSD/GPLv2 License
3838
- BSD License
3939

@@ -47,6 +47,12 @@ For Dual BSD/GPLv2 please see the file headers of the relevant files.
4747

4848
===============================================================================
4949

50+
QATlib User's Guide
51+
===================
52+
53+
Web-based documentation for QATlib and related components is available at:
54+
https://intel.github.io/quickassist/qatlib/index.html
55+
5056

5157
Using the QATlib package
5258
========================
@@ -88,7 +94,8 @@ Check System Prerequisites
8894
intel_qat
8995
qat_4xxx
9096
They should load by default if using any of the following:
91-
* Linux kernel v5.11+ (This is for crypto, for compression use v5.17+)
97+
* Linux kernel v5.11+ (This is for crypto, for compression use v5.17+,
98+
for sym-only asym-only, sym;dc and asym;dc use v6.6+, for dcc use v6.7+)
9299
* Fedora 34+ (for compression use 36+)
93100
* RHEL 8.4+ (for compression use 9.0+)
94101
* each PF device must be bound to the 4xxx driver
@@ -113,6 +120,7 @@ Check System Prerequisites
113120
* sudo vi /etc/default/grub
114121
* to GRUB_CMDLINE_LINUX add "intel_iommu=on"
115122
* sudo grub2-mkconfig -o /etc/grub2-efi.cfg
123+
* sudo shutdown -r now
116124

117125

118126
===============================================================================
@@ -328,6 +336,9 @@ Compilation and installation - detailed instructions
328336
Run just one compress/decompress operation:
329337
./dc_stateless_sample
330338

339+
Run just one chaining hash then compress operation:
340+
./chaining_sample
341+
331342
----------------------------------------------------------------------------
332343

333344
6) Remove the libraries and cleanup
@@ -351,7 +362,7 @@ Compilation and installation - detailed instructions
351362

352363
7) Configuration and tuning
353364

354-
There are parameters which can be tweaked to optimise for an
365+
There are parameters which can be tweaked to optimize for an
355366
application's workload which might work in two modes:
356367
managed (when qat service is enabled) and standalone (without service)
357368

@@ -379,15 +390,40 @@ Compilation and installation - detailed instructions
379390
every odd-numbered PF has dc. I.e. PF0, PF2 ... support crypto
380391
and PF1, PF3 ... support data compression.
381392

393+
ServicesEnabled=sym
394+
All PFs, and so all VFs, have sym only.
395+
396+
ServicesEnabled=asym
397+
All PFs, and so all VFs, have asym only.
398+
382399
ServicesEnabled=sym;asym
383400
All PFs, and so all VFs, have sym;asym only.
384401

385402
ServicesEnabled=dc
386403
All PFs, and so all VFs, have dc only.
387404

405+
ServicesEnabled=sym;dc
406+
All PFs, and so all VFs, have sym;dc only.
407+
408+
ServicesEnabled=asym;dc
409+
All PFs, and so all VFs, have asym;dc only.
410+
411+
ServicesEnabled=dcc
412+
All PFs, and so all VFs, have dc instances enabled for chaining
413+
operations (hash then compress) only.
414+
415+
Note: Throughput is lower than dc. Only use this setting when
416+
chaining is needed.
417+
418+
388419
The following examples are based on a one-socket QAT 4xxx platform
389-
with 4 PFs, each PF has 16 VFs. Each VF enabled for dc has 4 instances,
390-
each VF enabled for sym;asym has 2 sym instances and 2 asym instances.
420+
with 4 PFs, each PF has 16 VFs. Each VF enabled for sym, asym, dc
421+
has 4 instances. Each VF enabled for mixed services like sym;asym,
422+
sym;dc, asym;dc has 2 instances of each type, so sym;asym has 2 cy
423+
instances (note that cy instance is and sym and asym together), sym;dc
424+
has 2 sym instances and 2 dc instances, asym;dc has 2 asym instances
425+
and 2 dc instances.
426+
391427
An instance is an abstraction used on the APIs to identify a unique path
392428
to the hardware. In a multi-threaded process, typically at least one
393429
instance is needed per thread.
@@ -407,17 +443,56 @@ Compilation and installation - detailed instructions
407443
The maximum number of processes is 32. 16 VFs * 4 PFs / POLICY.
408444
N sockets will have 32 * N.
409445

446+
Scalability and flexibility for crypto symmetric or asymmetric
447+
plus compression.
448+
POLICY=1. ServicesEnabled sym;dc or asym;dc. Each process will be
449+
allocated 1 VF, with sym;dc or asym;dc. So each will have
450+
2 sym or asym instances and 2 dc instances.
451+
The maximum number of processes is 64. 16 VFs * 4 PFs / POLICY.
452+
N sockets will have 64 * N.
453+
410454
Crypto-only scalability
411455
POLICY=1. ServicesEnabled=sym;asym. All VFs have sym;asym.
412456
Each process will be allocated 1 VF so will have 2 sym instances
413457
and 2 asym instances.
414458
The maximum number of processes is 64. 16 VFs * 4 PFs.
415459
N sockets will have 64 * N.
460+
Note: This configuration also provides optimized-throughput for
461+
asym.
462+
463+
Crypto-only optimized-throughput
464+
POLICY=0. ServicesEnabled=sym;asym. All VFs have sym;asym.
465+
Each process will be allocated 1 VF per PF which will have 2 sym
466+
instances and 2 asym instances, so each process will have
467+
(2 * number of PFs) of each instance type.
468+
The maximum number of processes is 16.
469+
470+
Sym-only optimized-throughput
471+
POLICY=0. ServicesEnabled=sym. All VFs have sym.
472+
Each process will be allocated 1 VF per PF which will have
473+
4 sym instances, so each process will have
474+
(4 * number of PFs) instances.
475+
The maximum number of processes is 16.
476+
477+
Compression-only scalability
478+
POLICY=1. ServicesEnabled=dc. All VFs have dc. Each process
479+
will be allocated 1 VF so will have 4 dc instances.
480+
The maximum number of processes is 64. 16 VFs * 4 PFs.
481+
N sockets will have 64 * N.
416482

417-
Compression-only scalability:
418-
POLICY=1. ServicesEnabled=dc. All VFs have dc. Each process
483+
Compression-only optimized-throughput
484+
POLICY=0. ServicesEnabled=dc. All VFs have dc.
485+
Each process will be allocated 1 VF per PF which will have
486+
4 dc instances, so each process will have
487+
(4 * number of PFs) instances.
488+
The maximum number of processes is 16.
489+
490+
Compression chaining scalability:
491+
POLICY=1. ServicesEnabled=dcc. All VFs have dc with sym
492+
capabilities but only for chaining operations. Each process
419493
will be allocated 1 VF so will have 4 dc instances.
420-
The maximum number of processes is 64. Same as for sym;asym
494+
The maximum number of processes is 64. 16 VFs * 4 PFs.
495+
N sockets will have 64 * N.
421496

422497
STANDALONE MODE
423498

@@ -447,6 +522,32 @@ Compilation and installation - detailed instructions
447522
/etc/sysconfig/qat, else it will not be deterministic which instances
448523
a process receives.
449524

525+
RUNNING IN A VIRTUAL MACHINE / GUEST
526+
527+
When passing VFs to a guest, the BDFs on the guest should facilitate qatlib
528+
recognizing whether VFs are from the same PF or not.
529+
So the libvirt XML file should specify that VFs from the same host
530+
(same domain + bus) are assigned to a common (domain + bus) on the guest,
531+
which is different to the (domain + bus) used for VFs from other PFs.
532+
533+
e.g. if VF on host 0000:6b:00.1 maps to <xxxx:xx>:00.1 on guest
534+
then 0000:6b:00.6 should map to <xxxx:xx>:00.6
535+
and 0000:7a:00.3 should map to <yyyy:yy>:00.3
536+
537+
The first VF, mapped to function='0x0', should also set multifunction='on'.
538+
539+
Sufficient VFs should be passed from the host to the guest to satisfy the
540+
type of services and number of processes needed by the guest. See here for
541+
more information on host configuration:
542+
https://intel.github.io/quickassist/qatlib/configuration.html#
543+
544+
If using the default kernel configuration, at least 2 VFs are needed per
545+
process so that the process has both CY and DC instances.
546+
Set either POLICY=0 or POLICY=2 (or 4, 6, ...) in /etc/sysconfig/qat on
547+
the guest and restart qatmgr.
548+
549+
550+
450551
SCRIPT TO VIEW QAT PF/VF SERVICE CONFIG
451552

452553
------------------------------------------------------------------------

README.md

Lines changed: 42 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
| Date | Doc Revision | Version | Details |
2828
|----------|:-------------:|------:|:------|
29+
| August 2023 | 010 | 23.08 | <br> - Removal of following insecure algorithms: Diffie-Hellman and Elliptic curves less than 256-bits. <br> - Additional configuration profiles, including sym which facilitates improved symmetric crypto performance. <br> - DC Chaining (Hash then compress) <br> - Bug Fixes. |
2930
| February 2023 | 009 | 23.02 | - Added configuration option --enable-legacy-algorithms to use these insecure crypto algorithms and disabled them by default (AES-ECB, SHA-1, SHA2-224, SHA3-224, RSA512/1024/1536, DSA)<br>- Refactored code in quickassist/utilities/libusdm_drv<br>- Bugfixes<br>- Updated documentation with configuration and tuning information |
3031
| November 2022 | 008 | 22.07.2 | - Changed from yasm to nasm for assembly compilation<br> - Added configuration option to use C implementation of soft CRC implementation instead of asm<br>- Added support for pkg-config<br>- Added missing lock around accesses to some global data in qatmgr |
3132
| October 2022 | 007 | 22.07.1 | - Fix for QATE-86605 |
@@ -70,7 +71,7 @@ The following services are available in qatlib via the QuickAssist API:
7071
* MGF1
7172
* Asymmetric (Public Key) Cryptography
7273
* Modular exponentiation and modular inversion up to 8192 bits
73-
* Diffie-Hellman (DH) key generation phase 1 and 2 up to 8192 bits
74+
* [Diffie-Hellman (DH)](#insecure-algorithms) key generation phase 1 and 2 up to 8192 bits
7475
* [RSA](#insecure-algorithms) key generation, encryption/decryption and digital signature
7576
generation/verification up to 8192 bits
7677
* [DSA](#insecure-algorithms) parameter generation and digital signature generation/verification
@@ -82,6 +83,8 @@ The following services are available in qatlib via the QuickAssist API:
8283
* Compress and Verify (CnV)
8384
* Compress and Verify and Recover (CnVnR)
8485
* End-to-end (E2E) integrity check
86+
* Compression Chaining (Deflate only)
87+
* Hash then compress
8588

8689
This package includes:
8790
* libqat: user space library for QAT devices exposed via the vfio kernel driver
@@ -97,6 +100,8 @@ The following algorithms are considered insecure and are disabled by default.
97100
* SHA3-224
98101
* RSA512/1024/1536
99102
* DSA
103+
* Diffie-Helman
104+
* Elliptic Curve Cryptography algorithms with less 256 bits
100105

101106
To enable these algorithms, use the following configuration option:
102107
* `--enable-legacy-algorithms`
@@ -122,25 +127,25 @@ The following features are not currently supported:
122127
* Dynamic instances
123128
* Intel® Key Protection Technology (KPT)
124129
* Event driven polling
125-
* More than 16 processes per end point
130+
* More than 16 processes per end point (16 is the maximum)
126131
* accumulateXXHash when combined with autoSelectBestHuffmanTree
127132
* accumulateXXHash in Decompression or Combined sessions
128133
* integrityCrcCheck for Compression direction requests
129134

130-
131135
## Environmental Assumptions
132136

133137
The following assumptions are made concerning the deployment environment:
134-
* Users within the same processing domain must be trusted.
135-
* The Intel® QAT device should not be exposed (via the "user space direct"
136-
deployment model) to untrusted users.
138+
* Users within the same processing domain must be trusted, i.e.: on the same
139+
host or within the same virtual machine, users must trust each other.
140+
* The library can be used by unprivileged users if those users are included in
141+
the 'qat' group.
137142
* DRAM is considered to be inside the trust boundary. The typical memory
138143
protection schemes provided by the Intel architecture processor and memory
139144
controller, and by the operating system, prevent unauthorized access to these
140145
memory regions.
141146
* A QuickAssist kernel driver for the supported device is installed, which has
142-
discovered and initialised the device, exposing the VFs. This driver is
143-
included in the Linux kernel, see [INSTALL](INSTALL) for information about which kernel
147+
discovered and initialized the device, exposing the VFs. This driver is
148+
included in the Linux kernel, see [INSTALL](INSTALL) for information about which kernel
144149
to use.
145150
* The library can be used by unprivileged users if that user is included in
146151
the 'qat' group.
@@ -174,7 +179,9 @@ where: \<Component\> is one of the following:
174179
| QATE-3241 | [CY - cpaCySymPerformOp when used with parameter checking may reveal the amount of padding.](#qate-3241) |
175180
| QATE-41707 | [CY - Incorrect digest returned when performing a plain hash operation on input data of size 4GB or larger.](#qate-41707) |
176181
| QATE-76073 | [GEN - If PF device configuration is modified without restarting qatmgr, undefined behavior may occur.](#qate-76073) |
177-
| QATE-76698 | [GEN- Multi-process applications running in guest will fail when running with default Policy settings.](#qate-76698) |
182+
| QATE-76698 | [GEN - Multi-process applications running in guest will fail when running with default Policy settings.](#qate-76698) |
183+
| QATE-94286 | [CY - Compression services not detected when crypto-capable VFs are added to VM.](#qate-94286) |
184+
| QATE-94369 | [GEN - SELinux Preventing QAT Service Startup](#qate-94369) |
178185

179186
## QATE-3241
180187
| Title | CY - cpaCySymPerformOp when used with parameter checking may reveal the amount of padding. |
@@ -211,28 +218,48 @@ where: \<Component\> is one of the following:
211218
| Title | GEN - Multi-process applications running in guest will fail when running with default Policy settings. |
212219
|----------|:-------------
213220
| Reference # | QATE-76698 |
214-
| Description | The default Policy setting results in process receiving all available VFs allocated to guest operating system. In the case of a multi-process application, failures will be observed as all available QAT resources are consumed by the first process. |
221+
| Description | The default Policy setting results in process receiving all available VFs allocated to guest operating system.  In the case of a multi-process application, failures will be observed as all available QAT resources are consumed by the first process. |
215222
| Implication | Multi-process applications running in guest OS will fail with default Policy settings. |
216-
| Resolution | When passing VFs to a guest, the libvirt XML file should specify that all VFs from a given PF (i.e. with the same host domain + bus) are assigned to a common bus on the guest. The first VF, mapped to function='0x0', should also set `multifunction='on'`. Also, if n processes are needed in the guest, then n VFs from each PF should be passed to the guest, to ensure all guest processes have both compression and crypto instances. In addition, on either host or guest, don’t use POLICY=1 as it will only allocate 1 instance. At least 2 instances are needed so a process has both CY and DC instances. Set either POLICY=0 or POLICY=2 (or 4, 6, ...) in `/etc/sysconfig/qat` and restart qatmgr. |
223+
| Resolution | If more than 1 process is needed in a guest OS, set POLICY=n (where n>0) in /etc/sysconfig/qat and restart qatmgr. The process will then receive n VFs. See RUNNING IN A VIRTUAL MACHINE / GUEST section of INSTALL for details. |
217224
| Affected OS | Linux |
218225
| Driver/Module | CPM-IA - General |
219226

227+
## QATE-94286
228+
| Title | GEN - Compression services not detected when crypto-capable VFs are also added to VM. |
229+
|----------|:-------------
230+
| Reference # | QATE-94286 |
231+
| Description | When configuring a system with different services on different QAT end-points, e.g. asym;sym on one and dc on another, and exposing only one of those Virtual Function (VF) types to the Virtual Machine (VM), the application works as expected. However, when VFs of more than one type are passed to the same VM, the application may only recognize one service-type, e.g. it may detect crypto instances, but not compression instances. There is an assumption that all VFs provide the same services if they come from the same PF. However, detecting which PF they come from is based on domain+bus, which is not always a valid assumption on a VM. |
232+
| Implication | This issue prevents the detection of compression services in a virtualized environment when the default kernel configuration is used, and crypto and dc VFs are passed to the VM, potentially impacting the proper functioning of the system. |
233+
| Resolution | When passing VFs to a guest, the BDFs on the guest should facilitate qatlib recognizing whether VFs are from the same PF or not. See RUNNING IN A VIRTUAL MACHINE / GUEST section of INSTALL for details. |
234+
| Affected OS | Linux |
235+
| Driver/Module | CPM-IA - General |
236+
237+
## QATE-94369
238+
| Title | GEN - SELinux Preventing QAT Service Startup |
239+
|----------|:-------------
240+
| Reference # | QATE-94286 |
241+
| Description | The qat service fails to start due to SELinux preventing the qat_init.sh script and qatmgr from accessing resources. The issue occurs when the system is running with SELinux enabled, causing insufficient permissions for the qat_init.sh script and qatmgr to function correctly. |
242+
| Implication | This issue affects the proper functioning of the qat service on systems with SELinux enabled, potentially preventing QAT virtual functions (VFs) from functioning. |
243+
| Resolution | None available. |
244+
| Affected OS | Linux |
245+
| Driver/Module | QAT Linux Upstream - User |
246+
220247
## Resolved Issues
221248
Resolved issues relating to the Intel® QAT software are described
222249
in this section.
223250

224251
| Issue ID | Description |
225252
|-------------|------------|
226-
| QATE-76846 | [GEN - Forking and re-initialising use-cases do not work](#qate-76846) |
253+
| QATE-76846 | [GEN - Forking and re-initializing use-cases do not work](#qate-76846) |
227254
| QATE-78459 | [DC - cpaDcDeflateCompressBound API returns incorrect output buffer size when input size exceeds 477218588 bytes.](#qate-74786) |
228255
| QATE-12241 | [CY - TLS1.2 with secret key lengths greater than 64 are not supported.](#qate-12241) |
229256

230257
## QATE-76846
231-
| Title | GEN - Forking and re-initialising use-cases do not work |
258+
| Title | GEN - Forking and re-initializing use-cases do not work |
232259
|----------|:-------------
233260
| Reference # | QATE-76846 |
234-
| Description | Forking and re-initialising use-cases do not work:<br>-icp_sal_userStart()/icp_sal_userStop()/icp_sal_userStart() in single process<br>-icp_sal_userStart()/fork()/icp_sal_userStart() in child.<br> This is the usecase in openssh + QAT_Engine. |
235-
| Implication | The process will have undefined behaviour in these use-cases. |
261+
| Description | Forking and re-initializing use-cases do not work:<br>-icp_sal_userStart()/icp_sal_userStop()/icp_sal_userStart() in single process<br>-icp_sal_userStart()/fork()/icp_sal_userStart() in child.<br> This is the use case in openssh + QAT_Engine. |
262+
| Implication | The process will have undefined behavior in these use-cases. |
236263
| Resolution | This issue is resolved with the 21.08 release. If using release prior to this release and using these flows, call qaeMemDestroy() immediately after icp_sal_userStop() to prevent this issue. |
237264
| Affected OS | Linux |
238265
| Driver/Module | CPM-IA - General |

0 commit comments

Comments
 (0)