[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aHosJ8XZ-SbcAxtf@gondor.apana.org.au>
Date: Fri, 18 Jul 2025 21:12:39 +1000
From: Herbert Xu <herbert@...dor.apana.org.au>
To: Chenghai Huang <huangchenghai2@...wei.com>
Cc: davem@...emloft.net, linux-kernel@...r.kernel.org,
linux-crypto@...r.kernel.org, liulongfang@...wei.com,
qianweili@...wei.com, linwenkai6@...ilicon.com,
wangzhou1@...ilicon.com
Subject: Re: [PATCH] crypto: hisilicon/sec2 - implement full backlog mode for
sec
On Thu, Jul 10, 2025 at 08:24:57PM +0800, Chenghai Huang wrote:
> From: Wenkai Lin <linwenkai6@...ilicon.com>
>
> 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@...ilicon.com>
> Signed-off-by: Chenghai Huang <huangchenghai2@...wei.com>
> ---
> drivers/crypto/hisilicon/sec2/sec.h | 63 ++-
> drivers/crypto/hisilicon/sec2/sec_crypto.c | 574 ++++++++++++++-------
> 2 files changed, 457 insertions(+), 180 deletions(-)
Patch applied. Thanks.
--
Email: Herbert Xu <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Powered by blists - more mailing lists