From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796384714; b=SbOdXi9ORFqnTk2no6d4vl+nkl1Qu6Drxna+D2oRb2uG9enxMLjeihhD98+SCnSGzKwB i62qdeB9+3L+T1NALD3oZoKW4/p9Yt097pzo5j50RtbI5nLaqbTDdabpY6kpP7mDk/+VB Gt8h5G36f32AJfvcwMolbtHDf6PCL5cyBA2Z1ZjfGwn6/yrzm6C6XP3JSff1R2zzeeWGU aXx3DhKKmKctSJRHxYQwSzNLjFn8RRykbJVVcnUsBT2ZOjewGjPAWEl5wKQd7HRMDLbTf SQmTlA21nfSD7galCmHGhjC4fvZ0+FGsnTsk79RGndG7H0iLtQBfD1T6zwH5+gJ330g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796384714; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=cFJr+tamLnKYGvf1/v/A1bRWx2tngad29MGsJKTbcZM=; b=UFcMgTlQQIiDeXd1noLw01ExlJlwmFFihwhctL/WafGaW/rTRKAUjcgVdij2O34ocMDf URdQaJ+VW03UaIcOlcjvZ83k6DmbzIiPYc0QDDlkhzDtS0iTRd7VFxpf/Cbap89ihf14O n4XYJWKKHSDwXEtmZxgtGcAEjb0Sc+jbbAknoNoON2XaPC6S+x4wO8RgYo0Fh0VgRs8NB GR6muGat9N+nNkcEDDYZ0PP6j2zBWg5PBhVSVt1Bk9iOEzoWRzjj2bPSrXlFjSz1prJU7 F2VMxwP29hBhyMiuB5YtwYpYN6lYsrVkPRA2THvesm2s+78No9SM1ZU6pJYKhT81k3w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=LlFHB621; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 86A5F606A335; Fri, 4 Dec 2026 11:45:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=LlFHB621 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 05AA71F000CE; Fri, 4 Dec 2026 11:45:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796384714; bh=cFJr+tamLnKYGvf1/v/A1bRWx2tngad29MGsJKTbcZM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=LlFHB621js7WN/2UjqMO72/0zeamWomBLF+zx8ln+gpGPnKYwjYalzJfuVeNsTitB AYWTfIS5cXjZ2lka05ZOGE+hTS6+PRnVgvOOEVfthMKgEnC/CFDDuMg5oVHk0jxe51 ocPCdZeqhL5W+jnBEwswSHAwxXIFDiLHkClnKw4g= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Cosmin Ratiu , Leon Romanovsky , Tariq Toukan , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.6 0262/1167] net/mlx5e: IPsec, dont match upper proto selectors in crypto offload TX Date: Fri, 4 Dec 2026 18:54:49 +0900 Message-ID: <20261204100708.884144452@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100702.047403948@linuxfoundation.org> References: <20261204100702.047403948@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Cosmin Ratiu [ Upstream commit 5ed47bd79cebee8429d06c6640aac7ac7c4805ca ] The mentioned commit introduced support for upper protocol selectors (protocol & ports) to mlx5 IPsec offload. In crypto offload mode this causes offloaded TX SAs to stop matching traffic. In tx_add_rule(), setup_fte_upper_proto_match() is called for all offload types and programs a match on the upper protocol (TCP/UDP) and ports. For crypto offload, setup_fte_esp() is then called and sets ip_protocol to ESP. The resulting rule requires both ESP as the IP protocol and TCP/UDP ports, which no packet can satisfy, so TX crypto offload silently stops working for such SAs. In crypto offload mode the stack builds the ESP packet and the HW only encrypts it, so the SA rule should only match on the SPI. Move the setup_fte_upper_proto_match() call under the XFRM_DEV_OFFLOAD_PACKET case, where the rule matches the plaintext packet and upper protocol selectors apply. The other three callers are unaffected: rx_add_rule_sa_selector() is already only invoked for packet offload, and tx_add_policy() / rx_add_policy() are only reachable in packet offload mode, since xfrm policy offload is exclusively of type XFRM_DEV_OFFLOAD_PACKET. Fixes: a7385187a386 ("net/mlx5e: IPsec, support upper protocol selector field offload") Signed-off-by: Cosmin Ratiu Reviewed-by: Leon Romanovsky Signed-off-by: Tariq Toukan Link: https://patch.msgid.link/20261111081337.3129580-1-tariqt@nvidia.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c index 3f188a834cdda..27865213f3475 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c @@ -1443,7 +1443,6 @@ static int tx_add_rule(struct mlx5e_ipsec_sa_entry *sa_entry) } setup_fte_no_frags(spec); - setup_fte_upper_proto_match(spec, &attrs->upspec); switch (attrs->type) { case XFRM_DEV_OFFLOAD_CRYPTO: @@ -1456,6 +1455,7 @@ static int tx_add_rule(struct mlx5e_ipsec_sa_entry *sa_entry) setup_fte_reg_a(spec); break; case XFRM_DEV_OFFLOAD_PACKET: + setup_fte_upper_proto_match(spec, &attrs->upspec); setup_fte_reg_c4(spec, attrs->reqid); err = setup_pkt_reformat(ipsec, attrs, &flow_act); if (err) -- 2.53.0