Netdev List
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: Rishikesh Jethwani <rjethwani@purestorage.com>, netdev@vger.kernel.org
Cc: saeedm@nvidia.com, tariqt@nvidia.com, mbloch@nvidia.com,
	borisp@nvidia.com, john.fastabend@gmail.com, kuba@kernel.org,
	sd@queasysnail.net, davem@davemloft.net, edumazet@google.com,
	leon@kernel.org, andrew.gospodarek@broadcom.com
Subject: Re: [PATCH v15 3/9] tls: add TLS 1.3 hardware offload support
Date: Thu, 23 Jul 2026 10:47:36 +0200	[thread overview]
Message-ID: <e8829e6d-977b-4aa5-b823-9bb723219746@redhat.com> (raw)
In-Reply-To: <20260709205325.1591196-4-rjethwani@purestorage.com>

On 7/9/26 10:53 PM, Rishikesh Jethwani wrote:
> diff --git a/net/tls/tls_main.c b/net/tls/tls_main.c
> index 8c588cdab733..c4c15c0e731a 100644
> --- a/net/tls/tls_main.c
> +++ b/net/tls/tls_main.c
> @@ -714,49 +714,64 @@ static int do_tls_setsockopt_conf(struct sock *sk, sockptr_t optval,
>  	}
>  
>  	if (tx) {
> -		rc = tls_set_device_offload(sk);
> -		conf = TLS_HW;
> -		if (!rc) {
> -			TLS_INC_STATS(sock_net(sk), LINUX_MIB_TLSTXDEVICE);
> -			TLS_INC_STATS(sock_net(sk), LINUX_MIB_TLSCURRTXDEVICE);
> -		} else {
> -			rc = tls_set_sw_offload(sk, 1,
> -						update ? crypto_info : NULL);
> -			if (rc)
> -				goto err_crypto_info;
> -
> -			if (update) {
> -				TLS_INC_STATS(sock_net(sk), LINUX_MIB_TLSTXREKEYOK);
> -			} else {
> -				TLS_INC_STATS(sock_net(sk), LINUX_MIB_TLSTXSW);
> -				TLS_INC_STATS(sock_net(sk), LINUX_MIB_TLSCURRTXSW);
> +		if (update && ctx->tx_conf == TLS_HW) {
> +			rc = -EOPNOTSUPP;
> +			goto err_crypto_info;
> +		}
> +
> +		if (!update) {
> +			rc = tls_set_device_offload(sk);

This largish chunk changes the whole logic beyond offload update for
_both_ TLS 1.2 and 1.3 with no obvious reasons and no explaination at
all, nor in form of code comments nor in the commit message.

Among other things,  tls_set_device_offload() is now called
conditionally. Is that an optimization? Was the call really unneeded
even before to this patch? At very least such change should be in a
separate patch, which reasonable documentation/explaination.

/P


  reply	other threads:[~2026-07-23  8:47 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-09 20:53 [PATCH net-next v15 0/9] tls: Add TLS 1.3 hardware offload support Rishikesh Jethwani
2026-07-09 20:53 ` [PATCH v15 1/9] net: tls: reject TLS 1.3 offload in chcr_ktls and nfp drivers Rishikesh Jethwani
2026-07-09 20:53 ` [PATCH v15 2/9] net/mlx5e: add TLS 1.3 hardware offload support Rishikesh Jethwani
2026-07-09 20:53 ` [PATCH v15 3/9] tls: " Rishikesh Jethwani
2026-07-23  8:47   ` Paolo Abeni [this message]
2026-07-09 20:53 ` [PATCH v15 4/9] tls: split tls_set_sw_offload into init and finalize stages Rishikesh Jethwani
2026-07-09 20:53 ` [PATCH v15 5/9] tls: prep helpers and refactors for HW offload KeyUpdate Rishikesh Jethwani
2026-07-09 20:53 ` [PATCH v15 6/9] tls: device: add TX KeyUpdate support Rishikesh Jethwani
2026-07-23  9:14   ` Paolo Abeni
2026-07-23  9:15   ` Paolo Abeni
2026-07-09 20:53 ` [PATCH v15 7/9] tls: device: add RX " Rishikesh Jethwani
2026-07-23  9:15   ` Paolo Abeni
2026-07-09 20:53 ` [PATCH v15 8/9] tls: device: add tracepoints for the KeyUpdate path Rishikesh Jethwani
2026-07-09 20:53 ` [PATCH v15 9/9] selftests: net: add TLS hardware offload test Rishikesh Jethwani

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=e8829e6d-977b-4aa5-b823-9bb723219746@redhat.com \
    --to=pabeni@redhat.com \
    --cc=andrew.gospodarek@broadcom.com \
    --cc=borisp@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=john.fastabend@gmail.com \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=mbloch@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=rjethwani@purestorage.com \
    --cc=saeedm@nvidia.com \
    --cc=sd@queasysnail.net \
    --cc=tariqt@nvidia.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