From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D7B65173345; Wed, 3 Jul 2024 10:53:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720004005; cv=none; b=hg2XsPftXPscQDAdDpVd+yyjCUv34vTlE64opILUQ5bRRENO7yE74EW41dkGyBfCFwCxpagyAV7CguMD9G5zWYRbRfSTe7iAJ2qycGhApaPd18dYuCwDHY2UNKGv/Zis+2yXimXjZgcSuVG2lq164tjSGmpBoIjW+1L73pyTDn8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720004005; c=relaxed/simple; bh=iqp00XASceAT1WgraKy1rgoAtiXL3wC8GOB8GRYCKe0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rx+2u75Uzmrbw+Y5fI31yuL5gMRhR2U7M+8K1hC+Am0QLLXVYv8439TnyBnhPMmPS2p54kg2UPsKLbaeFeGgaXTbLRJKlIoD+s/Gx/EXu7bgTaFPT9UdUhmdRH4gsRRCdQEqvQcz2Y3nXp5IgoYrDN/U3ojvS4deLW8M5APHDmk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ZTCsVrXR; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="ZTCsVrXR" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5C3D2C2BD10; Wed, 3 Jul 2024 10:53:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1720004005; bh=iqp00XASceAT1WgraKy1rgoAtiXL3wC8GOB8GRYCKe0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZTCsVrXRidIQd28zHn1kj6i4QLrmztMGoI45cy+DPnmp3yOZgYRv46TX+BUwetcsd 6iXUU2Mw5tWZfVihGUXz/issjNIUuyGVv9OooLi7QEeOs7hmf+oMrGXbe3pcfF5Ll1 BTJA9+qpYREAlSSgGz6btfnUsdM4c272bwXLJYVM= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Gal Pressman , Dragos Tatulea , Tariq Toukan , Wojciech Drewek , "David S. Miller" , Sasha Levin Subject: [PATCH 5.4 061/189] net/mlx5e: Fix features validation check for tunneled UDP (non-VXLAN) packets Date: Wed, 3 Jul 2024 12:38:42 +0200 Message-ID: <20240703102843.810846848@linuxfoundation.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240703102841.492044697@linuxfoundation.org> References: <20240703102841.492044697@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Gal Pressman [ Upstream commit 791b4089e326271424b78f2fae778b20e53d071b ] Move the vxlan_features_check() call to after we verified the packet is a tunneled VXLAN packet. Without this, tunneled UDP non-VXLAN packets (for ex. GENENVE) might wrongly not get offloaded. In some cases, it worked by chance as GENEVE header is the same size as VXLAN, but it is obviously incorrect. Fixes: e3cfc7e6b7bd ("net/mlx5e: TX, Add geneve tunnel stateless offload support") Signed-off-by: Gal Pressman Reviewed-by: Dragos Tatulea Signed-off-by: Tariq Toukan Reviewed-by: Wojciech Drewek Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c index facbbd3fac66a..363c4ab059909 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c @@ -4433,7 +4433,7 @@ static netdev_features_t mlx5e_tunnel_features_check(struct mlx5e_priv *priv, /* Verify if UDP port is being offloaded by HW */ if (mlx5_vxlan_lookup_port(priv->mdev->vxlan, port)) - return features; + return vxlan_features_check(skb, features); #if IS_ENABLED(CONFIG_GENEVE) /* Support Geneve offload for default UDP port */ @@ -4454,7 +4454,6 @@ netdev_features_t mlx5e_features_check(struct sk_buff *skb, struct mlx5e_priv *priv = netdev_priv(netdev); features = vlan_features_check(skb, features); - features = vxlan_features_check(skb, features); #ifdef CONFIG_MLX5_EN_IPSEC if (mlx5e_ipsec_feature_check(skb, netdev, features)) -- 2.43.0