]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
net/mlx5e: Fix features validation check for tunneled UDP (non-VXLAN) packets
authorGal Pressman <gal@nvidia.com>
Thu, 6 Jun 2024 20:32:49 +0000 (23:32 +0300)
committerRoxana Nicolescu <roxana.nicolescu@canonical.com>
Fri, 2 Aug 2024 14:26:54 +0000 (16:26 +0200)
BugLink: https://bugs.launchpad.net/bugs/2074091
[ 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 <gal@nvidia.com>
Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Portia Stephens <portia.stephens@canonical.com>
Signed-off-by: Roxana Nicolescu <roxana.nicolescu@canonical.com>
drivers/net/ethernet/mellanox/mlx5/core/en_main.c

index d4106254615507398fea3665f439d986a6650d0b..07a9f2b25163864a70a089ff688c991dcf091dc2 100644 (file)
@@ -4717,7 +4717,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 */
@@ -4743,7 +4743,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);
 
        /* Validate if the tunneled packet is being offloaded by HW */
        if (skb->encapsulation &&