Article View: linux.kernel.netdev
Article #7415[PATCH net v1] net/mlx5e: kTLS, Fix missing error unwind when enabling RX offload
From: Xuanqiang Luo
Date: Mon, 26 Oct 2026 09:53
Date: Mon, 26 Oct 2026 09:53
56 lines
10710 bytes
10710 bytes
From: Xuanqiang Luo <luoxuanqiang@kylinos.cn>
Since commit abed42f9cd80 ("net/mlx5e: Conditionally create async
ICOSQ"), the async ICOSQ is only created when an XDP program is attached
or priv->ktls_rx_was_enabled is set. When TLS RX offload is enabled for
the first time, mlx5e_ktls_set_feature_rx() sets the flag and reopens
the channels so that they get the queue, but it ignores the return value
of mlx5e_safe_reopen_channels().
If the reopen fails, mlx5e_safe_switch_params() keeps the old channels,
which have no async ICOSQ, while NETIF_F_HW_TLS_RX is still reported as
enabled. The next offloaded RX connection then dereferences the NULL
c->async_icosq in post_rx_param_wqes(). Enabling the feature again does
not help, as the flag is already set and the reopen is skipped.
Propagate the error, clear the flag and destroy the accel TCP flow
tables again, so that the feature stays disabled and the next attempt
retries the reopen.
Fixes: abed42f9cd80 ("net/mlx5e: Conditionally create async ICOSQ")
Signed-off-by: Xuanqiang Luo <luoxuanqiang@kylinos.cn>
---
Found by code inspection while backporting commit abed42f9cd80 to a
downstream kernel. I do not have a crypto-enabled ConnectX NIC, so the
failure has not been reproduced and the fix is only compile-tested.
The crash itself is the one described in the changelog of abed42f9cd80
("async ICOSQ allocation is not triggered, causing a NULL pointer
crash"). This patch only covers the case where the reopen that should
create the queue fails. ktls.c is also the only caller that ignores the
return value of mlx5e_safe_reopen_channels(); the callers in health.c
and reporter_tx.c check it.
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls.c
index 337201f128958..3cc1213c2f682 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls.c
@@ -139,7 +139,11 @@ int mlx5e_ktls_set_feature_rx(struct net_device *netdev, bool enable)
err = mlx5e_accel_fs_tcp_create(priv->fs);
if (!err && !priv->ktls_rx_was_enabled) {
priv->ktls_rx_was_enabled = true;
- mlx5e_safe_reopen_channels(priv);
+ err = mlx5e_safe_reopen_channels(priv);
+ if (err) {
+ priv->ktls_rx_was_enabled = false;
+ mlx5e_accel_fs_tcp_destroy(priv->fs);
+ }
}
} else {
mlx5e_accel_fs_tcp_destroy(priv->fs);
--
2.43.0
Technical Details
Message-ID:
<20261026095346.1212609-1-xuanqiang.luo@linux.dev>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-351805-linux-kernel-netdev=dewy.ruShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-351805-linux-kernel-netdev=dewy.ru From: xuanqiang.luo@linux.dev (Xuanqiang Luo) Newsgroups: linux.kernel.netdev Subject: [PATCH net v1] net/mlx5e: kTLS, Fix missing error unwind when enabling RX offload Date: Mon, 26 Oct 2026 18:53:46 +0900 Organization: Usenet Network Message-ID: <20261026095346.1212609-1-xuanqiang.luo@linux.dev> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="1276847"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:Kw/HWDOb4ggqD5g+E4s4AIeeYPM= sha256:utcJ8alYTX0h7vb+TMsXm0cpjKwIncBpuYox9FdjKsY= sha1:rbpr/t9f4ckXtfWAzB+4P/K4SM4= sha256:IGzSNAFrcD0xzKY29k+RZi9PmPH0GjXWHj8gslIzZ/k= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 2A299125B97; Mon, 26 Oct 2026 13:00:04 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.05 X-Spam-Status: No, score=-3.05 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.25, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key) header.d=linux.dev X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DplxF5ecx0Sp; Mon, 26 Oct 2026 12:59:59 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-351805-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=linux.dev X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id B382B125B96; Mon, 26 Oct 2026 12:59:49 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id AFBA23298C; Mon, 26 Oct 2026 09:54:41 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1793008471; b=0jkJwSXnKbvLWadEM8VD2KwJG5HNYFAyxsgl4gsCwYIh0I1VaiqeuqNNN9Y9MT7NfQtq lvB2G94/PyD7PHD/lJfVXk1ZqSlxhAxwMJOaQpcyhweUXj63i3oGUtkDL76Yc5aQAfjwL yAM0ebqfMCEZmWWwZIYa1MzFbKz0QvpeeGuAFUe2+LTsYSCYd0MVxBkX2cBbvRMaOfdym vXrwVHPC3T15IbLyDqR76M1oBh1mVjXeJ4P5b0Dbc2TswA+4bDhWGwBBceOM4pajYdIPX 2FR3m+6fNlZeEwZiKP34fl3yr1UyQNsaDUtVfCtBbRjo2g77iPmRkjtLgLrRZiy+SPg== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793008471; h=X-Original-To:Received:DMARC-Filter:X-Envelope-To:DKIM-Signature: X-Envelope-To:Received:X-Mizu-Trace-ID:X-Migadu-Flow:From:To:Cc: Subject:Date:Message-ID:X-Mailer:X-Mailing-List:List-Id:List-Post: List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence: MIME-Version:Content-Transfer-Encoding; bh=+CdnSQYOGYAynrzkG/QTB342cWFFcGggZ0YCcMYw7pY=; b=MDNPkUR7+MetLd9SJd28rHZBfbElYi1V+opQOUYvs04RqTvi8x2zQ0o1QeItRWtPgH8V olLflxStDgAP9HH66jamW8SelMZNewuSYNkQH9aRdpichuVAImk4Z2cR1uNvVqOfFzWnB Z8rptLl6/KBytr3fHyzPO6zFKI3t+nkb58xoEV0hx/A0bKdAvbYLee5JBPDRzx2Q+Yc4y c95x/4ztcS4Gk4546WmTM3x3P/XbxkBYJLzcos1ShV7lLjrmOSMEWBccbeOKfKkLhBz6H HRnG1XrCGcd0NDaqJRgxKrwuxZC8107CKcLTM0XqjUzrTTHemLrQDPcNTX/JntPLaQQ== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=T8HuUKEk; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 99D5D60A2610; Mon, 26 Oct 2026 09:54:31 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=T8HuUKEk X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=91.218.175.2 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793008465; b=GYLUyanj+AXNoYgwOfZJXtUGq8rBOrhTq9El5R2Yawfq3Q/B6qO18qBtuUJ+PaBfR887 BpWTLnB3qTikGKcWWnVhJDSiJTffHyH3dhFuYreH5ERsek19505XS/N0Q3DunM34yOFQV jaPR07AXU96VeQ7OxA9Mj9xP8pBJ/tzaDltYKlu51ryfb1UwTnZ5ZEalUxOdtmS14s0tJ ixjY/+m5u+DptI0q/6cmVi1z3X94NBKuRcH9GDZ+JRF2HgSNXfm5AEnLDJhjx4UaNKIjc zxbuBp6ZRKFXWp/RKiylbMzVGuS66w4oP4fz63I4gzsLvmUN3TeS2+1olnGFb/dQqNw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793008465; h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received: X-Mizu-Trace-ID:X-Migadu-Flow:From:To:Cc:Subject:Date:Message-ID: X-Mailer:MIME-Version:Content-Transfer-Encoding; bh=+CdnSQYOGYAynrzkG/QTB342cWFFcGggZ0YCcMYw7pY=; b=NsqBhQXt/DKuY6XL6qjOSYQn59nro/4FroadSTiu7bYicBOF1zYe1DkqqmHPLPTWETmo w6J/uiz2GQ7f6wzNTKqZXuH1w32Qsxl7t9bp9um4ZIJYVuRocFlVCQo5LGSAHtHuBH6e6 b7aA8SEee3Ik9Us6I7mwdRFxL3sjWgnPwza8BU9DruLk0vAbIYwUeTlNOceep7N3NDnJ3 A4wVq22oeB49Mr83acsKNZr29j8LUqRG/pPQdjMqUK2GHgdUlKexmhifr8O5b6OqCI0hM ACDlIfNtXN6ihv/v/bWI2kPfTw93hB9wf62ECGzrFeLGsIKKEF2fMIMMpchU24dhI/w== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=T8HuUKEk; arc=none smtp.remote-ip=91.218.175.2 X-Received: from mta0.migadu.com (out-2.mta0.migadu.com [91.218.175.2]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BB716606A325 for <netdev@vger.kernel.org>; Mon, 26 Oct 2026 09:54:24 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org BB716606A325 X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev X-Envelope-To: netdev@vger.kernel.org X-DKIM-Signature: a=rsa-sha256; bh=FYVvf+389IS8ZL6LsNXMb88YYC2tzhligrXA3E/+ZL0=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1793008462; v=1; x=1793613262; b=T8HuUKEk9FzvU94JUU8uap2ICqIdV22wqC2IuByVBc2/vjNmmcnjnBFfbtVHMsRNGF0U9nYB ELs19emSE9ONB1pS8YQlaOERa3jplD1yuwTm4DvVrmaZOYBURryNX+2R/eCRTreSz59wZtETyAI v59R/Iv8h4Qm1CdxdDvAK33U= X-Envelope-To: netdev@vger.kernel.org X-Received: by smtp.migadu.com with ESMTPS id 9e2f4d0ab2390074; Mon, 26 Oct 2026 09:54:22 +0000 X-Mizu-Trace-ID: 9e2f4d0ab2390074 X-Migadu-Flow: FLOW_OUT X-Cc: saeedm@nvidia.com, leon@kernel.org, tariqt@nvidia.com, mbloch@nvidia.com, borisp@nvidia.com, witu@nvidia.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, Xuanqiang Luo <luoxuanqiang@kylinos.cn> X-Mailer: git-send-email 2.43.0 X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list