Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

crypto: qat - lower priority for skcipher and aead algorithms

Most kernel applications utilizing the crypto API operate synchronously
and on small buffer sizes, therefore do not benefit from QAT acceleration.

Reduce the priority of QAT implementations for both skcipher and aead
algorithms, allowing more suitable alternatives to be selected by default.

Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Link: https://lore.kernel.org/all/20250613012357.GA3603104@google.com/
Cc: stable@vger.kernel.org
Acked-by: Eric Biggers <ebiggers@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Giovanni Cabiddu and committed by
Herbert Xu
80247741 1e2b7fcd

+6 -6
+6 -6
drivers/crypto/intel/qat/qat_common/qat_algs.c
··· 1277 1277 .base = { 1278 1278 .cra_name = "authenc(hmac(sha1),cbc(aes))", 1279 1279 .cra_driver_name = "qat_aes_cbc_hmac_sha1", 1280 - .cra_priority = 4001, 1280 + .cra_priority = 100, 1281 1281 .cra_flags = CRYPTO_ALG_ASYNC | CRYPTO_ALG_ALLOCATES_MEMORY, 1282 1282 .cra_blocksize = AES_BLOCK_SIZE, 1283 1283 .cra_ctxsize = sizeof(struct qat_alg_aead_ctx), ··· 1294 1294 .base = { 1295 1295 .cra_name = "authenc(hmac(sha256),cbc(aes))", 1296 1296 .cra_driver_name = "qat_aes_cbc_hmac_sha256", 1297 - .cra_priority = 4001, 1297 + .cra_priority = 100, 1298 1298 .cra_flags = CRYPTO_ALG_ASYNC | CRYPTO_ALG_ALLOCATES_MEMORY, 1299 1299 .cra_blocksize = AES_BLOCK_SIZE, 1300 1300 .cra_ctxsize = sizeof(struct qat_alg_aead_ctx), ··· 1311 1311 .base = { 1312 1312 .cra_name = "authenc(hmac(sha512),cbc(aes))", 1313 1313 .cra_driver_name = "qat_aes_cbc_hmac_sha512", 1314 - .cra_priority = 4001, 1314 + .cra_priority = 100, 1315 1315 .cra_flags = CRYPTO_ALG_ASYNC | CRYPTO_ALG_ALLOCATES_MEMORY, 1316 1316 .cra_blocksize = AES_BLOCK_SIZE, 1317 1317 .cra_ctxsize = sizeof(struct qat_alg_aead_ctx), ··· 1329 1329 static struct skcipher_alg qat_skciphers[] = { { 1330 1330 .base.cra_name = "cbc(aes)", 1331 1331 .base.cra_driver_name = "qat_aes_cbc", 1332 - .base.cra_priority = 4001, 1332 + .base.cra_priority = 100, 1333 1333 .base.cra_flags = CRYPTO_ALG_ASYNC | CRYPTO_ALG_ALLOCATES_MEMORY, 1334 1334 .base.cra_blocksize = AES_BLOCK_SIZE, 1335 1335 .base.cra_ctxsize = sizeof(struct qat_alg_skcipher_ctx), ··· 1347 1347 }, { 1348 1348 .base.cra_name = "ctr(aes)", 1349 1349 .base.cra_driver_name = "qat_aes_ctr", 1350 - .base.cra_priority = 4001, 1350 + .base.cra_priority = 100, 1351 1351 .base.cra_flags = CRYPTO_ALG_ASYNC | CRYPTO_ALG_ALLOCATES_MEMORY, 1352 1352 .base.cra_blocksize = 1, 1353 1353 .base.cra_ctxsize = sizeof(struct qat_alg_skcipher_ctx), ··· 1365 1365 }, { 1366 1366 .base.cra_name = "xts(aes)", 1367 1367 .base.cra_driver_name = "qat_aes_xts", 1368 - .base.cra_priority = 4001, 1368 + .base.cra_priority = 100, 1369 1369 .base.cra_flags = CRYPTO_ALG_ASYNC | CRYPTO_ALG_NEED_FALLBACK | 1370 1370 CRYPTO_ALG_ALLOCATES_MEMORY, 1371 1371 .base.cra_blocksize = AES_BLOCK_SIZE,