Unverified Commit a22ee16d authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!5526 Intel: Backport QuickAssist Technology(QAT) in-tree driver

Merge Pull Request from: @allen-shi 
 
Intel® QuickAssist Technology (Intel® QAT) provides hardware acceleration for offloading security, authentication and compression services from the CPU, thus significantly increasing the performance and efficiency of standard platform solutions.

This PR is to support Intel QAT in-tree driver.

**Backported commits from upstream kernel v6.7 to v6.9(totally 71 commits):**
ed3d95fe788dec7c23bb20b41f8af47cbce04715 crypto: qat - make ring to service map common for QAT GEN4
a20a6060e0dd57fecaf55487985aef28bd08c6bf crypto: qat - fix ring to service map for dcc in 420xx
df018f82002a8b4dc407bc9a6f416b9241d14415 crypto: qat - fix ring to service map for dcc in 4xxx
bca79b9f5639b2fd4692904bce696291336e0246 crypto: qat - fix comment structure
ff391345141e727320ca906e6928c6a1f14e7e37 crypto: qat - remove unnecessary description from comment
a66cf93ab33853f17b8cc33a99263dd0a383a1a1 crypto: qat - remove double initialization of value
f99fb7d660f7c818105803f1f1915396a14d18ad crypto: qat - avoid division by zero
9a5dcada14d5e027856a1bc38443e54111438da6 crypto: qat - removed unused macro in adf_cnv_dbgfs.c
dfff0e35fa5dd84ae75052ba129b0219d83e46dc crypto: qat - remove unused macros in qat_comp_alg.c
bcc06e1b3dadc76140203753a08979374c965ada crypto: qat - uninitialized variable in adf_hb_error_inject_write()
2ecd43413d7668d67b9b8a56f882aa1ea12b8a62 Documentation: qat: fix auto_reset section
7d42e097607c4d246d99225bf2b195b6167a210c crypto: qat - resolve race condition during AER recovery
c2304e1a0b8051a60d4eb9c99a1c509d90380ae5 crypto: qat - change SLAs cleanup flow at shutdown
9567d3dc760931afc38f7f1144c66dd8c4b8c680 crypto: qat - improve aer error reset handling
750fa7c20e60926431ec50d63899771ffcd9fd5c crypto: qat - limit heartbeat notifications
f5419a4239af8b3951f990c83d0d8c865a485475 crypto: qat - add auto reset on error
2aaa1995a94a3187e52ddb9f127fa1307ee8ad00 crypto: qat - add fatal error notification
4469f9b2346834085fe4478ee1a851ee1de8ccb2 crypto: qat - re-enable sriov after pf reset
ec26f8e6c784ae391e69b19f4738d7196ed7794d crypto: qat - update PFVF protocol for recovery
758a0087db98fa23a3597289dbf3643ba9db2700 crypto: qat - disable arbitration before reset
ae508d7afb753f7576c435226e32b9535b7f8b10 crypto: qat - add fatal error notify method
e2b67859ab6efd4458bda1baaee20331a367d995 crypto: qat - add heartbeat error simulator
4da3bc65d218605557696109e42cfeee666d601f crypto: qat - use kcalloc_node() instead of kzalloc_node()
23a22e831ed4e6aa0831312e8cc8b7c60a657f60 crypto: qat - avoid memcpy() overflow warning
e1d54d153fc3e697b841999df7cbad51492def8e crypto: qat - fix arbiter mapping generation algorithm for QAT 402xx
5da6a2d5353e0e234f12ccacaf6f50656cc33278 crypto: qat - generate dynamically arbiter mappings
eb52707716e3f2cdf16f4e95e3a800cca190504f crypto: qat - add support for ring pair level telemetry
69e7649f7cc2aaa7889174456d39319a623c1a18 crypto: qat - add support for device telemetry
7f06679dd54a331d750e5d6f6f04a9df2eba72ff crypto: qat - add admin msgs for telemetry
b6e4b6eb1e6393580482581470a3a08c15ab977b crypto: qat - include pci.h for GET_DEV()
fcf60f4bcf54952cc14d14178c358be222dbeb43 crypto: qat - add support for 420xx devices
98a4f29fba0ffc1f1b026d9cb717fbe7edd66ffe crypto: qat - move fw config related structures
de51d22364921dcdb28ef34cd6276c38e126b899 crypto: qat - relocate portions of qat_4xxx code
b34bd0fd563df763ccca998b3d5fc824c536c28a crypto: qat - change signature of uof_get_num_objs()
4db87a5f9e3026d72e03bbdf1dac1dc5303e37f7 crypto: qat - relocate and rename get_service_enabled()
a643212c9f28d09225c3792c316bc4aaf6be4a68 crypto: qat - add NULL pointer check
487caa8d5ef9a9a27b092c5790d529a7a0c24f8b crypto: qat - fix mutex ordering in adf_rl
6627f03c21cb7001ae4dbbfb7a8514516d02331c crypto: qat - fix error path in add_update_sla()
d71fdd0f3c278c7f132c3a522645ebf9157edd6d crypto: qat - add sysfs_added flag for rate limiting
65089000ba8c2ae713ccac6603319143f3e1c08b crypto: qat - add sysfs_added flag for ras
e53c741303a59ee1682e11f61b7772863e02526d crypto: qat - prevent underflow in rp2srv_store()
8e92157d7f6190c86bfd6144a409001469827100 units: add missing header
9cba82bba500e3ce875381350f289cfb3aa633ba seq_file: add helper macro to define attribute for rw file
03c76e8e7a8d0d465838b8eaffcc07bdcc364f4d crypto: qat - move adf_cfg_services
71fed09b49c168435fc28d57870007495475d946 crypto: qat - add num_rps sysfs attribute
dbc8876dd873a6ac5e3191b419d2de5ca613165f crypto: qat - add rp2svc sysfs attribute
db74e16258198094701f18ab4da3410c44ffdb2e crypto: qat - add rate limiting sysfs interface
d9fb8408376e70a903d06ac86e42e0d0f44a5785 crypto: qat - add rate limiting feature to qat_4xxx
c7fd53796dbd09c3ef55032925bc7f8f238f9405 crypto: qat - add retrieval of fw capabilities
02e7f67c47269135f41650ac1b693034e3e8f507 crypto: qat - add bits.h to icp_qat_hw.h
e8eed5f7366f1f5decb694168bd06fb59ef6b12c units: Add BYTES_PER_*BIT
8e6857f76dafba874593107f9e5c20030c5956ed crypto: qat - move admin api
99b1c9826e481c3ebe6e7d905b7a0edf853639fd crypto: qat - count QAT GEN4 errors
532d7f6bc458042571752168bcb5e1fdc576b8c4 crypto: qat - add error counters
22289dc95833c6584aea1f4e8ab9f4f1641bb076 crypto: qat - add handling of errors from ERRSOU3 for QAT GEN4
86df79c3a40a0085555aaa475b4b16c8728ef952 crypto: qat - add adf_get_aram_base() helper function
b67bf7babe36c6c15623ec22ed13ec9069a6cf37 crypto: qat - add handling of compression related errors for QAT GEN4
895f7d532c843f49e0b6dc8341bb911b26da4731 crypto: qat - add handling of errors from ERRSOU2 for QAT GEN4
4926e89d19b0631d8f5f5f292c4caf0f0de08f4f crypto: qat - add reporting of errors from ERRSOU1 for QAT GEN4
df8c184b77a9c6d52e6c7627bbcb902cdc4d2171 crypto: qat - add reporting of correctable errors for QAT GEN4
93b2f7de7db598b0fe429948c739c212f8316330 crypto: qat - add infrastructure for error reporting
d807f0240c713bdd7c81a7e212f2feb0b5cd6725 crypto: qat - add cnv_errors debugfs file
e079231676e05d6c88fba4585db1ac399a790b63 crypto: qat - add pm_status debugfs file
756762decc604a5ac5c041f23dd447c5e691f459 crypto: qat - refactor included headers
4999999ed7e099fcc2476c8b3a245c4c2c9026c0 crypto: qat - add namespace to driver
e9dd20e0e5f62d01d9404db2cf9824d1faebcf71 crypto: qat - Remove zlib-deflate
141f12be09ac693e2384a7999f6782c7750c30a5 crypto: qat - Annotate struct adf_fw_counters with __counted_by
c362a58e8da7828cf1501e1af9d43cd6c9641c5b crypto: qat - do not shadow error code
3102bbcdcd3c945ef0bcea498d3a0c6384536d6c crypto: qat - refactor deprecated strncpy
65029eec5ceba7d847f27171cdddb046bdc3a069 crypto: qat - Use list_for_each_entry() helper
7ba98583448b7a0dbfa8121c7be642651e0abd61 Documentation: ABI: debugfs-driver-qat: fix fw_counters path

**Note: 3 upstream commits above added as dependent commits to fix compile dependent issue:**
8e92157d7f6190c86bfd6144a409001469827100 units: add missing header
9cba82bba500e3ce875381350f289cfb3aa633ba seq_file: add helper macro to define attribute for rw file
e8eed5f7366f1f5decb694168bd06fb59ef6b12c units: Add BYTES_PER_*BIT


**Already merged commits in upstream kernel v6.6 stable branch for QAT from v6.7 to v6.8(totally 12 commits):**
203b01001c4d741205b9c329acddc5193ed56fbd crypto: qat - fix deadlock in backlog processing
a238487f7965d102794ed9f8aff0b667cd2ae886 crypto: qat - fix ring to service map for QAT GEN4
f7df2329eec1729a606bba8ed1566a1b3c248bad crypto: qat - use masks for AE groups
2990d2edac6061c6f0f646a46e40957244be2268 crypto: qat - refactor fw config related functions
01aed663e6c421aeafc9c330bda630976b50a764 crypto: qat - fix double free during reset
4e4e2ed22d505c5bacf65c6a39bfb6d120d24785 crypto: qat - increase size of buffers
37b14f2dfa791fd485dbc536f8d1ffe8c6990290 crypto: qat - enable dc chaining service
71713766380712c8ab2d604605e7b0b20f977801 crypto: qat - consolidate services structure
11af152f784d9eca54e193140891ac52de36e9a9 crypto: qat - fix unregistration of compression algorithms
9b2f33a1bfcda90b857431a764c9c8f9a412bbe5 crypto: qat - fix unregistration of crypto algorithms
9c20cb8b1847dedddec3d5163079290542bf00bf crypto: qat - ignore subsequent state up commands
c9ca9756f376f51f985130a0e599d956065d4c44 crypto: qat - fix state machines cleanup paths

 **One commit to enable QAT kernel config:** 
