mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 14:53:58 -04:00
crypto: qat - add fw_counters debugfs file
Expose FW counters statistics by providing the "fw_counters" file under debugfs. Currently the statistics include the number of requests sent to the FW and the number of responses received from the FW for each Acceleration Engine, for all the QAT product line. This patch is based on earlier work done by Marco Chiappero. Co-developed-by: Adam Guerin <adam.guerin@intel.com> Signed-off-by: Adam Guerin <adam.guerin@intel.com> Signed-off-by: Lucas Segarra Fernandez <lucas.segarra.fernandez@intel.com> Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
committed by
Herbert Xu
parent
20508b751b
commit
865b50fe6e
@@ -223,6 +223,24 @@ static int adf_get_dc_capabilities(struct adf_accel_dev *accel_dev,
|
||||
return 0;
|
||||
}
|
||||
|
||||
int adf_get_ae_fw_counters(struct adf_accel_dev *accel_dev, u16 ae, u64 *reqs, u64 *resps)
|
||||
{
|
||||
struct icp_qat_fw_init_admin_resp resp = { };
|
||||
struct icp_qat_fw_init_admin_req req = { };
|
||||
int ret;
|
||||
|
||||
req.cmd_id = ICP_QAT_FW_COUNTERS_GET;
|
||||
|
||||
ret = adf_put_admin_msg_sync(accel_dev, ae, &req, &resp);
|
||||
if (ret || resp.status)
|
||||
return -EFAULT;
|
||||
|
||||
*reqs = resp.req_rec_count;
|
||||
*resps = resp.resp_sent_count;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* adf_send_admin_init() - Function sends init message to FW
|
||||
* @accel_dev: Pointer to acceleration device.
|
||||
|
||||
Reference in New Issue
Block a user