Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/810123/?format=api
{ "id": 810123, "url": "http://patchwork.ozlabs.org/api/patches/810123/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/1504615144-29770-11-git-send-email-gilad@benyossef.com/", "project": { "id": 7, "url": "http://patchwork.ozlabs.org/api/projects/7/?format=api", "name": "Linux network development", "link_name": "netdev", "list_id": "netdev.vger.kernel.org", "list_email": "netdev@vger.kernel.org", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<1504615144-29770-11-git-send-email-gilad@benyossef.com>", "list_archive_url": null, "date": "2017-09-05T12:38:49", "name": "[v8,10/20] crypto: move gcm to generic async completion", "commit_ref": null, "pull_url": null, "state": "not-applicable", "archived": true, "hash": "9fc95ec9b71719370079bb2a05104059e1084ced", "submitter": { "id": 11198, "url": "http://patchwork.ozlabs.org/api/people/11198/?format=api", "name": "Gilad Ben-Yossef", "email": "gilad@benyossef.com" }, "delegate": { "id": 34, "url": "http://patchwork.ozlabs.org/api/users/34/?format=api", "username": "davem", "first_name": "David", "last_name": "Miller", "email": "davem@davemloft.net" }, "mbox": "http://patchwork.ozlabs.org/project/netdev/patch/1504615144-29770-11-git-send-email-gilad@benyossef.com/mbox/", "series": [ { "id": 1573, "url": "http://patchwork.ozlabs.org/api/series/1573/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=1573", "date": "2017-09-05T12:38:39", "name": "simplify crypto wait for async op", "version": 8, "mbox": "http://patchwork.ozlabs.org/series/1573/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/810123/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/810123/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<netdev-owner@vger.kernel.org>", "X-Original-To": "patchwork-incoming@ozlabs.org", "Delivered-To": "patchwork-incoming@ozlabs.org", "Authentication-Results": "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)", "Received": [ "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xmmZ83Tn0z9t1t\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 5 Sep 2017 22:42:08 +1000 (AEST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1752034AbdIEMl6 (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tTue, 5 Sep 2017 08:41:58 -0400", "from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:39464 \"EHLO\n\tfoss.arm.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1751036AbdIEMls (ORCPT <rfc822;netdev@vger.kernel.org>);\n\tTue, 5 Sep 2017 08:41:48 -0400", "from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249])\n\tby usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5AD961688;\n\tTue, 5 Sep 2017 05:41:47 -0700 (PDT)", "from gby.kfn.arm.com (unknown [10.45.48.140])\n\tby usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id\n\t14A3D3F3E1; Tue, 5 Sep 2017 05:41:36 -0700 (PDT)" ], "From": "Gilad Ben-Yossef <gilad@benyossef.com>", "To": "Herbert Xu <herbert@gondor.apana.org.au>,\n\t\"David S. Miller\" <davem@davemloft.net>,\n\tJonathan Corbet <corbet@lwn.net>, David Howells <dhowells@redhat.com>,\n\tTom Lendacky <thomas.lendacky@amd.com>, Gary Hook <gary.hook@amd.com>,\n\tBoris Brezillon <boris.brezillon@free-electrons.com>,\n\tArnaud Ebalard <arno@natisbad.org>,\n\tMatthias Brugger <matthias.bgg@gmail.com>,\n\tAlasdair Kergon <agk@redhat.com>,\n\tMike Snitzer <snitzer@redhat.com>, dm-devel@redhat.com,\n\tShaohua Li <shli@kernel.org>, Steve French <sfrench@samba.org>,\n\t\"Theodore Y. Ts'o\" <tytso@mit.edu>, Jaegeuk Kim <jaegeuk@kernel.org>,\n\tSteffen Klassert <steffen.klassert@secunet.com>,\n\tAlexey Kuznetsov <kuznet@ms2.inr.ac.ru>,\n\tHideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>,\n\tMimi Zohar <zohar@linux.vnet.ibm.com>,\n\tDmitry Kasatkin <dmitry.kasatkin@gmail.com>,\n\tJames Morris <james.l.morris@oracle.com>,\n\t\"Serge E. Hallyn\" <serge@hallyn.com>, linux-crypto@vger.kernel.org,\n\tlinux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,\n\tkeyrings@vger.kernel.org, linux-arm-kernel@lists.infradead.org,\n\tlinux-mediatek@lists.infradead.org, linux-raid@vger.kernel.org,\n\tlinux-cifs@vger.kernel.org, samba-technical@lists.samba.org,\n\tlinux-fscrypt@vger.kernel.org, netdev@vger.kernel.org,\n\tlinux-ima-devel@lists.sourceforge.net,\n\tlinux-ima-user@lists.sourceforge.net,\n\tlinux-security-module@vger.kernel.org", "Cc": "Ofir Drang <ofir.drang@arm.com>", "Subject": "[PATCH v8 10/20] crypto: move gcm to generic async completion", "Date": "Tue, 5 Sep 2017 15:38:49 +0300", "Message-Id": "<1504615144-29770-11-git-send-email-gilad@benyossef.com>", "X-Mailer": "git-send-email 2.1.4", "In-Reply-To": "<1504615144-29770-1-git-send-email-gilad@benyossef.com>", "References": "<1504615144-29770-1-git-send-email-gilad@benyossef.com>", "Sender": "netdev-owner@vger.kernel.org", "Precedence": "bulk", "List-ID": "<netdev.vger.kernel.org>", "X-Mailing-List": "netdev@vger.kernel.org" }, "content": "gcm is starting an async. crypto op and waiting for it complete.\nMove it over to generic code doing the same.\n\nSigned-off-by: Gilad Ben-Yossef <gilad@benyossef.com>\n---\n crypto/gcm.c | 32 ++++++--------------------------\n 1 file changed, 6 insertions(+), 26 deletions(-)", "diff": "diff --git a/crypto/gcm.c b/crypto/gcm.c\nindex 3841b5e..fb923a5 100644\n--- a/crypto/gcm.c\n+++ b/crypto/gcm.c\n@@ -16,7 +16,6 @@\n #include <crypto/scatterwalk.h>\n #include <crypto/hash.h>\n #include \"internal.h\"\n-#include <linux/completion.h>\n #include <linux/err.h>\n #include <linux/init.h>\n #include <linux/kernel.h>\n@@ -78,11 +77,6 @@ struct crypto_gcm_req_priv_ctx {\n \t} u;\n };\n \n-struct crypto_gcm_setkey_result {\n-\tint err;\n-\tstruct completion completion;\n-};\n-\n static struct {\n \tu8 buf[16];\n \tstruct scatterlist sg;\n@@ -98,17 +92,6 @@ static inline struct crypto_gcm_req_priv_ctx *crypto_gcm_reqctx(\n \treturn (void *)PTR_ALIGN((u8 *)aead_request_ctx(req), align + 1);\n }\n \n-static void crypto_gcm_setkey_done(struct crypto_async_request *req, int err)\n-{\n-\tstruct crypto_gcm_setkey_result *result = req->data;\n-\n-\tif (err == -EINPROGRESS)\n-\t\treturn;\n-\n-\tresult->err = err;\n-\tcomplete(&result->completion);\n-}\n-\n static int crypto_gcm_setkey(struct crypto_aead *aead, const u8 *key,\n \t\t\t unsigned int keylen)\n {\n@@ -119,7 +102,7 @@ static int crypto_gcm_setkey(struct crypto_aead *aead, const u8 *key,\n \t\tbe128 hash;\n \t\tu8 iv[16];\n \n-\t\tstruct crypto_gcm_setkey_result result;\n+\t\tstruct crypto_wait wait;\n \n \t\tstruct scatterlist sg[1];\n \t\tstruct skcipher_request req;\n@@ -140,21 +123,18 @@ static int crypto_gcm_setkey(struct crypto_aead *aead, const u8 *key,\n \tif (!data)\n \t\treturn -ENOMEM;\n \n-\tinit_completion(&data->result.completion);\n+\tcrypto_init_wait(&data->wait);\n \tsg_init_one(data->sg, &data->hash, sizeof(data->hash));\n \tskcipher_request_set_tfm(&data->req, ctr);\n \tskcipher_request_set_callback(&data->req, CRYPTO_TFM_REQ_MAY_SLEEP |\n \t\t\t\t\t\t CRYPTO_TFM_REQ_MAY_BACKLOG,\n-\t\t\t\t crypto_gcm_setkey_done,\n-\t\t\t\t &data->result);\n+\t\t\t\t crypto_req_done,\n+\t\t\t\t &data->wait);\n \tskcipher_request_set_crypt(&data->req, data->sg, data->sg,\n \t\t\t\t sizeof(data->hash), data->iv);\n \n-\terr = crypto_skcipher_encrypt(&data->req);\n-\tif (err == -EINPROGRESS || err == -EBUSY) {\n-\t\twait_for_completion(&data->result.completion);\n-\t\terr = data->result.err;\n-\t}\n+\terr = crypto_wait_req(crypto_skcipher_encrypt(&data->req),\n+\t\t\t\t\t\t\t&data->wait);\n \n \tif (err)\n \t\tgoto out;\n", "prefixes": [ "v8", "10/20" ] }