a80a45cf Enable Intel QAT_4XXX as kernel module

Total commits: 71+1=72

### Test
Test is PASS on SPR, GNR & SRF platforms:
cpa_sample_code in qatlib PASS on both host and guest sides.


### Configs
CONFIG_CRYPTO_DEV_QAT_4XXX=m 
 
Link:https://gitee.com/openeuler/kernel/pulls/5526

 

Reviewed-by: default avatarJason Zeng <jason.zeng@intel.com>
Reviewed-by: default avatarWeilong Chen <chenweilong@huawei.com>
Reviewed-by: default avatarLiu Chao <liuchao173@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parents c8e916a3 a80a45cf
Loading
Loading
Loading
Loading
+49 −1
Original line number Diff line number Diff line
What:		/sys/kernel/debug/qat_<device>_<BDF>/qat/fw_counters
What:		/sys/kernel/debug/qat_<device>_<BDF>/fw_counters
Date:		November 2023
KernelVersion:	6.6
Contact:	qat-linux@intel.com
@@ -59,3 +59,51 @@ Description: (RO) Read returns the device health status.

		The driver does not monitor for Heartbeat. It is left for a user
		to poll the status periodically.

What:		/sys/kernel/debug/qat_<device>_<BDF>/pm_status
Date:		January 2024
KernelVersion:	6.7
Contact:	qat-linux@intel.com
Description:	(RO) Read returns power management information specific to the
		QAT device.

		This attribute is only available for qat_4xxx devices.

What:		/sys/kernel/debug/qat_<device>_<BDF>/cnv_errors
Date:		January 2024
KernelVersion:	6.7
Contact:	qat-linux@intel.com
Description:	(RO) Read returns, for each Acceleration Engine (AE), the number
		of errors and the type of the last error detected by the device
		when performing verified compression.
		Reported counters::

			<N>: Number of Compress and Verify (CnV) errors and type
			     of the last CnV error detected by Acceleration
			     Engine N.

What:		/sys/kernel/debug/qat_<device>_<BDF>/heartbeat/inject_error
Date:		March 2024
KernelVersion:	6.8
Contact:	qat-linux@intel.com
Description:	(WO) Write to inject an error that simulates an heartbeat
		failure. This is to be used for testing purposes.

		After writing this file, the driver stops arbitration on a
		random engine and disables the fetching of heartbeat counters.
		If a workload is running on the device, a job submitted to the
		accelerator might not get a response and a read of the
		`heartbeat/status` attribute might report -1, i.e. device
		unresponsive.
		The error is unrecoverable thus the device must be restarted to
		restore its functionality.

		This attribute is available only when the kernel is built with
		CONFIG_CRYPTO_DEV_QAT_ERROR_INJECTION=y.

		A write of 1 enables error injection.

		The following example shows how to enable error injection::

			# cd /sys/kernel/debug/qat_<device>_<BDF>
			# echo 1 > heartbeat/inject_error
