• Lucas Segarra Fernandez's avatar
    crypto: qat - add support for device telemetry · 69e7649f
    Lucas Segarra Fernandez authored
    Expose through debugfs device telemetry data for QAT GEN4 devices.
    
    This allows to gather metrics about the performance and the utilization
    of a device. In particular, statistics on (1) the utilization of the
    PCIe channel, (2) address translation, when SVA is enabled and (3) the
    internal engines for crypto and data compression.
    
    If telemetry is supported by the firmware, the driver allocates a DMA
    region and a circular buffer. When telemetry is enabled, through the
    `control` attribute in debugfs, the driver sends to the firmware, via
    the admin interface, the `TL_START` command. This triggers the device to
    periodically gather telemetry data from hardware registers and write it
    into the DMA memory region. The device writes into the shared region
    every second.
    
    The driver, every 500ms, snapshots the DMA shared region into the
    circular buffer. This is then used to compute basic metric
    (min/max/average) on each counter, every time the `device_data` attribute
    is queried.
    
    Telemetry counters are exposed through debugfs in the folder
    /sys/kernel/debug/qat_<device>_<BDF>/telemetry.
    
    For details, refer to debugfs-driver-qat_telemetry in Documentation/ABI.
    
    This patch is based on earlier work done by Wojciech Ziemba.
    Signed-off-by: default avatarLucas Segarra Fernandez <lucas.segarra.fernandez@intel.com>
    Reviewed-by: default avatarGiovanni Cabiddu <giovanni.cabiddu@intel.com>
    Reviewed-by: default avatarDamian Muszynski <damian.muszynski@intel.com>
    Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
    69e7649f
adf_accel_devices.h 12 KB