net/mlx5e: Rearrange netdevice ops structures
authorSaeed Mahameed <saeedm@mellanox.com>
Tue, 6 Jun 2017 14:46:49 +0000 (17:46 +0300)
committerSaeed Mahameed <saeedm@mellanox.com>
Mon, 7 Aug 2017 07:47:06 +0000 (10:47 +0300)
Since we are going to allow building the driver without eswitch support,
it would be possible to compile out the sriov netdevice ops struct such
that the basic ops instance will be used for non VF devices too.

Add missing udp tunnel ndos into mlx5e_netdev_ops_basic.

While here, rearrange some ndos in the sriov ops struct and put
vf/eswitch related ndos towards the end of it.

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

index 57f31fa478ceee5b83a3b4041cfef12457acbd03..c2986777a1d81e21592cfe2ad160143afef1d156 100644 (file)
@@ -3706,6 +3706,9 @@ static const struct net_device_ops mlx5e_netdev_ops_basic = {
        .ndo_change_mtu          = mlx5e_change_mtu,
        .ndo_do_ioctl            = mlx5e_ioctl,
        .ndo_set_tx_maxrate      = mlx5e_set_tx_maxrate,
+       .ndo_udp_tunnel_add      = mlx5e_add_vxlan_port,
+       .ndo_udp_tunnel_del      = mlx5e_del_vxlan_port,
+       .ndo_features_check      = mlx5e_features_check,
 #ifdef CONFIG_RFS_ACCEL
        .ndo_rx_flow_steer       = mlx5e_rx_flow_steer,
 #endif
@@ -3730,13 +3733,19 @@ static const struct net_device_ops mlx5e_netdev_ops_sriov = {
        .ndo_set_features        = mlx5e_set_features,
        .ndo_change_mtu          = mlx5e_change_mtu,
        .ndo_do_ioctl            = mlx5e_ioctl,
+       .ndo_set_tx_maxrate      = mlx5e_set_tx_maxrate,
        .ndo_udp_tunnel_add      = mlx5e_add_vxlan_port,
        .ndo_udp_tunnel_del      = mlx5e_del_vxlan_port,
-       .ndo_set_tx_maxrate      = mlx5e_set_tx_maxrate,
        .ndo_features_check      = mlx5e_features_check,
 #ifdef CONFIG_RFS_ACCEL
        .ndo_rx_flow_steer       = mlx5e_rx_flow_steer,
 #endif
+       .ndo_tx_timeout          = mlx5e_tx_timeout,
+       .ndo_xdp                 = mlx5e_xdp,
+#ifdef CONFIG_NET_POLL_CONTROLLER
+       .ndo_poll_controller     = mlx5e_netpoll,
+#endif
+       /* SRIOV E-Switch NDOs */
        .ndo_set_vf_mac          = mlx5e_set_vf_mac,
        .ndo_set_vf_vlan         = mlx5e_set_vf_vlan,
        .ndo_set_vf_spoofchk     = mlx5e_set_vf_spoofchk,
@@ -3745,11 +3754,6 @@ static const struct net_device_ops mlx5e_netdev_ops_sriov = {
        .ndo_get_vf_config       = mlx5e_get_vf_config,
        .ndo_set_vf_link_state   = mlx5e_set_vf_link_state,
        .ndo_get_vf_stats        = mlx5e_get_vf_stats,
-       .ndo_tx_timeout          = mlx5e_tx_timeout,
-       .ndo_xdp                 = mlx5e_xdp,
-#ifdef CONFIG_NET_POLL_CONTROLLER
-       .ndo_poll_controller     = mlx5e_netpoll,
-#endif
        .ndo_has_offload_stats   = mlx5e_has_offload_stats,
        .ndo_get_offload_stats   = mlx5e_get_offload_stats,
 };