+228 −0
Original line number Diff line number Diff line
What:		/sys/kernel/debug/qat_<device>_<BDF>/telemetry/control
Date:		March 2024
KernelVersion:	6.8
Contact:	qat-linux@intel.com
Description:	(RW) Enables/disables the reporting of telemetry metrics.

		Allowed values to write:
		========================
		* 0: disable telemetry
		* 1: enable telemetry
		* 2, 3, 4: enable telemetry and calculate minimum, maximum
		  and average for each counter over 2, 3 or 4 samples

		Returned values:
		================
		* 1-4: telemetry is enabled and running
		* 0: telemetry is disabled

		Example.

		Writing '3' to this file starts the collection of
		telemetry metrics. Samples are collected every second and
		stored in a circular buffer of size 3. These values are then
		used to calculate the minimum, maximum and average for each
		counter. After enabling, counters can be retrieved through
		the ``device_data`` file::

		  echo 3 > /sys/kernel/debug/qat_4xxx_0000:6b:00.0/telemetry/control

		Writing '0' to this file stops the collection of telemetry
		metrics::

		  echo 0 > /sys/kernel/debug/qat_4xxx_0000:6b:00.0/telemetry/control

		This attribute is only available for qat_4xxx devices.

What:		/sys/kernel/debug/qat_<device>_<BDF>/telemetry/device_data
Date:		March 2024
KernelVersion:	6.8
Contact:	qat-linux@intel.com
Description:	(RO) Reports device telemetry counters.
		Reads report metrics about performance and utilization of
		a QAT device:

		=======================	========================================
		Field			Description
		=======================	========================================
		sample_cnt		number of acquisitions of telemetry data
					from the device. Reads are performed
					every 1000 ms.
		pci_trans_cnt		number of PCIe partial transactions
		max_rd_lat		maximum logged read latency [ns] (could
					be any read operation)
		rd_lat_acc_avg		average read latency [ns]
		max_gp_lat		max get to put latency [ns] (only takes
					samples for AE0)
		gp_lat_acc_avg		average get to put latency [ns]
		bw_in			PCIe, write bandwidth [Mbps]
		bw_out			PCIe, read bandwidth [Mbps]
		at_page_req_lat_avg	Address Translator(AT), average page
					request latency [ns]
		at_trans_lat_avg	AT, average page translation latency [ns]
		at_max_tlb_used		AT, maximum uTLB used
		util_cpr<N>		utilization of Compression slice N [%]
		exec_cpr<N>		execution count of Compression slice N
		util_xlt<N>		utilization of Translator slice N [%]
		exec_xlt<N>		execution count of Translator slice N
		util_dcpr<N>		utilization of Decompression slice N [%]
		exec_dcpr<N>		execution count of Decompression slice N
		util_pke<N>		utilization of PKE N [%]
		exec_pke<N>		execution count of PKE N
		util_ucs<N>		utilization of UCS slice N [%]
		exec_ucs<N>		execution count of UCS slice N
		util_wat<N>		utilization of Wireless Authentication
					slice N [%]
		exec_wat<N>		execution count of Wireless Authentication
					slice N
		util_wcp<N>		utilization of Wireless Cipher slice N [%]
		exec_wcp<N>		execution count of Wireless Cipher slice N
		util_cph<N>		utilization of Cipher slice N [%]
		exec_cph<N>		execution count of Cipher slice N
		util_ath<N>		utilization of Authentication slice N [%]
		exec_ath<N>		execution count of Authentication slice N
		=======================	========================================

		The telemetry report file can be read with the following command::

		  cat /sys/kernel/debug/qat_4xxx_0000:6b:00.0/telemetry/device_data

		If ``control`` is set to 1, only the current values of the
		counters are displayed::

		  <counter_name> <current>

		If ``control`` is 2, 3 or 4, counters are displayed in the
		following format::

		  <counter_name> <current> <min> <max> <avg>

		If a device lacks of a specific accelerator, the corresponding
		attribute is not reported.

		This attribute is only available for qat_4xxx devices.

