From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jonathan Cameron Subject: Re: [PATCH v2 4/4] crypto: add CRYPTO_TFM_REQ_PARALLEL flag Date: Wed, 7 Feb 2018 16:14:12 +0000 Message-ID: <20180207161412.00007bbe@huawei.com> References: <2118226.LQArbCsRu5@tauon.chronox.de> <3051095.6v3pDGNVZ5@tauon.chronox.de> <20180207153911.00002ac6@huawei.com> <2396074.YQ3hgbV6mL@tauon.chronox.de> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8BIT Cc: Herbert Xu , Gilad Ben-Yossef , Harsh Jain , "Linux Crypto Mailing List" , To: Stephan Mueller Return-path: Received: from szxga05-in.huawei.com ([45.249.212.191]:4772 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754543AbeBGQOl (ORCPT ); Wed, 7 Feb 2018 11:14:41 -0500 In-Reply-To: <2396074.YQ3hgbV6mL@tauon.chronox.de> Sender: linux-crypto-owner@vger.kernel.org List-ID: On Wed, 7 Feb 2018 16:43:10 +0100 Stephan Mueller wrote: > Am Mittwoch, 7. Februar 2018, 16:39:11 CET schrieb Jonathan Cameron: > > Hi Jonathan, > > > On Wed, 7 Feb 2018 13:48:32 +0100 > > > > Stephan Mueller wrote: > > > Am Mittwoch, 7. Februar 2018, 08:44:04 CET schrieb Stephan Müller: > > > > > > Hi, > > > > > > > diff --git a/crypto/algif_aead.c b/crypto/algif_aead.c > > > > index 3970ad7f6fd0..da010405eea0 100644 > > > > --- a/crypto/algif_aead.c > > > > +++ b/crypto/algif_aead.c > > > > @@ -66,13 +66,22 @@ static int aead_sendmsg(struct socket *sock, struct > > > > msghdr *msg, size_t size) { > > > > > > > > struct sock *sk = sock->sk; > > > > struct alg_sock *ask = alg_sk(sk); > > > > > > > > + struct af_alg_ctx *ctx = ask->private; > > > > > > > > struct sock *psk = ask->parent; > > > > struct alg_sock *pask = alg_sk(psk); > > > > struct aead_tfm *aeadc = pask->private; > > > > > > > > - struct crypto_aead *tfm = aeadc->aead; > > > > - unsigned int ivsize = crypto_aead_ivsize(tfm); > > > > + struct crypto_aead *aead = aeadc->aead; > > > > + struct crypto_tfm *tfm = crypto_aead_tfm(aead); > > > > + unsigned int ivsize = crypto_aead_ivsize(aead); > > > > + int ret = af_alg_sendmsg(sock, msg, size, ivsize); > > > > + > > > > + if (ret < 0) > > > > + return ret; > > > > > > > > - return af_alg_sendmsg(sock, msg, size, ivsize); > > > > + if (ctx->iiv == ALG_IIV_USE) > > > > > > This should be ALG_IIV_DISABLE of course. > > > > You say that, but my initial reading was that the core > > was requesting that the driver do things in parallel > > irrespective of whether the driver thought it was safe. > > So I would think this was correct. > > > > Definitely needs some documentation or a clearer name. > > How about: > > ALG_IV_SERIAL_PROCESSING (was ALG_IIV_DISABLE) > ALG_IV_PARALLEL_PROCESSING (was ALG_IIV_USE) > Actually those were fine on the basis that inline iv is obvious enough, it was CRYPTO_TFM_REQ_PARALLEL that was causing me confusion. Sorry, wasn't terribly clear on that! Jonathan > Ciao > Stephan > >