]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
net/mlx5e: Update check for merged eswitch device
authorRoi Dayan <roid@mellanox.com>
Tue, 5 Feb 2019 07:41:43 +0000 (09:41 +0200)
committerSaeed Mahameed <saeedm@mellanox.com>
Fri, 1 Mar 2019 20:04:18 +0000 (12:04 -0800)
The current check only validates if both netdevs use the same ops
which means both are vf reps or both uplink reps.

Unlike the case where the two uplinks are bonded (VF LAG), under
multipath scheme the switchdev parent id is not unified between the
uplink reps (and all the associated vf reps). However, we still want
to duplicate in the driver encap flows, adjust the merged eswitch
check for that matter.

Signed-off-by: Roi Dayan <roid@mellanox.com>
Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c

index c44cb5083d55afbab61b3971587c7ee5ecb77686..850cf6ecb4d7d0eb5a2a5ee76d5dce2dc9ec564c 100644 (file)
@@ -2360,10 +2360,9 @@ static bool is_merged_eswitch_dev(struct mlx5e_priv *priv,
        peer_priv = netdev_priv(peer_netdev);
 
        return (MLX5_CAP_ESW(priv->mdev, merged_eswitch) &&
-               (priv->netdev->netdev_ops == peer_netdev->netdev_ops) &&
-               same_hw_devs(priv, peer_priv) &&
-               MLX5_VPORT_MANAGER(peer_priv->mdev) &&
-               (peer_priv->mdev->priv.eswitch->mode == SRIOV_OFFLOADS));
+               mlx5e_eswitch_rep(priv->netdev) &&
+               mlx5e_eswitch_rep(peer_netdev) &&
+               same_hw_devs(priv, peer_priv));
 }