What:		/sys/kernel/debug/qat_<device>_<BDF>/telemetry/rp_<A/B/C/D>_data
Date:		March 2024
KernelVersion:	6.8
Contact:	qat-linux@intel.com
Description:	(RW) Selects up to 4 Ring Pairs (RP) to monitor, one per file,
		and report telemetry counters related to each.

		Allowed values to write:
		========================
		* 0 to ``<num_rps - 1>``:
		  Ring pair to be monitored. The value of ``num_rps`` can be
		  retrieved through ``/sys/bus/pci/devices/<BDF>/qat/num_rps``.
		  See Documentation/ABI/testing/sysfs-driver-qat.

		Reads report metrics about performance and utilization of
		the selected RP:

		=======================	========================================
		Field			Description
		=======================	========================================
		sample_cnt		number of acquisitions of telemetry data
					from the device. Reads are performed
					every 1000 ms
		rp_num			RP number associated with slot <A/B/C/D>
		service_type		service associated to the RP
		pci_trans_cnt		number of PCIe partial transactions
		gp_lat_acc_avg		average get to put latency [ns]
		bw_in			PCIe, write bandwidth [Mbps]
		bw_out			PCIe, read bandwidth [Mbps]
		at_glob_devtlb_hit	Message descriptor DevTLB hit rate
		at_glob_devtlb_miss	Message descriptor DevTLB miss rate
		tl_at_payld_devtlb_hit	Payload DevTLB hit rate
		tl_at_payld_devtlb_miss	Payload DevTLB miss rate
		======================= ========================================

		Example.

		Writing the value '32' to the file ``rp_C_data`` starts the
		collection of telemetry metrics for ring pair 32::

		  echo 32 > /sys/kernel/debug/qat_4xxx_0000:6b:00.0/telemetry/rp_C_data

		Once a ring pair is selected, statistics can be read accessing
		the file::

		  cat /sys/kernel/debug/qat_4xxx_0000:6b:00.0/telemetry/rp_C_data

		If ``control`` is set to 1, only the current values of the
		counters are displayed::

		  <counter_name> <current>

		If ``control`` is 2, 3 or 4, counters are displayed in the
		following format::

		  <counter_name> <current> <min> <max> <avg>


		On QAT GEN4 devices there are 64 RPs on a PF, so the allowed
		values are 0..63. This number is absolute to the device.
		If Virtual Functions (VF) are used, the ring pair number can
		be derived from the Bus, Device, Function of the VF:

		============ ====== ====== ====== ======
		PCI BDF/VF   RP0    RP1    RP2    RP3
		============ ====== ====== ====== ======
		0000:6b:0.1  RP  0  RP  1  RP  2  RP  3
		0000:6b:0.2  RP  4  RP  5  RP  6  RP  7
		0000:6b:0.3  RP  8  RP  9  RP 10  RP 11
		0000:6b:0.4  RP 12  RP 13  RP 14  RP 15
		0000:6b:0.5  RP 16  RP 17  RP 18  RP 19
		0000:6b:0.6  RP 20  RP 21  RP 22  RP 23
		0000:6b:0.7  RP 24  RP 25  RP 26  RP 27
		0000:6b:1.0  RP 28  RP 29  RP 30  RP 31
		0000:6b:1.1  RP 32  RP 33  RP 34  RP 35
		0000:6b:1.2  RP 36  RP 37  RP 38  RP 39
		0000:6b:1.3  RP 40  RP 41  RP 42  RP 43
		0000:6b:1.4  RP 44  RP 45  RP 46  RP 47
		0000:6b:1.5  RP 48  RP 49  RP 50  RP 51
		0000:6b:1.6  RP 52  RP 53  RP 54  RP 55
		0000:6b:1.7  RP 56  RP 57  RP 58  RP 59
		0000:6b:2.0  RP 60  RP 61  RP 62  RP 63
		============ ====== ====== ====== ======

		The mapping is only valid for the BDFs of VFs on the host.


		The service provided on a ring-pair varies depending on the
		configuration. The configuration for a given device can be
		queried and set using ``cfg_services``.
		See Documentation/ABI/testing/sysfs-driver-qat for details.

		The following table reports how ring pairs are mapped to VFs
		on the PF 0000:6b:0.0 configured for `sym;asym` or `asym;sym`:

		=========== ============ =========== ============ ===========
		PCI BDF/VF  RP0/service  RP1/service RP2/service  RP3/service
		=========== ============ =========== ============ ===========
		0000:6b:0.1 RP 0 asym    RP 1 sym    RP 2 asym    RP 3 sym
		0000:6b:0.2 RP 4 asym    RP 5 sym    RP 6 asym    RP 7 sym
		0000:6b:0.3 RP 8 asym    RP 9 sym    RP10 asym    RP11 sym
		...         ...          ...         ...          ...
		=========== ============ =========== ============ ===========

		All VFs follow the same pattern.


		The following table reports how ring pairs are mapped to VFs on
		the PF 0000:6b:0.0 configured for `dc`:

		=========== ============ =========== ============ ===========
		PCI BDF/VF  RP0/service  RP1/service RP2/service  RP3/service
		=========== ============ =========== ============ ===========
		0000:6b:0.1 RP 0 dc      RP 1 dc     RP 2 dc      RP 3 dc
		0000:6b:0.2 RP 4 dc      RP 5 dc     RP 6 dc      RP 7 dc
		0000:6b:0.3 RP 8 dc      RP 9 dc     RP10 dc      RP11 dc
		...         ...          ...         ...          ...
		=========== ============ =========== ============ ===========

		The mapping of a RP to a service can be retrieved using
		``rp2srv`` from sysfs.
		See Documentation/ABI/testing/sysfs-driver-qat for details.

		This attribute is only available for qat_4xxx devices.
