linux/drivers/crypto/hisilicon/sec2
Wenkai Lin f0ae287c50 crypto: hisilicon/sec2 - implement full backlog mode for sec
This patch introduces a hierarchical backlog mechanism to cache
user data in high-throughput encryption/decryption scenarios,
the implementation addresses packet loss issues when hardware
queues overflow during peak loads.

First, we use sec_alloc_req_id to obtain an exclusive resource
from the pre-allocated resource pool of each queue, if no resource
is allocated, perform the DMA map operation on the request memory.

When the task is ready, we will attempt to send it to the hardware,
if the hardware queue is already full, we cache the request into
the backlog list, then return an EBUSY status to the upper layer
and instruct the packet-sending thread to pause transmission.
Simultaneously, when the hardware completes a task, it triggers
the sec callback function, within this function, reattempt to send
the requests from the backlog list and wake up the sending thread
until the hardware queue becomes fully occupied again.

In addition, it handles such exceptions like the hardware is reset
when packets are sent, it will switch to the software computing
and release occupied resources.

Signed-off-by: Wenkai Lin <linwenkai6@hisilicon.com>
Signed-off-by: Chenghai Huang <huangchenghai2@huawei.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2025-07-18 20:52:00 +10:00
..
Makefile
sec_crypto.c crypto: hisilicon/sec2 - implement full backlog mode for sec 2025-07-18 20:52:00 +10:00
sec_crypto.h crypto: hisilicon/sec2 - fix for aead icv error 2024-12-21 22:46:24 +08:00
sec_main.c crypto: hisilicon/qm - support new function communication 2025-01-14 11:31:13 +08:00
sec.h crypto: hisilicon/sec2 - implement full backlog mode for sec 2025-07-18 20:52:00 +10:00