Linux cryptographic layer development
 help / color / mirror / Atom feed
From: George Abraham P <george.abraham.p@intel.com>
To: herbert@gondor.apana.org.au
Cc: linux-crypto@vger.kernel.org, qat-linux@intel.com,
	George Abraham P <george.abraham.p@intel.com>,
	Giovanni Cabiddu <giovanni.cabiddu@intel.com>,
	Ahsan Atta <ahsan.atta@intel.com>
Subject: [PATCH 3/3] crypto: qat - fix telemetry command queue counts
Date: Mon, 19 Oct 2026 16:33:56 +0530	[thread overview]
Message-ID: <20261019110356.3781949-4-george.abraham.p@intel.com> (raw)
In-Reply-To: <20261019110356.3781949-1-george.abraham.p@intel.com>

QAT GEN6 telemetry derives the number of command queues for each slice
type by multiplying the slice count reported by firmware by a per-slice
multiplier. However, the number of command queues for a slice type is
fixed and does not scale with the number of slices. For example, WAT
(wireless auth) and WCP (wireless cipher) slices have 18 command queues
across four slices. In addition, the per-slice queue counts for the PKE
(public key encryption), WAT, WCP, UCS (crypto) and ATH (auth) slices do
not match the hardware (for example, PKE has 18 command queues, not 1).
This results in an incorrect number of command queue counters being
reported.

Replace the per-slice multipliers with the total number of command
queues for each slice type, and report that count only when the
corresponding slice type is present. Update the PKE, WAT, WCP, UCS and
ATH queue count constants, rename the multiplier field in struct
adf_tl_hw_data to cmdq_cnt, and fix the USC_QUEUE_COUNT typo to
UCS_QUEUE_COUNT.

Fixes: 3ed63344657a ("crypto: qat - add command queue telemetry counters for GEN6")
Signed-off-by: George Abraham P <george.abraham.p@intel.com>
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Reviewed-by: Ahsan Atta <ahsan.atta@intel.com>
---
 .../crypto/intel/qat/qat_common/adf_gen6_tl.c | 24 +++++++++----------
 .../intel/qat/qat_common/adf_telemetry.c      | 14 +++++------
 .../intel/qat/qat_common/adf_telemetry.h      |  2 +-
 3 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/drivers/crypto/intel/qat/qat_common/adf_gen6_tl.c b/drivers/crypto/intel/qat/qat_common/adf_gen6_tl.c
index faa60b04c406..2e5d909a3e3e 100644
--- a/drivers/crypto/intel/qat/qat_common/adf_gen6_tl.c
+++ b/drivers/crypto/intel/qat/qat_common/adf_gen6_tl.c
@@ -34,11 +34,11 @@
 
 #define CPR_QUEUE_COUNT		5
 #define DCPR_QUEUE_COUNT	3
-#define PKE_QUEUE_COUNT		1
-#define WAT_QUEUE_COUNT		7
-#define WCP_QUEUE_COUNT		7
-#define USC_QUEUE_COUNT		3
-#define ATH_QUEUE_COUNT		2
+#define PKE_QUEUE_COUNT		18
+#define WAT_QUEUE_COUNT		18
+#define WCP_QUEUE_COUNT		18
+#define UCS_QUEUE_COUNT		6
+#define ATH_QUEUE_COUNT		8
 
 /* Device level counters. */
 static const struct adf_tl_dbg_counter dev_counters[] = {
@@ -247,12 +247,12 @@ void adf_gen6_init_tl_data(struct adf_tl_hw_data *tl_data)
 	tl_data->num_rp_counters = ARRAY_SIZE(rp_counters);
 	tl_data->max_sl_cnt = ADF_GEN6_TL_MAX_SLICES_PER_TYPE;
 
-	tl_data->multiplier.cpr_cnt = CPR_QUEUE_COUNT;
-	tl_data->multiplier.dcpr_cnt = DCPR_QUEUE_COUNT;
-	tl_data->multiplier.pke_cnt = PKE_QUEUE_COUNT;
-	tl_data->multiplier.wat_cnt = WAT_QUEUE_COUNT;
-	tl_data->multiplier.wcp_cnt = WCP_QUEUE_COUNT;
-	tl_data->multiplier.ucs_cnt = USC_QUEUE_COUNT;
-	tl_data->multiplier.ath_cnt = ATH_QUEUE_COUNT;
+	tl_data->cmdq_cnt.cpr_cnt = CPR_QUEUE_COUNT;
+	tl_data->cmdq_cnt.dcpr_cnt = DCPR_QUEUE_COUNT;
+	tl_data->cmdq_cnt.pke_cnt = PKE_QUEUE_COUNT;
+	tl_data->cmdq_cnt.wat_cnt = WAT_QUEUE_COUNT;
+	tl_data->cmdq_cnt.wcp_cnt = WCP_QUEUE_COUNT;
+	tl_data->cmdq_cnt.ucs_cnt = UCS_QUEUE_COUNT;
+	tl_data->cmdq_cnt.ath_cnt = ATH_QUEUE_COUNT;
 }
 EXPORT_SYMBOL_GPL(adf_gen6_init_tl_data);