+66 −0
Original line number Diff line number Diff line
@@ -95,3 +95,69 @@ Description: (RW) This configuration option provides a way to force the device i
			0

		This attribute is only available for qat_4xxx devices.

What:		/sys/bus/pci/devices/<BDF>/qat/rp2srv
Date:		January 2024
KernelVersion:	6.7
Contact:	qat-linux@intel.com
Description:
		(RW) This attribute provides a way for a user to query a
		specific ring pair for the type of service that it is currently
		configured for.

		When written to, the value is cached and used to perform the
		read operation. Allowed values are in the range 0 to N-1, where
		N is the max number of ring pairs supported by a device. This
		can be queried using the attribute qat/num_rps.

		A read returns the service associated to the ring pair queried.

		The values are:

		* dc: the ring pair is configured for running compression services
		* sym: the ring pair is configured for running symmetric crypto
		  services
		* asym: the ring pair is configured for running asymmetric crypto
		  services

		Example usage::

			# echo 1 > /sys/bus/pci/devices/<BDF>/qat/rp2srv
			# cat /sys/bus/pci/devices/<BDF>/qat/rp2srv
			sym

		This attribute is only available for qat_4xxx devices.

What:		/sys/bus/pci/devices/<BDF>/qat/num_rps
Date:		January 2024
KernelVersion:	6.7
Contact:	qat-linux@intel.com
Description:
		(RO) Returns the number of ring pairs that a single device has.

		Example usage::

			# cat /sys/bus/pci/devices/<BDF>/qat/num_rps
			64

		This attribute is only available for qat_4xxx devices.

What:		/sys/bus/pci/devices/<BDF>/qat/auto_reset
Date:		March 2024
KernelVersion:	6.8
Contact:	qat-linux@intel.com
Description:	(RW) Reports the current state of the autoreset feature
		for a QAT device

		Write to the attribute to enable or disable device auto reset.

		Device auto reset is disabled by default.

		The values are:

		* 1/Yy/on: auto reset enabled. If the device encounters an
		  unrecoverable error, it will be reset automatically.
		* 0/Nn/off: auto reset disabled. If the device encounters an
		  unrecoverable error, it will not be reset.

		This attribute is only available for qat_4xxx devices.
+41 −0
Original line number Diff line number Diff line
What:		/sys/bus/pci/devices/<BDF>/qat_ras/errors_correctable
Date:		January 2024
KernelVersion:	6.7
Contact:	qat-linux@intel.com
Description:	(RO) Reports the number of correctable errors detected by the device.

		This attribute is only available for qat_4xxx devices.

What:		/sys/bus/pci/devices/<BDF>/qat_ras/errors_nonfatal
Date:		January 2024
KernelVersion:	6.7
Contact:	qat-linux@intel.com
Description:	(RO) Reports the number of non fatal errors detected by the device.

		This attribute is only available for qat_4xxx devices.

What:		/sys/bus/pci/devices/<BDF>/qat_ras/errors_fatal
Date:		January 2024
KernelVersion:	6.7
Contact:	qat-linux@intel.com
Description:	(RO) Reports the number of fatal errors detected by the device.

		This attribute is only available for qat_4xxx devices.

