diff options
author | Shahar Klein <shahark@mellanox.com> | 2018-03-20 08:44:40 -0400 |
---|---|---|
committer | Saeed Mahameed <saeedm@mellanox.com> | 2018-03-26 16:59:08 -0400 |
commit | a117f73dc2430443f23e18367fa545981129c1a6 (patch) | |
tree | 44fdfd016ee58bc825b5c8c52f65d730eda9b2c8 | |
parent | 423c9db29943cfc43e3a408192e9efa4178af6a1 (diff) |
net/mlx5e: Sync netdev vxlan ports at open
When mlx5_core is loaded it is expected to sync ports
with all vxlan devices so it can support vxlan encap/decap.
This is done via udp_tunnel_get_rx_info(). Currently this
call is set in mlx5e_nic_enable() and if the netdev is not in
NETREG_REGISTERED state it will not be called.
Normally on load the netdev state is not NETREG_REGISTERED
so udp_tunnel_get_rx_info() will not be called.
Moving udp_tunnel_get_rx_info() to mlx5e_open() so
it will be called on netdev UP event and allow encap/decap.
Fixes: 610e89e05c3f ("net/mlx5e: Don't sync netdev state when not registered")
Signed-off-by: Shahar Klein <shahark@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c index e35859657217..9b4827d36e3e 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c | |||
@@ -2572,6 +2572,9 @@ int mlx5e_open(struct net_device *netdev) | |||
2572 | mlx5_set_port_admin_status(priv->mdev, MLX5_PORT_UP); | 2572 | mlx5_set_port_admin_status(priv->mdev, MLX5_PORT_UP); |
2573 | mutex_unlock(&priv->state_lock); | 2573 | mutex_unlock(&priv->state_lock); |
2574 | 2574 | ||
2575 | if (mlx5e_vxlan_allowed(priv->mdev)) | ||
2576 | udp_tunnel_get_rx_info(netdev); | ||
2577 | |||
2575 | return err; | 2578 | return err; |
2576 | } | 2579 | } |
2577 | 2580 | ||
@@ -4327,12 +4330,6 @@ static void mlx5e_nic_enable(struct mlx5e_priv *priv) | |||
4327 | #ifdef CONFIG_MLX5_CORE_EN_DCB | 4330 | #ifdef CONFIG_MLX5_CORE_EN_DCB |
4328 | mlx5e_dcbnl_init_app(priv); | 4331 | mlx5e_dcbnl_init_app(priv); |
4329 | #endif | 4332 | #endif |
4330 | /* Device already registered: sync netdev system state */ | ||
4331 | if (mlx5e_vxlan_allowed(mdev)) { | ||
4332 | rtnl_lock(); | ||
4333 | udp_tunnel_get_rx_info(netdev); | ||
4334 | rtnl_unlock(); | ||
4335 | } | ||
4336 | 4333 | ||
4337 | queue_work(priv->wq, &priv->set_rx_mode_work); | 4334 | queue_work(priv->wq, &priv->set_rx_mode_work); |
4338 | 4335 | ||