RE: [PATCH v9 10/19] crypto: acomp - New interfaces to facilitate batching support in acomp & drivers.
From: Sridhar, Kanchana P
Date: Sun May 18 2025 - 16:41:40 EST
> -----Original Message-----
> From: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
> Sent: Friday, May 16, 2025 5:46 PM
> To: Sridhar, Kanchana P <kanchana.p.sridhar@xxxxxxxxx>
> Cc: linux-kernel@xxxxxxxxxxxxxxx; linux-mm@xxxxxxxxx;
> hannes@xxxxxxxxxxx; yosry.ahmed@xxxxxxxxx; nphamcs@xxxxxxxxx;
> chengming.zhou@xxxxxxxxx; usamaarif642@xxxxxxxxx;
> ryan.roberts@xxxxxxx; 21cnbao@xxxxxxxxx;
> ying.huang@xxxxxxxxxxxxxxxxx; akpm@xxxxxxxxxxxxxxxxxxxx;
> senozhatsky@xxxxxxxxxxxx; linux-crypto@xxxxxxxxxxxxxxx;
> davem@xxxxxxxxxxxxx; clabbe@xxxxxxxxxxxx; ardb@xxxxxxxxxx;
> ebiggers@xxxxxxxxxx; surenb@xxxxxxxxxx; Accardi, Kristen C
> <kristen.c.accardi@xxxxxxxxx>; Gomes, Vinicius <vinicius.gomes@xxxxxxxxx>;
> Feghali, Wajdi K <wajdi.k.feghali@xxxxxxxxx>; Gopal, Vinodh
> <vinodh.gopal@xxxxxxxxx>
> Subject: Re: [PATCH v9 10/19] crypto: acomp - New interfaces to facilitate
> batching support in acomp & drivers.
>
> On Fri, May 16, 2025 at 07:17:36PM +0000, Sridhar, Kanchana P wrote:
> >
> > It appears acomp_do_req_chain() and acomp_reqchain_finish() compress
> the
>
> That's the fallback path.
>
> A hardware driver capable of batching is supposed to declare the
> bit in cra_flags that bypasses the fallback.
IIUC, are you referring to the "CRYPTO_ALG_REQ_SEG" cra_flags bit?
If a hardware driver sets this bit, then crypto_acomp_req_seg() will
return "true" in crypto_acomp_compress() and the folio will be compressed
as one unit by the call to " crypto_acomp_reqtfm(req)->compress(req)":
int crypto_acomp_compress(struct acomp_req *req)
{
struct crypto_acomp *tfm = crypto_acomp_reqtfm(req);
if (acomp_req_on_stack(req) && acomp_is_async(tfm))
return -EAGAIN;
if ((crypto_acomp_req_virt(tfm) || acomp_request_issg(req)) &&
(crypto_acomp_req_seg(tfm) || !acomp_request_isunit(req)))
return crypto_acomp_reqtfm(req)->compress(req);
return acomp_do_req_chain(req, true);
}
EXPORT_SYMBOL_GPL(crypto_acomp_compress);
If so, then we still have not addressed the issue highlighted in [1], please
correct me if I am wrong:
[1]: https://lore.kernel.org/all/CAKEwX=PRzZEYOuTECjjqYbUDXUjMzOc-R5s14-iX8qevDxGBpA@xxxxxxxxxxxxxx/
Can you please advise?
Thanks,
Kanchana