WTF: patch "[PATCH] crypto: qat - refactor submission logic" was seriously submitted to be applied to the 5.18-stable tree?
Subsystems (2)
[email protected]
maintainerThe patch below was submitted to be applied to the 5.18-stable tree.
I fail to see how this patch meets the stable kernel rules as found at Documentation/process/stable-kernel-rules.rst.
I could be totally wrong, and if so, please respond to <[email protected]> and let me know why this patch should be applied. Otherwise, it is now dropped from my patch queues, never to be seen again.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From af88d3c109aa5edfaa11c9a26d9c0ff21ddf501c Mon Sep 17 00:00:00 2001
From: Giovanni Cabiddu <[email protected]>
Date: Mon, 9 May 2022 14:34:09 +0100
Subject: [PATCH] crypto: qat - refactor submission logic
All the algorithms in qat_algs.c and qat_asym_algs.c use the same pattern to submit messages to the HW queues. Move the submission loop to a new function, qat_alg_send_message(), and share it between the symmetric and the asymmetric algorithms.
As part of this rework, since the number of retries before returning an error is inconsistent between the symmetric and asymmetric implementations, set it to a value that works for both (i.e. 20, was 10 in qat_algs.c and 100 in qat_asym_algs.c)
In addition fix the return code reported when the HW queues are full. In that case return -ENOSPC instead of -EBUSY.
Including stable in CC since (1) the error code returned if the HW queues are full is incorrect and (2) to facilitate the backport of the next fix "crypto: qat - add backlog mechanism".
drivers/crypto/qat/qat_common/Makefile +1 -0
@@ -16,6 +16,7 @@ intel_qat-objs := adf_cfg.o \ qat_crypto.o \ qat_algs.o \ qat_asym_algs.o \ + qat_algs_send.o \ qat_uclo.o \ qat_hal.o
drivers/crypto/qat/qat_common/qat_algs.c +32 -36
133 lines not on this page · raw message
drivers/crypto/qat/qat_common/qat_algs_send.c new file +21 -0
@@ -0,0 +1,21 @@ +// SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0-only) +/* Copyright(c) 2022 Intel Corporation */ +#include "adf_transport.h" +#include "qat_algs_send.h" +#include "qat_crypto.h" + +#define ADF_MAX_RETRIES 20 + +int qat_alg_send_message (struct qat_alg_req *req) +{ +int ret =0 , ctr =0 ; + +do { + ret =adf_send_message (req->tx_ring, req->fw_req); + }while (ret == -EAGAIN && ctr++ <ADF_MAX_RETRIES ); + +if (ret == -EAGAIN ) +return -ENOSPC ; + +return -EINPROGRESS ; +}
drivers/crypto/qat/qat_common/qat_algs_send.h new file +10 -0
@@ -0,0 +1,10 @@ +/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0-only) */ +/* Copyright(c) 2022 Intel Corporation */ +#ifndef QAT_ALGS_SEND_H +#define QAT_ALGS_SEND_H + +#include "qat_crypto.h" + +int qat_alg_send_message (struct qat_alg_req *req); + +#endif
drivers/crypto/qat/qat_common/qat_asym_algs.c +32 -18
104 lines not on this page · raw message
drivers/crypto/qat/qat_common/qat_crypto.h +5 -0
@@ -9,6 +9,11 @@#include "adf_accel_devices.h" #include "icp_qat_fw_la.h" +struct qat_alg_req { +u32 *fw_req; +struct adf_etr_ring_data *tx_ring; +}; +struct qat_crypto_instance {struct adf_etr_ring_data *sym_tx;struct adf_etr_ring_data *sym_rx;