From: Sabrina Dubroca <sd@queasysnail.net>
To: Jakub Kicinski <kuba@kernel.org>
Cc: netdev@vger.kernel.org, borisp@nvidia.com, john.fastabend@gmail.com
Subject: Re: [PATCH net-next 08/14] tls: also use init_prot_info in tls_set_device_offload
Date: Tue, 17 Oct 2023 11:16:56 +0200 [thread overview]
Message-ID: <ZS5RCPqxlJtTgL_4@hog> (raw)
In-Reply-To: <20231013142307.70af75d6@kernel.org>
2023-10-13, 14:23:07 -0700, Jakub Kicinski wrote:
> On Mon, 9 Oct 2023 22:50:48 +0200 Sabrina Dubroca wrote:
> > + if (mode == TLS_HW) {
> > + prot->aad_size = 0;
> > + prot->tail_size = 0;
> > + }
>
> Strange, tail_size doesn't matter because HW doesn't support TLS 1.3
> but aad_size? Is it overwritten by SW init or something?
For RX, yes, tls_set_device_offload_rx -> tls_set_sw_offload ->
init_prot_info(mode=TLS_SW).
But aad_size is not used in tls_device_reencrypt, maybe because (for
both GCM variants)
TLS_HEADER_SIZE + cipher_desc->iv == TLS_AAD_SPACE_SIZE
For TX, it looks like tls_device_fallback hardcodes TLS_AAD_SPACE_SIZE
where tls_sw would use prot->aad_size. tls_device doesn't use either.
Actually this patch is broken. If we set TLS_RX to TLS_SW first (for
example because we disabled tls-hw-rx-offload with ethtool), and
TLS_TX to TLS_HW second, that will set aad_size to 0, but RX needs it
to be set.
I'll send a fix to drop this hunk completely. Thanks for reviewing.
--
Sabrina
next prev parent reply other threads:[~2023-10-17 9:17 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-09 20:50 [PATCH net-next 00/14] net: tls: various code cleanups and improvements Sabrina Dubroca
2023-10-09 20:50 ` [PATCH net-next 01/14] tls: get salt using crypto_info_salt in tls_enc_skb Sabrina Dubroca
2023-10-09 20:50 ` [PATCH net-next 02/14] tls: drop unnecessary cipher_type checks in tls offload Sabrina Dubroca
2023-10-09 20:50 ` [PATCH net-next 03/14] tls: store rec_seq directly within cipher_context Sabrina Dubroca
2023-10-09 20:50 ` [PATCH net-next 04/14] tls: rename MAX_IV_SIZE to TLS_MAX_IV_SIZE Sabrina Dubroca
2023-10-09 20:50 ` [PATCH net-next 05/14] tls: store iv directly within cipher_context Sabrina Dubroca
2023-10-09 20:50 ` [PATCH net-next 06/14] tls: extract context alloc/initialization out of tls_set_sw_offload Sabrina Dubroca
2023-10-09 20:50 ` [PATCH net-next 07/14] tls: move tls_prot_info initialization " Sabrina Dubroca
2023-10-09 20:50 ` [PATCH net-next 08/14] tls: also use init_prot_info in tls_set_device_offload Sabrina Dubroca
2023-10-13 21:23 ` Jakub Kicinski
2023-10-17 9:16 ` Sabrina Dubroca [this message]
2023-10-17 7:08 ` Tariq Toukan
2023-10-09 20:50 ` [PATCH net-next 09/14] tls: add a helper to allocate/initialize offload_ctx_tx Sabrina Dubroca
2023-10-09 20:50 ` [PATCH net-next 10/14] tls: remove tls_context argument from tls_set_sw_offload Sabrina Dubroca
2023-10-09 20:50 ` [PATCH net-next 11/14] tls: remove tls_context argument from tls_set_device_offload Sabrina Dubroca
2023-10-09 20:50 ` [PATCH net-next 12/14] tls: validate crypto_info in a separate helper Sabrina Dubroca
2023-10-09 20:50 ` [PATCH net-next 13/14] chcr_ktls: use tls_offload_context_tx and driver_state like other drivers Sabrina Dubroca
2023-10-09 20:50 ` [PATCH net-next 14/14] tls: use fixed size for tls_offload_context_{tx,rx}.driver_state Sabrina Dubroca
2023-10-13 9:47 ` [PATCH net-next 00/14] net: tls: various code cleanups and improvements Simon Horman
2023-10-13 10:30 ` patchwork-bot+netdevbpf
2023-10-13 21:23 ` Jakub Kicinski
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=ZS5RCPqxlJtTgL_4@hog \
--to=sd@queasysnail.net \
--cc=borisp@nvidia.com \
--cc=john.fastabend@gmail.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
/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).