net/mlx5e: Properly disable vlan strip on non-UL reps
authorVlad Buslov <vladbu@nvidia.com>
Fri, 15 Jul 2022 19:41:48 +0000 (21:41 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 31 Aug 2022 15:16:39 +0000 (17:16 +0200)
[ Upstream commit f37044fd759b6bc40b6398a978e0b1acdf717372 ]

When querying mlx5 non-uplink representors capabilities with ethtool
rx-vlan-offload is marked as "off [fixed]". However, it is actually always
enabled because mlx5e_params->vlan_strip_disable is 0 by default when
initializing struct mlx5e_params instance. Fix the issue by explicitly
setting the vlan_strip_disable to 'true' for non-uplink representors.

Fixes: cb67b832921c ("net/mlx5e: Introduce SRIOV VF representors")
Signed-off-by: Vlad Buslov <vladbu@nvidia.com>
Reviewed-by: Roi Dayan <roid@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c

index 161b60e1139b371de0e2f405a2634a3d204e90f7..3d614bf5cff9e0e8cc49716541b4e3128b0d7720 100644 (file)
@@ -618,6 +618,8 @@ static void mlx5e_build_rep_params(struct net_device *netdev)
 
        params->mqprio.num_tc       = 1;
        params->tunneled_offload_en = false;
+       if (rep->vport != MLX5_VPORT_UPLINK)
+               params->vlan_strip_disable = true;
 
        /* Set an initial non-zero value, so that mlx5e_select_queue won't
         * divide by zero if called before first activating channels.