2024-02-16 18:14:48

by Damian Muszynski

[permalink] [raw]
Subject: [PATCH 0/3] crypto: qat - fix and make common ring to service map in QAT GEN4

This set is revamping the method that generates the ring-to-service maps
in QAT. The initial two patches rectify the existing algorithm version
for use cases when the dcc service was enabled. The final patch
eliminates the function's duplication in device-specific code and
relocates it to a shared file.

Damian Muszynski (3):
crypto: qat - fix ring to service map for dcc in 4xxx
crypto: qat - fix ring to service map for dcc in 420xx
crypto: qat - make ring to service map common for QAT GEN4

.../intel/qat/qat_420xx/adf_420xx_hw_data.c | 64 +++++--------------
.../intel/qat/qat_4xxx/adf_4xxx_hw_data.c | 64 +++++--------------
.../intel/qat/qat_common/adf_accel_devices.h | 1 +
.../intel/qat/qat_common/adf_gen4_hw_data.c | 56 ++++++++++++++++
.../intel/qat/qat_common/adf_gen4_hw_data.h | 1 +
5 files changed, 90 insertions(+), 96 deletions(-)


base-commit: 48f0668106f3664f4101c9f24fdb3b8c13f5880d
--
2.43.0



2024-02-16 18:14:51

by Damian Muszynski

[permalink] [raw]
Subject: [PATCH 1/3] crypto: qat - fix ring to service map for dcc in 4xxx

If a device is configured for data compression chaining (dcc), half of the
engines are loaded with the symmetric crypto image and the rest are loaded
with the compression image.
However, in such configuration all rings can handle compression requests.

Fix the ring to service mapping so that when a device is configured for
dcc, the ring to service mapping reports that all rings in a bank can
be used for compression.

Fixes: a238487f7965 ("crypto: qat - fix ring to service map for QAT GEN4")
Signed-off-by: Damian Muszynski <[email protected]>
Reviewed-by: Giovanni Cabiddu <[email protected]>
---
drivers/crypto/intel/qat/qat_4xxx/adf_4xxx_hw_data.c | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/drivers/crypto/intel/qat/qat_4xxx/adf_4xxx_hw_data.c b/drivers/crypto/intel/qat/qat_4xxx/adf_4xxx_hw_data.c
index 94a0ebb03d8c..e171cddf6f02 100644
--- a/drivers/crypto/intel/qat/qat_4xxx/adf_4xxx_hw_data.c
+++ b/drivers/crypto/intel/qat/qat_4xxx/adf_4xxx_hw_data.c
@@ -331,6 +331,13 @@ static u16 get_ring_to_svc_map(struct adf_accel_dev *accel_dev)
if (!fw_config)
return 0;

+ /* If dcc, all rings handle compression requests */
+ if (adf_get_service_enabled(accel_dev) == SVC_DCC) {
+ for (i = 0; i < RP_GROUP_COUNT; i++)
+ rps[i] = COMP;
+ goto set_mask;
+ }
+
for (i = 0; i < RP_GROUP_COUNT; i++) {
switch (fw_config[i].ae_mask) {
case ADF_AE_GROUP_0:
@@ -359,6 +366,7 @@ static u16 get_ring_to_svc_map(struct adf_accel_dev *accel_dev)
}
}

+set_mask:
ring_to_svc_map = rps[RP_GROUP_0] << ADF_CFG_SERV_RING_PAIR_0_SHIFT |
rps[RP_GROUP_1] << ADF_CFG_SERV_RING_PAIR_1_SHIFT |
rps[RP_GROUP_0] << ADF_CFG_SERV_RING_PAIR_2_SHIFT |
--
2.43.0


2024-02-24 00:51:26

by Herbert Xu

[permalink] [raw]
Subject: Re: [PATCH 0/3] crypto: qat - fix and make common ring to service map in QAT GEN4

On Fri, Feb 16, 2024 at 06:21:53PM +0100, Damian Muszynski wrote:
> This set is revamping the method that generates the ring-to-service maps
> in QAT. The initial two patches rectify the existing algorithm version
> for use cases when the dcc service was enabled. The final patch
> eliminates the function's duplication in device-specific code and
> relocates it to a shared file.
>
> Damian Muszynski (3):
> crypto: qat - fix ring to service map for dcc in 4xxx
> crypto: qat - fix ring to service map for dcc in 420xx
> crypto: qat - make ring to service map common for QAT GEN4
>
> .../intel/qat/qat_420xx/adf_420xx_hw_data.c | 64 +++++--------------
> .../intel/qat/qat_4xxx/adf_4xxx_hw_data.c | 64 +++++--------------
> .../intel/qat/qat_common/adf_accel_devices.h | 1 +
> .../intel/qat/qat_common/adf_gen4_hw_data.c | 56 ++++++++++++++++
> .../intel/qat/qat_common/adf_gen4_hw_data.h | 1 +
> 5 files changed, 90 insertions(+), 96 deletions(-)
>
>
> base-commit: 48f0668106f3664f4101c9f24fdb3b8c13f5880d
> --
> 2.43.0

All applied. Thanks.
--
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt