From: Jakub Kicinski <kuba@kernel.org>
To: "Herbert Xu" <herbert@gondor.apana.org.au>
Cc: Linux Crypto Mailing List <linux-crypto@vger.kernel.org>,
Alasdair Kergon <agk@redhat.com>,
Mike Snitzer <snitzer@kernel.org>,
dm-devel@redhat.com, "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org, Tyler Hicks <code@tyhicks.com>,
ecryptfs@vger.kernel.org, Marcel Holtmann <marcel@holtmann.org>,
Johan Hedberg <johan.hedberg@gmail.com>,
Luiz Augusto von Dentz <luiz.dentz@gmail.com>,
linux-bluetooth@vger.kernel.org,
Steffen Klassert <steffen.klassert@secunet.com>,
Jon Maloy <jmaloy@redhat.com>, Ying Xue <ying.xue@windriver.com>,
Boris Pismenny <borisp@nvidia.com>,
John Fastabend <john.fastabend@gmail.com>,
David Howells <dhowells@redhat.com>,
Jarkko Sakkinen <jarkko@kernel.org>,
keyrings@vger.kernel.org
Subject: Re: [PATCH 8/17] tls: Only use data field in crypto completion function
Date: Mon, 6 Feb 2023 23:15:21 -0800 [thread overview]
Message-ID: <20230206231521.712f53e5@kernel.org> (raw)
In-Reply-To: <E1pOydn-007zi3-LG@formenos.hmeau.com>
On Mon, 06 Feb 2023 18:22:27 +0800 Herbert Xu wrote:
> -static void tls_encrypt_done(struct crypto_async_request *req, int err)
> +static void tls_encrypt_done(crypto_completion_data_t *data, int err)
> {
> - struct aead_request *aead_req = (struct aead_request *)req;
> - struct sock *sk = req->data;
> - struct tls_context *tls_ctx = tls_get_ctx(sk);
> - struct tls_prot_info *prot = &tls_ctx->prot_info;
> - struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx);
> + struct aead_request *aead_req = crypto_get_completion_data(data);
All we use aead_req for in this function now is to find rec...
> + struct tls_sw_context_tx *ctx;
> + struct tls_context *tls_ctx;
> + struct tls_prot_info *prot;
> struct scatterlist *sge;
> struct sk_msg *msg_en;
> struct tls_rec *rec;
> bool ready = false;
> + struct sock *sk;
> int pending;
>
> rec = container_of(aead_req, struct tls_rec, aead_req);
> msg_en = &rec->msg_encrypted;
>
> + sk = rec->sk;
> + tls_ctx = tls_get_ctx(sk);
> + prot = &tls_ctx->prot_info;
> + ctx = tls_sw_ctx_tx(tls_ctx);
> +
> sge = sk_msg_elem(msg_en, msg_en->sg.curr);
> sge->offset -= prot->prepend_size;
> sge->length += prot->prepend_size;
> @@ -520,7 +536,7 @@ static int tls_do_encryption(struct sock *sk,
> data_len, rec->iv_data);
>
> aead_request_set_callback(aead_req, CRYPTO_TFM_REQ_MAY_BACKLOG,
> - tls_encrypt_done, sk);
> + tls_encrypt_done, aead_req);
... let's just pass rec instead of aead_req here, then?
> /* Add the record in tx_list */
> list_add_tail((struct list_head *)&rec->list, &ctx->tx_list);
next prev parent reply other threads:[~2023-02-07 7:15 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-06 10:21 [PATCH 0/17] crypto: api - Change completion callback argument to void star Herbert Xu
2023-02-06 10:22 ` [PATCH 1/17] dm: Add scaffolding to change completion function signature Herbert Xu
2023-02-06 12:23 ` crypto: api - Change completion callback argument to void star bluez.test.bot
2023-02-06 17:29 ` [PATCH 1/17] dm: Add scaffolding to change completion function signature Mike Snitzer
2023-02-06 10:22 ` [PATCH 2/17] net: macsec: " Herbert Xu
2023-02-10 0:43 ` Jarkko Sakkinen
2023-02-06 10:22 ` [PATCH 3/17] fs: ecryptfs: Use crypto_wait_req Herbert Xu
2023-02-10 0:42 ` Jarkko Sakkinen
2023-02-06 10:22 ` [PATCH 4/17] Bluetooth: " Herbert Xu
2023-02-06 10:22 ` [PATCH 5/17] net: ipv4: Add scaffolding to change completion function signature Herbert Xu
2023-02-06 10:22 ` [PATCH 6/17] net: ipv6: " Herbert Xu
2023-02-06 10:22 ` [PATCH 7/17] tipc: " Herbert Xu
2023-02-06 10:22 ` [PATCH 8/17] tls: Only use data field in crypto completion function Herbert Xu
2023-02-07 7:15 ` Jakub Kicinski [this message]
2023-02-07 8:18 ` [PATCH] tls: Pass rec instead of aead_req into tls_encrypt_done Herbert Xu
2023-02-07 8:41 ` bluez.test.bot
2023-02-07 18:50 ` [PATCH] " Jakub Kicinski
2023-02-06 10:22 ` [PATCH 9/17] KEYS: DH: Use crypto_wait_req Herbert Xu
2023-02-06 10:22 ` [PATCH 10/17] crypto: api - Use data directly in completion function Herbert Xu
2023-02-08 5:58 ` [v2 PATCH " Herbert Xu
2023-02-08 6:17 ` [v2,10/17] " bluez.test.bot
2023-02-06 10:22 ` [PATCH 11/17] dm: Remove completion function scaffolding Herbert Xu
2023-02-06 17:29 ` Mike Snitzer
2023-02-06 10:22 ` [PATCH 12/17] net: macsec: " Herbert Xu
2023-02-06 10:22 ` [PATCH 13/17] net: ipv4: " Herbert Xu
2023-02-06 10:22 ` [PATCH 14/17] net: ipv6: " Herbert Xu
2023-02-06 10:22 ` [PATCH 15/17] tipc: " Herbert Xu
2023-02-06 10:22 ` [PATCH 16/17] tls: " Herbert Xu
2023-02-06 10:22 ` [PATCH 17/17] crypto: api - " Herbert Xu
2023-02-10 0:56 ` Jarkko Sakkinen
2023-02-07 7:10 ` [PATCH 0/17] crypto: api - Change completion callback argument to void star Jakub Kicinski
2023-02-07 7:16 ` Jakub Kicinski
2023-02-07 8:03 ` Herbert Xu
2023-02-07 18:51 ` Jakub Kicinski
2023-02-08 4:02 ` Herbert Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230206231521.712f53e5@kernel.org \
--to=kuba@kernel.org \
--cc=agk@redhat.com \
--cc=borisp@nvidia.com \
--cc=code@tyhicks.com \
--cc=davem@davemloft.net \
--cc=dhowells@redhat.com \
--cc=dm-devel@redhat.com \
--cc=ecryptfs@vger.kernel.org \
--cc=edumazet@google.com \
--cc=herbert@gondor.apana.org.au \
--cc=jarkko@kernel.org \
--cc=jmaloy@redhat.com \
--cc=johan.hedberg@gmail.com \
--cc=john.fastabend@gmail.com \
--cc=keyrings@vger.kernel.org \
--cc=linux-bluetooth@vger.kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=luiz.dentz@gmail.com \
--cc=marcel@holtmann.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=snitzer@kernel.org \
--cc=steffen.klassert@secunet.com \
--cc=ying.xue@windriver.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).