From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id B9BF6C48BC3 for ; Tue, 20 Feb 2024 04:13:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 475386B0078; Mon, 19 Feb 2024 23:13:41 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 425116B0083; Mon, 19 Feb 2024 23:13:41 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 31CE86B0085; Mon, 19 Feb 2024 23:13:41 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 15A716B0078 for ; Mon, 19 Feb 2024 23:13:41 -0500 (EST) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id AB7731A04FC for ; Tue, 20 Feb 2024 04:13:40 +0000 (UTC) X-FDA: 81810863400.17.3CC7BC5 Received: from abb.hmeau.com (abb.hmeau.com [144.6.53.87]) by imf28.hostedemail.com (Postfix) with ESMTP id 38381C0002 for ; Tue, 20 Feb 2024 04:13:36 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=apana.org.au; spf=pass (imf28.hostedemail.com: domain of herbert@gondor.apana.org.au designates 144.6.53.87 as permitted sender) smtp.mailfrom=herbert@gondor.apana.org.au ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1708402418; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vLJLHHTS507sfjDmaqvyDYBQHCSONRNFmbDZGD0sUUM=; b=5HSM4UjVg4Es/ZvNbc9E4igMxXuqQFLprv9EfPsq0iKc1nOFs+4FpF5ttwOSQlZRNjzqAr O4Zz2ggHGoJd2yKyGAjZ6fUdET5li3Gaiq+3UyAm46elHCpBRx0g/QPRSBzEHjsw5dAkm/ vK3jBes25HCSRb/RRYJ0sg8LmoGgRq4= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=apana.org.au; spf=pass (imf28.hostedemail.com: domain of herbert@gondor.apana.org.au designates 144.6.53.87 as permitted sender) smtp.mailfrom=herbert@gondor.apana.org.au ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1708402418; a=rsa-sha256; cv=none; b=joIs9aQn5xR+8SEeGtPgqE2Fs5o8tGOjjuGWNg4e+N7Xoxk6fkT1pYFoxcgX0RVAh0xjqI Yal/8FwlGJFMRu1T0en89+0xDbdsUxmmdXpo9Jxick37tDWtdHjtYD81AamGZPgcjB9Fl0 HqSA3eiUbiqsmYS19q+VRRE+2BG70mw= Received: from loth.rohan.me.apana.org.au ([192.168.167.2]) by formenos.hmeau.com with smtp (Exim 4.94.2 #2 (Debian)) id 1rcHVP-00FWFK-U5; Tue, 20 Feb 2024 12:13:21 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Tue, 20 Feb 2024 12:13:34 +0800 Date: Tue, 20 Feb 2024 12:13:34 +0800 From: Herbert Xu To: Barry Song <21cnbao@gmail.com> Cc: akpm@linux-foundation.org, davem@davemloft.net, hannes@cmpxchg.org, linux-crypto@vger.kernel.org, linux-mm@kvack.org, nphamcs@gmail.com, yosryahmed@google.com, zhouchengming@bytedance.com, chriscli@google.com, chrisl@kernel.org, ddstreet@ieee.org, linux-kernel@vger.kernel.org, sjenning@redhat.com, vitaly.wool@konsulko.com, Barry Song , Yang Shen , Zhou Wang , Tom Zanussi Subject: Re: [PATCH v4 1/3] crypto: introduce crypto_acomp_get_alg_flags to expose algorithm flags Message-ID: References: <20240220025545.194886-1-21cnbao@gmail.com> <20240220025545.194886-2-21cnbao@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240220025545.194886-2-21cnbao@gmail.com> X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 38381C0002 X-Stat-Signature: b6qqwm4riwjaccge6rbjpzdbpmnqej51 X-Rspam-User: X-HE-Tag: 1708402416-846976 X-HE-Meta: U2FsdGVkX1/WaKXGpvhG0SFR2M54rJanlSsMLu+jRHMZ910//d/aSPso43is8qdMlOgd8XmLu6A3aq6XtiXiTZ1xJdBT4oIIWY4V06bg3UyaqvZM+EjancWKHrEUi1uiGXtRQfBGfZcr3rMDs3uSrcghE8kuW/KE2paJ/quDGN2hWpBr3/YyRxrbkwttIL/Bg2Md64vCizqoU9nma6OXUBFJctM0xszVTvs0tXEky3h1e5GZg5kTJs1WbTzKAVTmZffw9sG5KQ/CiZuPJem/bCD2IquPbK9gxv18dskug6A0TfN5F8AytP8xr3W6m0aZ8kXb5wUiOVwthhyj4vJl3HJEjjrgEKJ78HeF1f9qD3fNK98iqtwGLeZFuVEBdemX+sLP1Tt2c/1fD9mFNBL8mEatvwQZgsdyQ1Euz+x0xvq/f9XvDmKZL/dRinoWaPu/XtKJzpLa7IiY333WWARlGtn6azna4CeHBbaN6RGMdON7+ArdZWH7Klk7yLIMc5Dh2Nd8Cvi951Ymq5Gbvp30NjmM/hUQgxg8XG5hxLrUE4VdTvqNanXfa9ih7S4RptCEfSYPRnXcJaOH/UnT4LyHyDfH3Ac6fjB27CNT+g+xvV9hd4Di1oFLHYfaQYiPnrV3cv8ytZxcJTxVBW0xnXct/Z8NX1NwAjKfB+CbmEh4PBAnejUqz3RIQOrqiNpD1QA8G5Q+YnElX9iidA1yXEzu67zR7lP4q3LN2cBvbWQ97P7N+F+heVfuaVxW5aZ5t2X9ZY2d0IowO7YjtPlrTZzgorVDhSxr39ziqAAMyf+xuj+YZK0d4Xa8kYYW698/XUK/i0ROiFq59AJ1P3fMqGsOa3L+5oYVTI5GLGkmN3sw8DnB4Mf5qTnn1I2WwUVuuWaqKCRFGNb+B2Qtr71vJCFfqXy1cEzuHMmucefSRMeyZkfVNntCZ7aX+C++Szf0Q4U5/cdkhm/IoC9QFPcfxSO 9hyvFM/q Wi2VHZGS9/kx5CXHVLD08EnXgWqBdvAjOZQakIq68v3uSSu+0DGkewEmtjVZbxRZgGFd+j9RUacC7KLK2AR02MMKGAikBPaEpb8ah6KvTvk4Vm5EnMLLqsPPogNfdaJG/ZGrg5DPppuq2D3NmrahbqAn4gTEjNP4gXbNwQuUoiLBKa3i1LetMnFX3Fhq2TcfWdTXWSiC4CwH/O2VAQ2KyCeDhhg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Tue, Feb 20, 2024 at 03:55:43PM +1300, Barry Song wrote: > > diff --git a/drivers/crypto/hisilicon/zip/zip_crypto.c b/drivers/crypto/hisilicon/zip/zip_crypto.c > index c650c741a18d..94e2d66b04b6 100644 > --- a/drivers/crypto/hisilicon/zip/zip_crypto.c > +++ b/drivers/crypto/hisilicon/zip/zip_crypto.c > @@ -591,6 +591,7 @@ static struct acomp_alg hisi_zip_acomp_deflate = { > .base = { > .cra_name = "deflate", > .cra_driver_name = "hisi-deflate-acomp", > + .cra_flags = CRYPTO_ALG_ASYNC, > .cra_module = THIS_MODULE, > .cra_priority = HZIP_ALG_PRIORITY, > .cra_ctxsize = sizeof(struct hisi_zip_ctx), > diff --git a/drivers/crypto/intel/iaa/iaa_crypto_main.c b/drivers/crypto/intel/iaa/iaa_crypto_main.c > index dfd3baf0a8d8..91adf9d76a2e 100644 > --- a/drivers/crypto/intel/iaa/iaa_crypto_main.c > +++ b/drivers/crypto/intel/iaa/iaa_crypto_main.c > @@ -1916,6 +1916,7 @@ static struct acomp_alg iaa_acomp_fixed_deflate = { > .base = { > .cra_name = "deflate", > .cra_driver_name = "deflate-iaa", > + .cra_flags = CRYPTO_ALG_ASYNC, > .cra_ctxsize = sizeof(struct iaa_compression_ctx), > .cra_module = THIS_MODULE, > .cra_priority = IAA_ALG_PRIORITY, Good catch. I think this should go into a separate bug-fix patch. > diff --git a/include/crypto/acompress.h b/include/crypto/acompress.h > index 574cffc90730..07bd8f6bc79a 100644 > --- a/include/crypto/acompress.h > +++ b/include/crypto/acompress.h > @@ -160,6 +160,11 @@ static inline void acomp_request_set_tfm(struct acomp_req *req, > req->base.tfm = crypto_acomp_tfm(tfm); > } > > +static inline u32 crypto_acomp_get_alg_flags(struct crypto_acomp *tfm) > +{ > + return crypto_tfm_alg_flags(crypto_acomp_tfm(tfm)); > +} Sorry, my mistake. I shouldn't have suggested copying skcipher since that gets the tfm flags as opposed to the alg flags which you've found out. I think you should just go with your original function acomp_is_async but do it like this: static inline bool acomp_is_async(struct crypto_acomp *tfm) { return crypto_comp_alg_common(tfm)->base.cra_flags & CRYPTO_ALG_ASYNC; } Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt