From: Tariq Toukan <tariqt@nvidia.com>
To: Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>
Cc: Saeed Mahameed <saeedm@nvidia.com>,
Leon Romanovsky <leon@kernel.org>,
Tariq Toukan <tariqt@nvidia.com>, Mark Bloch <mbloch@nvidia.com>,
"John Fastabend" <john.fastabend@gmail.com>,
Sabrina Dubroca <sd@queasysnail.net>, <netdev@vger.kernel.org>,
<linux-rdma@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
Gal Pressman <gal@nvidia.com>, Boris Pismenny <borisp@nvidia.com>,
Shahar Shitrit <shshitrit@nvidia.com>
Subject: [PATCH net 1/3] net: tls: Introduce RX async resync request cancel function
Date: Wed, 10 Sep 2025 09:47:39 +0300 [thread overview]
Message-ID: <1757486861-542133-2-git-send-email-tariqt@nvidia.com> (raw)
In-Reply-To: <1757486861-542133-1-git-send-email-tariqt@nvidia.com>
From: Shahar Shitrit <shshitrit@nvidia.com>
When a netdev requests a RX async resync for a TLS connection, the TLS
module handles it by logging record headers and attempting to match
them to the tcp_sn provided by the device. If a match is found, the
TLS module approves the tcp_sn for resynchronization.
While waiting for a device response, the TLS module also increments
rcd_delta each time a new TLS record is received, tracking the distance
from the original resync request.
However, if the device response is delayed or fails (e.g due to
unstable connection and device getting out of tracking, hardware
errors, resource exhaustion etc.), the TLS module keeps logging and
incrementing, which can lead to a WARN() when rcd_delta exceeds the
threshold.
To address that, introduce tls_offload_rx_resync_async_request_cancel()
to be called when device response fails.
A follow-up patch will use this function to cancel async resync
requests in mlx5 when the device is no longer able to complete the
resync.
Signed-off-by: Shahar Shitrit <shshitrit@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
---
include/net/tls.h | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/include/net/tls.h b/include/net/tls.h
index 857340338b69..380492effe3f 100644
--- a/include/net/tls.h
+++ b/include/net/tls.h
@@ -472,6 +472,15 @@ tls_offload_rx_resync_async_request_end(struct sock *sk, __be32 seq)
((u64)ntohl(seq) << 32) | RESYNC_REQ);
}
+static inline void
+tls_offload_rx_resync_async_request_cancel(struct sock *sk)
+{
+ struct tls_context *tls_ctx = tls_get_ctx(sk);
+ struct tls_offload_context_rx *rx_ctx = tls_offload_ctx_rx(tls_ctx);
+
+ atomic64_set(&rx_ctx->resync_async->req, 0);
+}
+
static inline void
tls_offload_rx_resync_set_type(struct sock *sk, enum tls_offload_sync_type type)
{
--
2.31.1
next prev parent reply other threads:[~2025-09-10 6:48 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-10 6:47 [PATCH net 0/3] tls: Introduce and use " Tariq Toukan
2025-09-10 6:47 ` Tariq Toukan [this message]
2025-09-10 6:47 ` [PATCH net 2/3] net: tls: Cancel RX async resync request on rdc_delta overflow Tariq Toukan
2025-09-12 15:14 ` Sabrina Dubroca
2025-09-22 7:16 ` Shahar Shitrit
2025-09-23 19:16 ` Sabrina Dubroca
2025-10-20 8:02 ` Shahar Shitrit
2025-09-14 18:53 ` Jakub Kicinski
2025-09-22 7:18 ` Shahar Shitrit
2025-09-22 15:54 ` Sabrina Dubroca
2025-09-28 6:35 ` Shahar Shitrit
2025-09-29 9:54 ` Sabrina Dubroca
2025-09-10 6:47 ` [PATCH net 3/3] net/mlx5e: kTLS, cancel RX async resync request in error flows Tariq Toukan
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=1757486861-542133-2-git-send-email-tariqt@nvidia.com \
--to=tariqt@nvidia.com \
--cc=andrew+netdev@lunn.ch \
--cc=borisp@nvidia.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gal@nvidia.com \
--cc=john.fastabend@gmail.com \
--cc=kuba@kernel.org \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=mbloch@nvidia.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=saeedm@nvidia.com \
--cc=sd@queasysnail.net \
--cc=shshitrit@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
all inboxes | Powered by JetHome®