mbox series

[0/5] crypto: qat - enable telemetry for QAT GEN 4

Message ID 20231215152334.34524-1-lucas.segarra.fernandez@intel.com (mailing list archive)
Headers show
Series crypto: qat - enable telemetry for QAT GEN 4 | expand

Message

Lucas Segarra Fernandez Dec. 15, 2023, 3:23 p.m. UTC
Expose through debugfs telemetry data for QAT GEN4 devices.

This allows to gather metrics about the performance and the utilization
of a QAT device and/or a group of ring pairs. In particular, statistics
on (1) the utilization of the PCIe channel, (2) address translation and
device TLB, when SVA is enabled and (3) the internal engines for crypto
and data compression.

The device periodically gathers telemetry data from hardware registers
and writes it into a DMA memory region which is sampled by the driver.
The driver then uses this data to compute basic metrics on the counters
and exposes them through debugfs attributes in the folder
/sys/kernel/debug/qat_<device>_<BDF>/telemetry.

Here is a summary of the changes:
 * Patch #1 adds an helper function to math.h to compute the average of
   values within an array.
 * Patch #2 includes a missing header in the file adf_accel_devices.h to
   allow to use the macro GET_DEV().
 * Patch #3 introduces device level telemetry and the associated documentation
   in /Documentation/ABI.
 * Patch #4 extends #3 by introducing ring pair level telemetry and
   documentation about it.

This set is based on earlier work done by Wojciech Ziemba.

Lucas Segarra Fernandez (5):
  math.h: Add avg_array()
  crypto: qat - include pci.h for GET_DEV()
  crypto: qat - add admin msgs for telemetry
  crypto: qat - add support for device telemetry
  crypto: qat - add support for ring pair level telemetry

 .../ABI/testing/debugfs-driver-qat_telemetry  | 227 ++++++
 .../intel/qat/qat_420xx/adf_420xx_hw_data.c   |   3 +
 .../intel/qat/qat_4xxx/adf_4xxx_hw_data.c     |   3 +
 drivers/crypto/intel/qat/qat_common/Makefile  |   3 +
 .../intel/qat/qat_common/adf_accel_devices.h  |   6 +
 .../crypto/intel/qat/qat_common/adf_admin.c   |  37 +
 .../crypto/intel/qat/qat_common/adf_admin.h   |   4 +
 .../crypto/intel/qat/qat_common/adf_dbgfs.c   |   3 +
 .../intel/qat/qat_common/adf_gen4_hw_data.h   |   1 +
 .../crypto/intel/qat/qat_common/adf_gen4_tl.c | 153 +++++
 .../crypto/intel/qat/qat_common/adf_gen4_tl.h | 158 +++++
 .../crypto/intel/qat/qat_common/adf_init.c    |  12 +
 .../intel/qat/qat_common/adf_telemetry.c      | 287 ++++++++
 .../intel/qat/qat_common/adf_telemetry.h      |  99 +++
 .../intel/qat/qat_common/adf_tl_debugfs.c     | 648 ++++++++++++++++++
 .../intel/qat/qat_common/adf_tl_debugfs.h     | 116 ++++
 .../qat/qat_common/icp_qat_fw_init_admin.h    |  10 +
 include/linux/math.h                          |  33 +
 18 files changed, 1803 insertions(+)
 create mode 100644 Documentation/ABI/testing/debugfs-driver-qat_telemetry
 create mode 100644 drivers/crypto/intel/qat/qat_common/adf_gen4_tl.c
 create mode 100644 drivers/crypto/intel/qat/qat_common/adf_gen4_tl.h
 create mode 100644 drivers/crypto/intel/qat/qat_common/adf_telemetry.c
 create mode 100644 drivers/crypto/intel/qat/qat_common/adf_telemetry.h
 create mode 100644 drivers/crypto/intel/qat/qat_common/adf_tl_debugfs.c
 create mode 100644 drivers/crypto/intel/qat/qat_common/adf_tl_debugfs.h


base-commit: a7f74e2fbf7ab0a3b1cb4aff1deb3de3d5e1c381