Received: by 10.223.185.116 with SMTP id b49csp1123006wrg; Wed, 14 Feb 2018 12:01:14 -0800 (PST) X-Google-Smtp-Source: AH8x227QhP/0P6+vEX4Q9TKXGLmHskrU//WvDS7bH1G1sEYvCDCPJFvTOvbWk4+Ggj1guObfI1qd X-Received: by 2002:a17:902:6a81:: with SMTP id n1-v6mr157510plk.11.1518638474773; Wed, 14 Feb 2018 12:01:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518638474; cv=none; d=google.com; s=arc-20160816; b=RVthqqqYqQ150DzrHIJ9V7QJ+ZeHZVL80iDXBRIl8n06BK9gdPVHvf6wKKLlqiPTDb BSYvTwzK172n6q+avUwEgWJe39wSdh+PJoi+4aVdACEZObsuC9wPFoE7GVHUsxct4kHa GRGwmo8nB1UY8ufZdwVAl8MjqF8/oWgeUjfoMbc2VzDy1hOE4Ah2fYrh9B68uw+fsJCF 2c1VizWSoe6RZO1Q7yI5Lvu2/lHqdWxIoaMOQt+ngJBxPJM3faD82m/U6WU4i+FZp8AS p02tUFg+ydb2OWs5GPpJZ5d7jfvVdDroc1piNcxIsgcw//j3EEdCZI5Htk1cDIqAlj5A to5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=Wp+S1jssu+MTF4djKPzMOUumyctDxp5AmoH8NDf9DuM=; b=ly/OlpzVQ6SHH2JdXEgJKJfocv6xeD3sZYfr6X+HSx9lFLJdmzYUUv8CZowY/h9dP9 YdObgejQKQYHyHtT6o3IhKZKJTmbRG9sxJTbbbGHdB8fKK83PGt/PcwMmldHBX0Amorm 32qheN1jjaywwLnJyekSpaqkKjnV/DWege6FsRvBd4T2DwzkWBtQlMNe7mBBOJfsV+pg pLxJmz2EUwxiGfNAbzUoLwRUrPj2rBBwXLWIb4RLct6iPkTOiTTzUIzkjIw8kCSzX1Q/ PVTBVBx8151aOQRX0OH7o/ondqZasg2L7PyAarSVI5aZxHMyQ2OMuAO4sb4ZJ59yTqpU R4EQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w10si1571028pgc.282.2018.02.14.12.00.58; Wed, 14 Feb 2018 12:01:13 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031859AbeBNPwI (ORCPT + 99 others); Wed, 14 Feb 2018 10:52:08 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:35150 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1031649AbeBNPwF (ORCPT ); Wed, 14 Feb 2018 10:52:05 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 140BE40FB651; Wed, 14 Feb 2018 15:52:05 +0000 (UTC) Received: from redhat.com (ovpn-121-104.rdu2.redhat.com [10.10.121.104]) by smtp.corp.redhat.com (Postfix) with SMTP id 27FF4DEEF2; Wed, 14 Feb 2018 15:52:00 +0000 (UTC) Date: Wed, 14 Feb 2018 17:51:59 +0200 From: "Michael S. Tsirkin" To: Corentin Labbe Cc: alexandre.torgue@st.com, arei.gonglei@huawei.com, corbet@lwn.net, davem@davemloft.net, herbert@gondor.apana.org.au, jasowang@redhat.com, mcoquelin.stm32@gmail.com, fabien.dessenne@st.com, linux-arm-kernel@lists.infradead.org, linux-crypto@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, linux-sunxi@googlegroups.com Subject: Re: [PATCH v2 4/6] crypto: virtio: convert to new crypto engine API Message-ID: <20180214175137-mutt-send-email-mst@kernel.org> References: <20180126191534.17569-1-clabbe.montjoie@gmail.com> <20180126191534.17569-5-clabbe.montjoie@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180126191534.17569-5-clabbe.montjoie@gmail.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Wed, 14 Feb 2018 15:52:05 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Wed, 14 Feb 2018 15:52:05 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'mst@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 26, 2018 at 08:15:32PM +0100, Corentin Labbe wrote: > This patch convert the driver to the new crypto engine API. > > Signed-off-by: Corentin Labbe Acked-by: Michael S. Tsirkin Pls queue when/if rest of changes go in. > --- > drivers/crypto/virtio/virtio_crypto_algs.c | 16 ++++++++++------ > drivers/crypto/virtio/virtio_crypto_common.h | 3 +-- > drivers/crypto/virtio/virtio_crypto_core.c | 3 --- > 3 files changed, 11 insertions(+), 11 deletions(-) > > diff --git a/drivers/crypto/virtio/virtio_crypto_algs.c b/drivers/crypto/virtio/virtio_crypto_algs.c > index abe8c15450df..ba190cfa7aa1 100644 > --- a/drivers/crypto/virtio/virtio_crypto_algs.c > +++ b/drivers/crypto/virtio/virtio_crypto_algs.c > @@ -29,6 +29,7 @@ > > > struct virtio_crypto_ablkcipher_ctx { > + struct crypto_engine_ctx enginectx; > struct virtio_crypto *vcrypto; > struct crypto_tfm *tfm; > > @@ -491,7 +492,7 @@ static int virtio_crypto_ablkcipher_encrypt(struct ablkcipher_request *req) > vc_sym_req->ablkcipher_req = req; > vc_sym_req->encrypt = true; > > - return crypto_transfer_cipher_request_to_engine(data_vq->engine, req); > + return crypto_transfer_ablkcipher_request_to_engine(data_vq->engine, req); > } > > static int virtio_crypto_ablkcipher_decrypt(struct ablkcipher_request *req) > @@ -511,7 +512,7 @@ static int virtio_crypto_ablkcipher_decrypt(struct ablkcipher_request *req) > vc_sym_req->ablkcipher_req = req; > vc_sym_req->encrypt = false; > > - return crypto_transfer_cipher_request_to_engine(data_vq->engine, req); > + return crypto_transfer_ablkcipher_request_to_engine(data_vq->engine, req); > } > > static int virtio_crypto_ablkcipher_init(struct crypto_tfm *tfm) > @@ -521,6 +522,9 @@ static int virtio_crypto_ablkcipher_init(struct crypto_tfm *tfm) > tfm->crt_ablkcipher.reqsize = sizeof(struct virtio_crypto_sym_request); > ctx->tfm = tfm; > > + ctx->enginectx.op.do_one_request = virtio_crypto_ablkcipher_crypt_req; > + ctx->enginectx.op.prepare_request = NULL; > + ctx->enginectx.op.unprepare_request = NULL; > return 0; > } > > @@ -538,9 +542,9 @@ static void virtio_crypto_ablkcipher_exit(struct crypto_tfm *tfm) > } > > int virtio_crypto_ablkcipher_crypt_req( > - struct crypto_engine *engine, > - struct ablkcipher_request *req) > + struct crypto_engine *engine, void *vreq) > { > + struct ablkcipher_request *req = container_of(vreq, struct ablkcipher_request, base); > struct virtio_crypto_sym_request *vc_sym_req = > ablkcipher_request_ctx(req); > struct virtio_crypto_request *vc_req = &vc_sym_req->base; > @@ -561,8 +565,8 @@ static void virtio_crypto_ablkcipher_finalize_req( > struct ablkcipher_request *req, > int err) > { > - crypto_finalize_cipher_request(vc_sym_req->base.dataq->engine, > - req, err); > + crypto_finalize_ablkcipher_request(vc_sym_req->base.dataq->engine, > + req, err); > kzfree(vc_sym_req->iv); > virtcrypto_clear_request(&vc_sym_req->base); > } > diff --git a/drivers/crypto/virtio/virtio_crypto_common.h b/drivers/crypto/virtio/virtio_crypto_common.h > index e976539a05d9..72621bd67211 100644 > --- a/drivers/crypto/virtio/virtio_crypto_common.h > +++ b/drivers/crypto/virtio/virtio_crypto_common.h > @@ -107,8 +107,7 @@ struct virtio_crypto *virtcrypto_get_dev_node(int node); > int virtcrypto_dev_start(struct virtio_crypto *vcrypto); > void virtcrypto_dev_stop(struct virtio_crypto *vcrypto); > int virtio_crypto_ablkcipher_crypt_req( > - struct crypto_engine *engine, > - struct ablkcipher_request *req); > + struct crypto_engine *engine, void *vreq); > > void > virtcrypto_clear_request(struct virtio_crypto_request *vc_req); > diff --git a/drivers/crypto/virtio/virtio_crypto_core.c b/drivers/crypto/virtio/virtio_crypto_core.c > index ff1410a32c2b..83326986c113 100644 > --- a/drivers/crypto/virtio/virtio_crypto_core.c > +++ b/drivers/crypto/virtio/virtio_crypto_core.c > @@ -111,9 +111,6 @@ static int virtcrypto_find_vqs(struct virtio_crypto *vi) > ret = -ENOMEM; > goto err_engine; > } > - > - vi->data_vq[i].engine->cipher_one_request = > - virtio_crypto_ablkcipher_crypt_req; > } > > kfree(names); > -- > 2.13.6