lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aK00t9ld3YOWJo1I@gondor.apana.org.au>
Date: Tue, 26 Aug 2025 12:14:47 +0800
From: Herbert Xu <herbert@...dor.apana.org.au>
To: "Sridhar, Kanchana P" <kanchana.p.sridhar@...el.com>
Cc: Nhat Pham <nphamcs@...il.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-mm@...ck.org" <linux-mm@...ck.org>,
	"hannes@...xchg.org" <hannes@...xchg.org>,
	"yosry.ahmed@...ux.dev" <yosry.ahmed@...ux.dev>,
	"chengming.zhou@...ux.dev" <chengming.zhou@...ux.dev>,
	"usamaarif642@...il.com" <usamaarif642@...il.com>,
	"ryan.roberts@....com" <ryan.roberts@....com>,
	"21cnbao@...il.com" <21cnbao@...il.com>,
	"ying.huang@...ux.alibaba.com" <ying.huang@...ux.alibaba.com>,
	"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
	"senozhatsky@...omium.org" <senozhatsky@...omium.org>,
	"linux-crypto@...r.kernel.org" <linux-crypto@...r.kernel.org>,
	"davem@...emloft.net" <davem@...emloft.net>,
	"clabbe@...libre.com" <clabbe@...libre.com>,
	"ardb@...nel.org" <ardb@...nel.org>,
	"ebiggers@...gle.com" <ebiggers@...gle.com>,
	"surenb@...gle.com" <surenb@...gle.com>,
	"Accardi, Kristen C" <kristen.c.accardi@...el.com>,
	"Gomes, Vinicius" <vinicius.gomes@...el.com>,
	"Feghali, Wajdi K" <wajdi.k.feghali@...el.com>,
	"Gopal, Vinodh" <vinodh.gopal@...el.com>
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);

Cheers,
-- 
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