aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOr Gerlitz <ogerlitz@mellanox.com>2018-02-15 05:39:55 -0500
committerSaeed Mahameed <saeedm@mellanox.com>2018-03-26 16:58:15 -0400
commitf125376b06bcc57dfb0216ac8d6ec6d5dcf81025 (patch)
tree63c1ad7d36d691a764a5e56b92beaa8192270d33
parent5ecadff0b6cfb52ba5d1bd07c6372acea5418c39 (diff)
net/mlx5: Make eswitch support to depend on switchdev
Add dependancy for switchdev to be congfigured as any user-space control plane SW is expected to use the HW switchdev ID to locate the representors related to VFs of a certain PF and apply SW/offloaded switching on them. Fixes: e80541ecabd5 ('net/mlx5: Add CONFIG_MLX5_ESWITCH Kconfig') Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Reviewed-by: Mark Bloch <markb@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/Kconfig2
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/en_main.c4
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/en_rep.c2
3 files changed, 3 insertions, 5 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/Kconfig b/drivers/net/ethernet/mellanox/mlx5/core/Kconfig
index 25deaa5a534c..c032319f1cb9 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/Kconfig
+++ b/drivers/net/ethernet/mellanox/mlx5/core/Kconfig
@@ -46,7 +46,7 @@ config MLX5_MPFS
46 46
47config MLX5_ESWITCH 47config MLX5_ESWITCH
48 bool "Mellanox Technologies MLX5 SRIOV E-Switch support" 48 bool "Mellanox Technologies MLX5 SRIOV E-Switch support"
49 depends on MLX5_CORE_EN 49 depends on MLX5_CORE_EN && NET_SWITCHDEV
50 default y 50 default y
51 ---help--- 51 ---help---
52 Mellanox Technologies Ethernet SRIOV E-Switch support in ConnectX NIC. 52 Mellanox Technologies Ethernet SRIOV E-Switch support in ConnectX NIC.
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index da94c8cba5ee..e35859657217 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -4069,7 +4069,7 @@ static void mlx5e_set_netdev_dev_addr(struct net_device *netdev)
4069 } 4069 }
4070} 4070}
4071 4071
4072#if IS_ENABLED(CONFIG_NET_SWITCHDEV) && IS_ENABLED(CONFIG_MLX5_ESWITCH) 4072#if IS_ENABLED(CONFIG_MLX5_ESWITCH)
4073static const struct switchdev_ops mlx5e_switchdev_ops = { 4073static const struct switchdev_ops mlx5e_switchdev_ops = {
4074 .switchdev_port_attr_get = mlx5e_attr_get, 4074 .switchdev_port_attr_get = mlx5e_attr_get,
4075}; 4075};
@@ -4175,7 +4175,7 @@ static void mlx5e_build_nic_netdev(struct net_device *netdev)
4175 4175
4176 mlx5e_set_netdev_dev_addr(netdev); 4176 mlx5e_set_netdev_dev_addr(netdev);
4177 4177
4178#if IS_ENABLED(CONFIG_NET_SWITCHDEV) && IS_ENABLED(CONFIG_MLX5_ESWITCH) 4178#if IS_ENABLED(CONFIG_MLX5_ESWITCH)
4179 if (MLX5_VPORT_MANAGER(mdev)) 4179 if (MLX5_VPORT_MANAGER(mdev))
4180 netdev->switchdev_ops = &mlx5e_switchdev_ops; 4180 netdev->switchdev_ops = &mlx5e_switchdev_ops;
4181#endif 4181#endif
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
index 738554a6c69f..5ece289548ad 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
@@ -900,9 +900,7 @@ static void mlx5e_build_rep_netdev(struct net_device *netdev)
900 900
901 netdev->ethtool_ops = &mlx5e_rep_ethtool_ops; 901 netdev->ethtool_ops = &mlx5e_rep_ethtool_ops;
902 902
903#ifdef CONFIG_NET_SWITCHDEV
904 netdev->switchdev_ops = &mlx5e_rep_switchdev_ops; 903 netdev->switchdev_ops = &mlx5e_rep_switchdev_ops;
905#endif
906 904
907 netdev->features |= NETIF_F_VLAN_CHALLENGED | NETIF_F_HW_TC | NETIF_F_NETNS_LOCAL; 905 netdev->features |= NETIF_F_VLAN_CHALLENGED | NETIF_F_HW_TC | NETIF_F_NETNS_LOCAL;
908 netdev->hw_features |= NETIF_F_HW_TC; 906 netdev->hw_features |= NETIF_F_HW_TC;