11===============================================================================
22
33
4- November, 2020
4+ May 2021
55===============================================================================
66
7+
78Reference
89=========
910
@@ -28,7 +29,7 @@ install source packages.
2829
2930
3031Licensing
31- ==========
32+ =========
3233
3334This product is released under the BSD-3-Clause License.
3435
@@ -47,73 +48,271 @@ For Dual BSD/GPLv2 please see the file headers of the relevant files.
4748===============================================================================
4849
4950
50- Compilation and installation
51- ============================
51+ Using the QATlib package
52+ ========================
53+
54+ Note: Instructions assume running on Fedora and as non-root user who can
55+ get root access using sudo, i.e. user is in sudoers group. Command-lines
56+ may be different in other Linux distributions.
57+
58+
59+ Check System Prerequisites
60+ ==========================
61+
62+ There are some prerequisites to running the software in this package. If
63+ running from a distro many of these are taken care of, if not here they
64+ are:
65+
66+ * platform must have an Intel® Communications Chipset 4xxx Series device
67+ Use "lspci -d 8086:4940" to check PF devices exist.
68+ Use "lspci -d 8086:4941" to check VF devices exist.
69+ VFs are only visible if all prerequisites below are satisfied.
70+ * firmware must be available
71+ Check that these files exist, if not contact
[email protected] 72+ /lib/firmware/qat_4xxx.bin
73+ /lib/firmware/qat_4xxx_mmp.bin
74+ * kernel driver must be running
75+ Use "lsmod | grep qat" to check that these kernel modules are running:
76+ intel_qat
77+ qat_4xxx
78+ They should load by default if using any of the following:
79+ * Linux kernel v5.11+
80+ * Fedora 34+
81+ * RHEL 8.4+
82+ * BIOS settings
83+ Intel VT-d and SR-IOV must be enabled in the platform BIOS.
84+ Consult your platform guide on how to do this.
85+ If using an Intel BKC these usually default to on, you can verify by
86+ rebooting, entering F2 on the console to get to the BIOS menus and
87+ checking these are enabled:
88+ EDKII Menu
89+ -> Socket Configuration
90+ -> IIO Configuration
91+ -> Intel VT for Directed I/O (VT-d)
92+ -> Intel VT for Directed I/O
93+ EDKII Menu
94+ -> Platform Configuration
95+ -> Miscellaneous Configuration
96+ -> SR-IOV Support
97+ * Grub settings
98+ set intel_iommu on in grub file, e.g. in Fedora:
99+ * sudo vi /etc/default/grub
100+ * to GRUB_CMDLINE_LINUX add "intel_iommu=on"
101+ * sudo grub2-mkconfig -o /etc/grub2-efi.cfg
102+
103+
104+ ===============================================================================
105+
106+
107+ Compilation and installation - quickstart instructions
108+ ======================================================
109+
110+ Note, more detailed instructions in following section.
111+
112+ ---------------------------------------------------------------------------
113+
114+ Summary if running from Fedora 34+:
115+ # Install qatlib
116+ sudo dnf install -y qatlib
117+
118+ # Add your user to qat group
119+ sudo usermod -a -G qat `whoami`
120+
121+ # Enable qat service and make persistent after reboot
122+ sudo systemctl enable qat
123+ sudo systemctl start qat
124+
125+ # Increase amount of locked memory for your user
126+ # To add 200MB:
127+ sudo cp /etc/security/limits.conf /etc/security/limits.conf.qatlib_bak
128+ echo `whoami` - memlock 200000 | sudo tee -a /etc/security/limits.conf > /dev/null
129+
130+ # Re-login in order to update the user's group
131+ sudo su -l $USER
132+
133+ # If you want to run sample code you need to build from sources, these
134+ # steps will clone it into ~/qatlib, i.e. into your home directory.
135+ # Install dependencies
136+ sudo dnf install -y gcc systemd-devel automake autoconf libtool
137+ sudo dnf install -y openssl-devel zlib-devel
138+
139+ # Clone qatlib repo
140+ git clone https://github.com/intel/qatlib.git
141+
142+ # Build sample code
143+ cd qatlib
144+ ./autogen.sh
145+ ./configure
146+ make cpa_sample_code
147+
148+ # Run it! (takes about 5 mins)
149+ ./cpa_sample_code
150+
151+ ----------------------------------------------------------------------------
152+
153+ Summary if building from sources.
154+
155+ # Install dependencies
156+ sudo dnf install -y gcc systemd-devel automake autoconf libtool
157+ sudo dnf install -y openssl-devel zlib-devel
158+
159+ # Clone QATlib into ~/qatlib, i.e. in your home dir
160+ cd ~
161+ git clone https://github.com/intel/qatlib.git
162+
163+ # Build and install library
164+ cd qatlib
165+ ./autogen.sh
166+ ./configure --enable-service
167+ make -j
168+ sudo make install
169+
170+ # Add your user to the "qat" group which was automatically
171+ # created by --enable-service
172+ sudo usermod -a -G qat `whoami`
173+
174+ # Increase amount of locked memory for your user
175+ # To add 200MB:
176+ sudo cp /etc/security/limits.conf /etc/security/limits.conf.qatlib_bak
177+ echo `whoami` - memlock 200000 | sudo tee -a /etc/security/limits.conf > /dev/null
178+
179+ # Re-login in order to update the user group, this will move you back
180+ # into your home dir
181+ sudo su -l $USER
182+
183+ # Run! (takes about 5 mins)
184+ ./qatlib/cpa_sample_code
52185
53- 1) QAT compilation requires following dependencies:
186+
187+ ===============================================================================
188+
189+
190+ Compilation and installation - detailed instructions
191+ ====================================================
192+
193+ 1) Install compilation dependencies
194+
195+ If running from a distro most or all of QATlib depends are taken care
196+ of, if not use your OS-specific commands to install the following:
54197
55198 tools:
56- gcc
57- make
58- autotools (automake, autoconf, libtool)
59- systemd-devel
199+ gcc
200+ make
201+ autotools (automake, autoconf, libtool)
202+ systemd-devel
60203
61204 libraries:
62- openssl-devel
63- zlib-devel
205+ openssl-devel
206+ zlib-devel
64207
65- ===============================================================================
208+ ----------------------------------------------------------------------------
66209
67- 2) Configuration process:
68- To generate configure script - call:
69- ./autogen.sh
210+ 2) Download package and configure it
70211
71- To setup the default build configuration - call:
72- ./configure
212+ To generate configure script - call:
213+ ./autogen.sh
73214
74- Any other configuration setup can be found under
75- "configuration options section" or by calling:
215+ To setup the default build configuration - call:
216+ ./configure
76217
77- ./configure --help
218+ Full list of configuration options can be found under
219+ "Configuration options" section below or by calling:
220+ ./configure --help
78221
79- To setup configuration that will automatically enable qat service
80- during installation - call:
81- ./configure --enable-service
222+ To setup configuration that will automatically enable qat service
223+ during installation - call:
224+ ./configure --enable-service
82225
83- ===============================================================================
226+ ----------------------------------------------------------------------------
227+
228+ 3) Configure the system
229+
230+ Create the "qat" group.
231+ qat.service requires "qat" group
232+ This is automatically created by configure --enable-service so this
233+ step can be skipped. To manually create the group:
234+ sudo groupadd qat
235+
236+ Add your user to "qat" group.
237+ To be able to use QATlib functionalities as non root user, user must
238+ be part of the qat group. To add your user to the qat group
239+ sudo usermod -a -G qat <your user>
240+
241+ Set maximum amount of locked memory for your user.
242+ The maximum amount of locked memory should be set correctly by
243+ defining memlock limit. At least 200000 kB are required.
244+ Add a line like this
245+ <your user> - memlock 200000
246+ in the file /etc/security/limits.conf.
247+
248+ After making user changes it's necessary to re-login for them to
249+ take effect
250+ sudo su -l $USER
84251
85- 3) Compilation process:
252+ ----------------------------------------------------------------------------
86253
87- After the package has been configured properly,
88- follow the steps below:
254+ 4) Compile and install the library
89255
90256 Build and install:
91- make
92- make install
257+ make -j
258+ sudo make install
93259
94- Build and install sample code:
95- make samples
96- make samples-install
260+ If the service was not configured to start automatically, by using
261+ --enable-service then it will need to be started. To start it
262+ and make persistent after reboot:
263+ systemctl enable qat
264+ systemctl start qat
97265
98- Uninstall and clean up:
99- make uninstall
100- make clean
101- make distclean
266+ ----------------------------------------------------------------------------
267+
268+ 5) Run sample application
269+
270+ Sample code is built by default.
271+ Information on running the performance sample-code is at
272+ ./quickassist/lookaside/access_layer/src/sample_code/README.txt
273+
274+ Examples:
275+ Run all performance tests:
276+ ./cpa_sample_code
277+
278+ Symmetric crypto tests only:
279+ ./cpa_sample_code runTests=1
280+
281+ Asymmetric crypto RSA tests only:
282+ ./cpa_sample_code runTests=2
283+
284+ Run just one symmetric cipher operation:
285+ ./cipher_sample
286+
287+ ----------------------------------------------------------------------------
288+
289+ 6) Remove the libraries and cleanup
290+
291+ Uninstall:
292+ sudo systemctl stop qat
293+ sudo systemctl disable qat
294+ sudo make uninstall
295+
296+ Clean up:
297+ make clean
298+ make distclean
102299
103300===============================================================================
104301
105- 4) Configuration options
106302
107- Typical examples of how to update configuration options are as follows:
303+ Full list of Configuration options
304+ ==================================
305+
306+ Typical examples of how to update configuration options are as follows:
108307
109308 ./configure ICP_ANY_FLAG=value or
110309 ./configure --enable-something
111310
112- If it is required to use more than one flag at once:
311+ If it is required to use more than one flag at once:
113312
114313 ./configure ICP_ANY_PATH=path ICP_ANY_NAME=name --enable-something
115314
116- Features flags:
315+ Features flags:
117316 Enables or disables the additional features supported by 4xxx package
118317
119318 --disable-option-checking
@@ -173,19 +372,48 @@ Features flags:
173372 Type: value
174373 Default value: 50
175374
375+
176376===============================================================================
177377
178- 5) System configuration
179378
180- qat.service requires "qat" group to be created (by calling groupadd qat).
181- If --enable-service configure option was used, such group will be created
182- automatically during installation and this step can be skipped.
379+ Common issues
380+ =============
381+
382+ Issue: errors like these are seen in system logs:
383+ * 4xxx 0000:6b:00.0: IOMMU should be enabled for SR-IOV to work
384+ * vfio-pci: probe of 0000:6b:00.1 failed with error -22
385+ Likely cause: Check VT-d, SR-IOV and intel_iommu settings are correct as
386+ described above. One way to check that is to run:
387+ dmesg | grep "Virtualization Technology"
388+ If you get output similar to below, everything is ready, otherwise
389+ there is something misconfigured.
390+ "[57.503644] DMAR: Intel(R) Virtualization Technology for Directed I/O"
391+
392+ Issue: On running sample code:
393+ qaeMemInit started
394+ Open failed on /dev/vfio/15
395+ No device found
396+ ADF_UIO_PROXY err: icp_adf_userProcessToStart: Failed to start SSL...
397+ Likely cause: Incorrect permissions. Use "id <your user>" to verify the
398+ user is in the qat group and logout/login to the shell to ensure group
399+ changes take effect.
400+
401+ Issue: On running sample code:
402+ qaeMemInit started
403+ No device found
404+ ADF_UIO_PROXY err: icp_adf_userProcessToStart: Failed to start SSL...
405+ Likely cause: (1) No PF driver available. Check that PFs are available and
406+ bound to qat_4xxx:
407+ sudo lspci -vvd:4940 |grep "Kernel driver in use".
408+ If no driver in use, upgrade to Linux kernel 5.11 or greater.
409+ (2) No VFs available. Check VFs are available and bound to vfio-pci
410+ sudo lspci -vvd:4941 |grep "Kernel driver in use"
411+
412+ Issue: On running ./autogen.sh following warning appears:
413+ aclocal: warning: couldn't open directory 'm4': No such file or dir...
414+ Likely cause: This warning can be ignored, as is resolved subsequently
183415
184- To be able to use libqat functionalities as non root user:
185- * the maximum amount of locked memory should be set correctly by defining
186- memlock limit in the file /etc/security/limits.conf. At least 200000 kB
187- are required.
188- * user has to be part of qat group
416+ ===============================================================================
189417
190418
191419Legal/Disclaimers
@@ -205,7 +433,7 @@ not intended for use in medical, life saving, life sustaining, critical control
205433Intel may make changes to specifications and product descriptions at any time,
206434without notice.
207435
208- (C) Intel Corporation 2020
436+ (C) Intel Corporation 2021
209437
210438* Other names and brands may be claimed as the property of others.
211439
0 commit comments