[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230206231521.712f53e5@kernel.org>
Date: Mon, 6 Feb 2023 23:15:21 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: "Herbert Xu" <herbert@...dor.apana.org.au>
Cc: Linux Crypto Mailing List <linux-crypto@...r.kernel.org>,
Alasdair Kergon <agk@...hat.com>,
Mike Snitzer <snitzer@...nel.org>, dm-devel@...hat.com,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Paolo Abeni <pabeni@...hat.com>, netdev@...r.kernel.org,
Tyler Hicks <code@...icks.com>, ecryptfs@...r.kernel.org,
Marcel Holtmann <marcel@...tmann.org>,
Johan Hedberg <johan.hedberg@...il.com>,
Luiz Augusto von Dentz <luiz.dentz@...il.com>,
linux-bluetooth@...r.kernel.org,
Steffen Klassert <steffen.klassert@...unet.com>,
Jon Maloy <jmaloy@...hat.com>,
Ying Xue <ying.xue@...driver.com>,
Boris Pismenny <borisp@...dia.com>,
John Fastabend <john.fastabend@...il.com>,
David Howells <dhowells@...hat.com>,
Jarkko Sakkinen <jarkko@...nel.org>, keyrings@...r.kernel.org
Subject: Re: [PATCH 8/17] tls: Only use data field in crypto completion
function
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);
Powered by blists - more mailing lists