What:		/sys/bus/pci/devices/<BDF>/qat_ras/reset_error_counters
Date:		January 2024
KernelVersion:	6.7
Contact:	qat-linux@intel.com
Description:	(WO) Write to resets all error counters of a device.

		The following example reports how to reset the counters::

			# echo 1 > /sys/bus/pci/devices/<BDF>/qat_ras/reset_error_counters
			# cat /sys/bus/pci/devices/<BDF>/qat_ras/errors_correctable
			0
			# cat /sys/bus/pci/devices/<BDF>/qat_ras/errors_nonfatal
			0
			# cat /sys/bus/pci/devices/<BDF>/qat_ras/errors_fatal
			0

		This attribute is only available for qat_4xxx devices.
+226 −0
Original line number Diff line number Diff line
What:		/sys/bus/pci/devices/<BDF>/qat_rl/sla_op
Date:		January 2024
KernelVersion:	6.7
Contact:	qat-linux@intel.com
Description:
		(WO) This attribute is used to perform an operation on an SLA.
		The supported operations are: add, update, rm, rm_all, and get.

		Input values must be filled through the associated attribute in
		this group before a write to this file.
		If the operation completes successfully, the associated
		attributes will be updated.
		The associated attributes are: cir, pir, srv, rp, and id.

		Supported operations:

		* add: Creates a new SLA with the provided inputs from user.
			* Inputs: cir, pir, srv, and rp
			* Output: id

		* get: Returns the configuration of the specified SLA in id attribute
			* Inputs: id
			* Outputs: cir, pir, srv, and rp

		* update: Updates the SLA with new values set in the following attributes
			* Inputs: id, cir, and pir

		* rm: Removes the specified SLA in the id attribute.
			* Inputs: id

		* rm_all: Removes all the configured SLAs.
			* Inputs: None

		This attribute is only available for qat_4xxx devices.

What:		/sys/bus/pci/devices/<BDF>/qat_rl/rp
Date:		January 2024
KernelVersion:	6.7
Contact:	qat-linux@intel.com
Description:
		(RW) When read, reports the current assigned ring pairs for the
		queried SLA.
		When wrote to, configures the ring pairs associated to a new SLA.

		The value is a 64-bit bit mask and is written/displayed in hex.
		Each bit of this mask represents a single ring pair i.e.,
		bit 1 == ring pair id 0; bit 3 == ring pair id 2.

		Selected ring pairs must to be assigned to a single service,
		i.e. the one provided with the srv attribute. The service
		assigned to a certain ring pair can be checked by querying
		the attribute qat/rp2srv.

		The maximum number of ring pairs is 4 per SLA.

		Applicability in sla_op:

		* WRITE: add operation
		* READ: get operation

		Example usage::

			## Read
			# echo 4 > /sys/bus/pci/devices/<BDF>/qat_rl/id
			# cat /sys/bus/pci/devices/<BDF>/qat_rl/rp
			0x5

			## Write
			# echo 0x5 > /sys/bus/pci/devices/<BDF>/qat_rl/rp

		This attribute is only available for qat_4xxx devices.

What:		/sys/bus/pci/devices/<BDF>/qat_rl/id
Date:		January 2024
KernelVersion:	6.7
Contact:	qat-linux@intel.com
Description:
		(RW) If written to, the value is used to retrieve a particular
		SLA and operate on it.
		This is valid only for the following operations: update, rm,
		and get.
		A read of this attribute is only guaranteed to have correct data
		after creation of an SLA.

		Applicability in sla_op:

		* WRITE: rm and update operations
		* READ: add and get operations

		Example usage::

			## Read
			## Set attributes e.g. cir, pir, srv, etc
			# echo "add" > /sys/bus/pci/devices/<BDF>/qat_rl/sla_op
			# cat /sys/bus/pci/devices/<BDF>/qat_rl/id
			4

			## Write
			# echo 7 > /sys/bus/pci/devices/<BDF>/qat_rl/id
			# echo "get" > /sys/bus/pci/devices/<BDF>/qat_rl/sla_op
			# cat /sys/bus/pci/devices/<BDF>/qat_rl/rp
			0x5  ## ring pair ID 0 and ring pair ID 2

		This attribute is only available for qat_4xxx devices.

