[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1757486861-542133-2-git-send-email-tariqt@nvidia.com>
Date: Wed, 10 Sep 2025 09:47:39 +0300
From: Tariq Toukan <tariqt@...dia.com>
To: Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, Andrew Lunn <andrew+netdev@...n.ch>, "David
S. Miller" <davem@...emloft.net>
CC: Saeed Mahameed <saeedm@...dia.com>, Leon Romanovsky <leon@...nel.org>,
Tariq Toukan <tariqt@...dia.com>, Mark Bloch <mbloch@...dia.com>, "John
Fastabend" <john.fastabend@...il.com>, Sabrina Dubroca <sd@...asysnail.net>,
<netdev@...r.kernel.org>, <linux-rdma@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, Gal Pressman <gal@...dia.com>, Boris Pismenny
<borisp@...dia.com>, Shahar Shitrit <shshitrit@...dia.com>
Subject: [PATCH net 1/3] net: tls: Introduce RX async resync request cancel function
From: Shahar Shitrit <shshitrit@...dia.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@...dia.com>
Signed-off-by: Tariq Toukan <tariqt@...dia.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
Powered by blists - more mailing lists