> -----Original Message----- > From: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> > Sent: Monday, August 25, 2025 9:15 PM > To: Sridhar, Kanchana P <kanchana.p.sridhar@xxxxxxxxx> > Cc: Nhat Pham <nphamcs@xxxxxxxxx>; linux-kernel@xxxxxxxxxxxxxxx; linux- > mm@xxxxxxxxx; hannes@xxxxxxxxxxx; yosry.ahmed@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 v11 00/24] zswap compression batching with optimized > iaa_crypto driver > > On Tue, Aug 26, 2025 at 04:09:45AM +0000, Sridhar, Kanchana P wrote: > > > > Thanks Herbert. Just want to make sure I understand this. Are you > > referring to replacing sg_set_page() for the input with sg_set_folio()? > > We have to pass in a scatterlist for the acomp_req->src.. > > I'm talking about acomp_request_set_src_folio. You can pass just > a portion of a folio by specifying an offset and a length. > > > for (i = 0; i < nr_pages; i += nr_comps) { > > for_each_sg(acomp_ctx->sg_inputs->sgl, sg, nr_comps, k) > > sg_set_folio(sg, folio, PAGE_SIZE, (start + k + i) * PAGE_SIZE); > > > > /* > > * We need PAGE_SIZE * 2 here since there maybe over- > compression case, > > * and hardware-accelerators may won't check the dst buffer size, > so > > * giving the dst buffer with enough length to avoid buffer overflow. > > */ > > for_each_sg(acomp_ctx->sg_outputs->sgl, sg, nr_comps, k) > > sg_set_buf(sg, acomp_ctx->buffers[k], PAGE_SIZE * 2); > > > > acomp_request_set_params(acomp_ctx->req, > > acomp_ctx->sg_inputs->sgl, > > acomp_ctx->sg_outputs->sgl, > > nr_comps * PAGE_SIZE, > > nr_comps * PAGE_SIZE); > > I meant something more like: > > acomp_request_set_src_folio(req, folio, start_offset, > nr_comps * PAGE_SIZE); > acomp_request_set_dst_sg(req, acomp_ctx_sg_outputs->sgl, > nr_comps * PAGE_SIZE); > acomp_request_set_unit_size(req, PAGE_SIZE); Ok, I get it now :) Thanks. I will try this out, and pending any issues that may arise from testing, I might be all set for putting together v12. Thanks again Herbert, I appreciate it. Best regards, Kanchana > > Cheers, > -- > Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> > Home Page: http://gondor.apana.org.au/~herbert/ > PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt