From: Sabrina Dubroca <sd@queasysnail.net>
To: Tariq Toukan <tariqt@nvidia.com>
Cc: 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>,
Saeed Mahameed <saeedm@nvidia.com>,
Leon Romanovsky <leon@kernel.org>, Mark Bloch <mbloch@nvidia.com>,
John Fastabend <john.fastabend@gmail.com>,
netdev@vger.kernel.org, linux-rdma@vger.kernel.org,
linux-kernel@vger.kernel.org, Gal Pressman <gal@nvidia.com>,
Shahar Shitrit <shshitrit@nvidia.com>
Subject: Re: [PATCH net V2 3/3] net/mlx5e: kTLS, Cancel RX async resync request in error flows
Date: Tue, 21 Oct 2025 16:54:55 +0200 [thread overview]
Message-ID: <aPeev-zbATKMq1pY@krikkit> (raw)
In-Reply-To: <1760943954-909301-4-git-send-email-tariqt@nvidia.com>
2025-10-20, 10:05:54 +0300, Tariq Toukan wrote:
> From: Shahar Shitrit <shshitrit@nvidia.com>
>
> When device loses track of TLS records, it attempts to resync by
> monitoring records and requests an asynchronous resynchronization
> from software for this TLS connection.
>
> The TLS module handles such device RX resync requests by logging record
> headers and comparing them with the record tcp_sn when provided by the
> device. It also increments rcd_delta to track how far the current
> record tcp_sn is from the tcp_sn of the original resync request.
> If the device later responds with a matching tcp_sn, the TLS module
> approves the tcp_sn for resync.
>
> However, the device response may be delayed or never arrive,
> particularly due to traffic-related issues such as packet drops or
> reordering. In such cases, the TLS module remains unaware that resync
> will not complete, and continues performing unnecessary work by logging
> headers and incrementing rcd_delta, which can eventually exceed the
> threshold and trigger a WARN(). For example, this was observed when the
> device got out of tracking, causing
> mlx5e_ktls_handle_get_psv_completion() to fail and ultimately leading
> to the rcd_delta warning.
>
> To address this, call tls_offload_rx_resync_async_request_cancel()
> to cancel the resync request and stop resync tracking in such error
> cases. Also, increment the tls_resync_req_skip counter to track these
> cancellations.
>
> Fixes: 0419d8c9d8f8 ("net/mlx5e: kTLS, Add kTLS RX resync support")
> Signed-off-by: Shahar Shitrit <shshitrit@nvidia.com>
> Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
> ---
> .../mellanox/mlx5/core/en_accel/ktls_rx.c | 33 ++++++++++++++++---
> .../mellanox/mlx5/core/en_accel/ktls_txrx.h | 4 +++
> .../net/ethernet/mellanox/mlx5/core/en_rx.c | 4 +++
> 3 files changed, 37 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_rx.c
> index 5fbc92269585..ae325c471e7f 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_rx.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_rx.c
> @@ -339,14 +339,19 @@ static void resync_handle_work(struct work_struct *work)
>
> if (unlikely(test_bit(MLX5E_PRIV_RX_FLAG_DELETING, priv_rx->flags))) {
> mlx5e_ktls_priv_rx_put(priv_rx);
> + priv_rx->rq_stats->tls_resync_req_skip++;
> + tls_offload_rx_resync_async_request_cancel(&resync->core);
> return;
> }
>
> c = resync->priv->channels.c[priv_rx->rxq];
> sq = &c->async_icosq;
>
> - if (resync_post_get_progress_params(sq, priv_rx))
> + if (resync_post_get_progress_params(sq, priv_rx)) {
> + priv_rx->rq_stats->tls_resync_req_skip++;
There's already a tls_resync_req_skip++ at the end of
resync_post_get_progress_params() just before returning an error, so I
don't think this one is needed? (or keep this one and remove the one
in resync_post_get_progress_params, so that tls_resync_req_skip++ and
_cancel() are together like in the rest of the patch)
Other than that, I don't understand much about the resync handling in
the driver and how the various bits fit together, but the patch looks
consistent.
> + tls_offload_rx_resync_async_request_cancel(&resync->core);
> mlx5e_ktls_priv_rx_put(priv_rx);
> + }
> }
--
Sabrina
next prev parent reply other threads:[~2025-10-21 14:54 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-20 7:05 [PATCH net V2 0/3] tls: Introduce and use RX async resync request cancel function Tariq Toukan
2025-10-20 7:05 ` [PATCH net V2 1/3] net: tls: Change async resync helpers argument Tariq Toukan
2025-10-21 14:55 ` Sabrina Dubroca
2025-10-20 7:05 ` [PATCH net V2 2/3] net: tls: Cancel RX async resync request on rdc_delta overflow Tariq Toukan
2025-10-21 15:28 ` Sabrina Dubroca
2025-10-22 11:38 ` Shahar Shitrit
2025-10-22 12:47 ` Sabrina Dubroca
2025-10-23 10:44 ` Shahar Shitrit
2025-10-23 13:24 ` Sabrina Dubroca
2025-10-20 7:05 ` [PATCH net V2 3/3] net/mlx5e: kTLS, Cancel RX async resync request in error flows Tariq Toukan
2025-10-21 14:54 ` Sabrina Dubroca [this message]
2025-10-21 15:25 ` Shahar Shitrit
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=aPeev-zbATKMq1pY@krikkit \
--to=sd@queasysnail.net \
--cc=andrew+netdev@lunn.ch \
--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=shshitrit@nvidia.com \
--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;
as well as URLs for NNTP newsgroup(s).