What:		/sys/bus/pci/devices/<BDF>/qat_rl/cir
Date:		January 2024
KernelVersion:	6.7
Contact:	qat-linux@intel.com
Description:
		(RW) Committed information rate (CIR). Rate guaranteed to be
		achieved by a particular SLA. The value is expressed in
		permille scale, i.e. 1000 refers to the maximum device
		throughput for a selected service.

		After sending a "get" to sla_op, this will be populated with the
		CIR for that queried SLA.
		Write to this file before sending an "add/update" sla_op, to set
		the SLA to the specified value.

		Applicability in sla_op:

		* WRITE: add and update operations
		* READ: get operation

		Example usage::

			## Write
			# echo 500 > /sys/bus/pci/devices/<BDF>/qat_rl/cir
			# echo "add" /sys/bus/pci/devices/<BDF>/qat_rl/sla_op

			## Read
			# echo 4 > /sys/bus/pci/devices/<BDF>/qat_rl/id
			# echo "get" > /sys/bus/pci/devices/<BDF>/qat_rl/sla_op
			# cat /sys/bus/pci/devices/<BDF>/qat_rl/cir
			500

		This attribute is only available for qat_4xxx devices.

What:		/sys/bus/pci/devices/<BDF>/qat_rl/pir
Date:		January 2024
KernelVersion:	6.7
Contact:	qat-linux@intel.com
Description:
		(RW) Peak information rate (PIR). The maximum rate that can be
		achieved by that particular SLA. An SLA can reach a value
		between CIR and PIR when the device is not fully utilized by
		requests from other users (assigned to different SLAs).

		After sending a "get" to sla_op, this will be populated with the
		PIR for that queried SLA.
		Write to this file before sending an "add/update" sla_op, to set
		the SLA to the specified value.

		Applicability in sla_op:

		* WRITE: add and update operations
		* READ: get operation

		Example usage::

			## Write
			# echo 750 > /sys/bus/pci/devices/<BDF>/qat_rl/pir
			# echo "add" > /sys/bus/pci/devices/<BDF>/qat_rl/sla_op

			## Read
			# echo 4 > /sys/bus/pci/devices/<BDF>/qat_rl/id
			# echo "get" > /sys/bus/pci/devices/<BDF>/qat_rl/sla_op
			# cat /sys/bus/pci/devices/<BDF>/qat_rl/pir
			750

		This attribute is only available for qat_4xxx devices.

What:		/sys/bus/pci/devices/<BDF>/qat_rl/srv
Date:		January 2024
KernelVersion:	6.7
Contact:	qat-linux@intel.com
Description:
		(RW) Service (SRV). Represents the service (sym, asym, dc)
		associated to an SLA.
		Can be written to or queried to set/show the SRV type for an SLA.
		The SRV attribute is used to specify the SRV type before adding
		an SLA. After an SLA is configured, reports the service
		associated to that SLA.

		Applicability in sla_op:

		* WRITE: add and update operations
		* READ: get operation

		Example usage::

			## Write
			# echo "dc" > /sys/bus/pci/devices/<BDF>/qat_rl/srv
			# echo "add" > /sys/bus/pci/devices/<BDF>/qat_rl/sla_op
			# cat /sys/bus/pci/devices/<BDF>/qat_rl/id
			4

			## Read
			# echo 4 > /sys/bus/pci/devices/<BDF>/qat_rl/id
			# echo "get" > /sys/bus/pci/devices/<BDF>/qat_rl/sla_op
			# cat /sys/bus/pci/devices/<BDF>/qat_rl/srv
			dc

		This attribute is only available for qat_4xxx devices.

What:		/sys/bus/pci/devices/<BDF>/qat_rl/cap_rem
Date:		January 2024
KernelVersion:	6.7
Contact:	qat-linux@intel.com
Description:
		(RW) This file will return the remaining capability for a
		particular service/sla. This is the remaining value that a new
		SLA can be set to or a current SLA can be increased with.

		Example usage::

			# echo "asym" > /sys/bus/pci/devices/<BDF>/qat_rl/cap_rem
			# cat /sys/bus/pci/devices/<BDF>/qat_rl/cap_rem
			250
			# echo 250 > /sys/bus/pci/devices/<BDF>/qat_rl/cir
			# echo "add" > /sys/bus/pci/devices/<BDF>/qat_rl/sla_op
			# cat /sys/bus/pci/devices/<BDF>/qat_rl/cap_rem
			0

		This attribute is only available for qat_4xxx devices.
Loading