|
@@ -1692,10 +1692,9 @@ int mlx4_en_start_port(struct net_device *dev)
|
|
|
/* Schedule multicast task to populate multicast list */
|
|
|
queue_work(mdev->workqueue, &priv->rx_mode_task);
|
|
|
|
|
|
-#ifdef CONFIG_MLX4_EN_VXLAN
|
|
|
if (priv->mdev->dev->caps.tunnel_offload_mode == MLX4_TUNNEL_OFFLOAD_MODE_VXLAN)
|
|
|
- vxlan_get_rx_port(dev);
|
|
|
-#endif
|
|
|
+ udp_tunnel_get_rx_info(dev);
|
|
|
+
|
|
|
priv->port_up = true;
|
|
|
netif_tx_start_all_queues(dev);
|
|
|
netif_device_attach(dev);
|
|
@@ -2342,7 +2341,6 @@ static int mlx4_en_get_phys_port_id(struct net_device *dev,
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-#ifdef CONFIG_MLX4_EN_VXLAN
|
|
|
static void mlx4_en_add_vxlan_offloads(struct work_struct *work)
|
|
|
{
|
|
|
int ret;
|
|
@@ -2392,15 +2390,19 @@ static void mlx4_en_del_vxlan_offloads(struct work_struct *work)
|
|
|
}
|
|
|
|
|
|
static void mlx4_en_add_vxlan_port(struct net_device *dev,
|
|
|
- sa_family_t sa_family, __be16 port)
|
|
|
+ struct udp_tunnel_info *ti)
|
|
|
{
|
|
|
struct mlx4_en_priv *priv = netdev_priv(dev);
|
|
|
+ __be16 port = ti->port;
|
|
|
__be16 current_port;
|
|
|
|
|
|
- if (priv->mdev->dev->caps.tunnel_offload_mode != MLX4_TUNNEL_OFFLOAD_MODE_VXLAN)
|
|
|
+ if (ti->type != UDP_TUNNEL_TYPE_VXLAN)
|
|
|
return;
|
|
|
|
|
|
- if (sa_family == AF_INET6)
|
|
|
+ if (ti->sa_family != AF_INET)
|
|
|
+ return;
|
|
|
+
|
|
|
+ if (priv->mdev->dev->caps.tunnel_offload_mode != MLX4_TUNNEL_OFFLOAD_MODE_VXLAN)
|
|
|
return;
|
|
|
|
|
|
current_port = priv->vxlan_port;
|
|
@@ -2415,15 +2417,19 @@ static void mlx4_en_add_vxlan_port(struct net_device *dev,
|
|
|
}
|
|
|
|
|
|
static void mlx4_en_del_vxlan_port(struct net_device *dev,
|
|
|
- sa_family_t sa_family, __be16 port)
|
|
|
+ struct udp_tunnel_info *ti)
|
|
|
{
|
|
|
struct mlx4_en_priv *priv = netdev_priv(dev);
|
|
|
+ __be16 port = ti->port;
|
|
|
__be16 current_port;
|
|
|
|
|
|
- if (priv->mdev->dev->caps.tunnel_offload_mode != MLX4_TUNNEL_OFFLOAD_MODE_VXLAN)
|
|
|
+ if (ti->type != UDP_TUNNEL_TYPE_VXLAN)
|
|
|
return;
|
|
|
|
|
|
- if (sa_family == AF_INET6)
|
|
|
+ if (ti->sa_family != AF_INET)
|
|
|
+ return;
|
|
|
+
|
|
|
+ if (priv->mdev->dev->caps.tunnel_offload_mode != MLX4_TUNNEL_OFFLOAD_MODE_VXLAN)
|
|
|
return;
|
|
|
|
|
|
current_port = priv->vxlan_port;
|
|
@@ -2453,7 +2459,6 @@ static netdev_features_t mlx4_en_features_check(struct sk_buff *skb,
|
|
|
|
|
|
return features;
|
|
|
}
|
|
|
-#endif
|
|
|
|
|
|
static int mlx4_en_set_tx_maxrate(struct net_device *dev, int queue_index, u32 maxrate)
|
|
|
{
|
|
@@ -2506,11 +2511,9 @@ static const struct net_device_ops mlx4_netdev_ops = {
|
|
|
.ndo_rx_flow_steer = mlx4_en_filter_rfs,
|
|
|
#endif
|
|
|
.ndo_get_phys_port_id = mlx4_en_get_phys_port_id,
|
|
|
-#ifdef CONFIG_MLX4_EN_VXLAN
|
|
|
- .ndo_add_vxlan_port = mlx4_en_add_vxlan_port,
|
|
|
- .ndo_del_vxlan_port = mlx4_en_del_vxlan_port,
|
|
|
+ .ndo_udp_tunnel_add = mlx4_en_add_vxlan_port,
|
|
|
+ .ndo_udp_tunnel_del = mlx4_en_del_vxlan_port,
|
|
|
.ndo_features_check = mlx4_en_features_check,
|
|
|
-#endif
|
|
|
.ndo_set_tx_maxrate = mlx4_en_set_tx_maxrate,
|
|
|
};
|
|
|
|
|
@@ -2544,11 +2547,9 @@ static const struct net_device_ops mlx4_netdev_ops_master = {
|
|
|
.ndo_rx_flow_steer = mlx4_en_filter_rfs,
|
|
|
#endif
|
|
|
.ndo_get_phys_port_id = mlx4_en_get_phys_port_id,
|
|
|
-#ifdef CONFIG_MLX4_EN_VXLAN
|
|
|
- .ndo_add_vxlan_port = mlx4_en_add_vxlan_port,
|
|
|
- .ndo_del_vxlan_port = mlx4_en_del_vxlan_port,
|
|
|
+ .ndo_udp_tunnel_add = mlx4_en_add_vxlan_port,
|
|
|
+ .ndo_udp_tunnel_del = mlx4_en_del_vxlan_port,
|
|
|
.ndo_features_check = mlx4_en_features_check,
|
|
|
-#endif
|
|
|
.ndo_set_tx_maxrate = mlx4_en_set_tx_maxrate,
|
|
|
};
|
|
|
|
|
@@ -2839,10 +2840,8 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port,
|
|
|
INIT_WORK(&priv->linkstate_task, mlx4_en_linkstate);
|
|
|
INIT_DELAYED_WORK(&priv->stats_task, mlx4_en_do_get_stats);
|
|
|
INIT_DELAYED_WORK(&priv->service_task, mlx4_en_service_task);
|
|
|
-#ifdef CONFIG_MLX4_EN_VXLAN
|
|
|
INIT_WORK(&priv->vxlan_add_task, mlx4_en_add_vxlan_offloads);
|
|
|
INIT_WORK(&priv->vxlan_del_task, mlx4_en_del_vxlan_offloads);
|
|
|
-#endif
|
|
|
#ifdef CONFIG_RFS_ACCEL
|
|
|
INIT_LIST_HEAD(&priv->filters);
|
|
|
spin_lock_init(&priv->filters_lock);
|