diff --git a/drivers/crypto/intel/qat/qat_common/adf_telemetry.c b/drivers/crypto/intel/qat/qat_common/adf_telemetry.c
index 8c575113cbcd..44e26ea8cd7f 100644
--- a/drivers/crypto/intel/qat/qat_common/adf_telemetry.c
+++ b/drivers/crypto/intel/qat/qat_common/adf_telemetry.c
@@ -219,13 +219,13 @@ static void adf_set_cmdq_cnt(struct adf_accel_dev *accel_dev,
 	slice_cnt = &accel_dev->telemetry->slice_cnt;
 	cmdq_cnt = &accel_dev->telemetry->cmdq_cnt;
 
-	cmdq_cnt->cpr_cnt = slice_cnt->cpr_cnt * tl_data->multiplier.cpr_cnt;
-	cmdq_cnt->dcpr_cnt = slice_cnt->dcpr_cnt * tl_data->multiplier.dcpr_cnt;
-	cmdq_cnt->pke_cnt = slice_cnt->pke_cnt * tl_data->multiplier.pke_cnt;
-	cmdq_cnt->wat_cnt = slice_cnt->wat_cnt * tl_data->multiplier.wat_cnt;
-	cmdq_cnt->wcp_cnt = slice_cnt->wcp_cnt * tl_data->multiplier.wcp_cnt;
-	cmdq_cnt->ucs_cnt = slice_cnt->ucs_cnt * tl_data->multiplier.ucs_cnt;
-	cmdq_cnt->ath_cnt = slice_cnt->ath_cnt * tl_data->multiplier.ath_cnt;
+	cmdq_cnt->cpr_cnt = slice_cnt->cpr_cnt ? tl_data->cmdq_cnt.cpr_cnt : 0;
+	cmdq_cnt->dcpr_cnt = slice_cnt->dcpr_cnt ? tl_data->cmdq_cnt.dcpr_cnt : 0;
+	cmdq_cnt->pke_cnt = slice_cnt->pke_cnt ? tl_data->cmdq_cnt.pke_cnt : 0;
+	cmdq_cnt->wat_cnt = slice_cnt->wat_cnt ? tl_data->cmdq_cnt.wat_cnt : 0;
+	cmdq_cnt->wcp_cnt = slice_cnt->wcp_cnt ? tl_data->cmdq_cnt.wcp_cnt : 0;
+	cmdq_cnt->ucs_cnt = slice_cnt->ucs_cnt ? tl_data->cmdq_cnt.ucs_cnt : 0;
+	cmdq_cnt->ath_cnt = slice_cnt->ath_cnt ? tl_data->cmdq_cnt.ath_cnt : 0;
 }
 
 int adf_tl_run(struct adf_accel_dev *accel_dev, int state)
diff --git a/drivers/crypto/intel/qat/qat_common/adf_telemetry.h b/drivers/crypto/intel/qat/qat_common/adf_telemetry.h
index 02d75c3c214a..96879d02c4fa 100644
--- a/drivers/crypto/intel/qat/qat_common/adf_telemetry.h
+++ b/drivers/crypto/intel/qat/qat_common/adf_telemetry.h
@@ -44,7 +44,7 @@ struct adf_tl_hw_data {
 	u8 num_cmdq_counters;
 	u8 max_rp;
 	u8 max_sl_cnt;
-	struct icp_qat_fw_init_admin_slice_cnt multiplier;
+	struct icp_qat_fw_init_admin_slice_cnt cmdq_cnt;
 };
 
 struct adf_telemetry {
-- 
2.40.1


      parent reply	other threads:[~2026-10-19 11:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-19 11:03 [PATCH 0/3] crypto: qat - fix rate limiting and telemetry for QAT GEN6 wireless George Abraham P
2026-10-19 11:03 ` [PATCH 1/3] crypto: qat - validate rate limiting only for enabled services George Abraham P
2026-10-19 11:03 ` [PATCH 2/3] crypto: qat - fix rate limiting for QAT GEN6 wireless George Abraham P
2026-10-19 11:03 ` George Abraham P [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261019110356.3781949-4-george.abraham.p@intel.com \
    --to=george.abraham.p@intel.com \
    --cc=ahsan.atta@intel.com \
    --cc=giovanni.cabiddu@intel.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=qat-linux@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox