crypto: hisilicon/qm - add reference counting to queues for tfm kernel reuse

Add reference counting to queues. When all queues are occupied, tfm
will reuse queues with the same algorithm type that have already
been allocated in the kernel. The corresponding queue will be
released when the reference count reaches 1.

Reviewed-by: Longfang Liu <liulongfang@huawei.com>
Signed-off-by: Chenghai Huang <huangchenghai2@huawei.com>
Signed-off-by: Weili Qian <qianweili@huawei.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
Chenghai Huang
2025-12-18 21:44:48 +08:00
committed by Herbert Xu
parent 72f3bbebff
commit 4705489742
2 changed files with 52 additions and 14 deletions

View File

@@ -475,6 +475,7 @@ struct hisi_qp {
u16 pasid;
struct uacce_queue *uacce_q;
u32 ref_count;
spinlock_t qp_lock;
struct instance_backlog backlog;
const void **msg;