Netdev List
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeedm@mellanox.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org, Shahar Klein <shahark@mellanox.com>,
	Saeed Mahameed <saeedm@mellanox.com>
Subject: [net 8/8] net/mlx5e: Sync netdev vxlan ports at open
Date: Fri, 23 Mar 2018 15:05:34 -0700	[thread overview]
Message-ID: <20180323220534.19353-9-saeedm@mellanox.com> (raw)
In-Reply-To: <20180323220534.19353-1-saeedm@mellanox.com>

From: Shahar Klein <shahark@mellanox.com>

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>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 9 +++------
 1 file 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)
 		mlx5_set_port_admin_status(priv->mdev, MLX5_PORT_UP);
 	mutex_unlock(&priv->state_lock);
 
+	if (mlx5e_vxlan_allowed(priv->mdev))
+		udp_tunnel_get_rx_info(netdev);
+
 	return err;
 }
 
@@ -4327,12 +4330,6 @@ static void mlx5e_nic_enable(struct mlx5e_priv *priv)
 #ifdef CONFIG_MLX5_CORE_EN_DCB
 	mlx5e_dcbnl_init_app(priv);
 #endif
-	/* Device already registered: sync netdev system state */
-	if (mlx5e_vxlan_allowed(mdev)) {
-		rtnl_lock();
-		udp_tunnel_get_rx_info(netdev);
-		rtnl_unlock();
-	}
 
 	queue_work(priv->wq, &priv->set_rx_mode_work);
 
-- 
2.14.3

      parent reply	other threads:[~2018-03-23 22:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-23 22:05 [pull request][net 0/8] Mellanox, mlx5 fixes 2018-03-23 Saeed Mahameed
2018-03-23 22:05 ` [net 1/8] net/mlx5e: Don't override vport admin link state in switchdev mode Saeed Mahameed
2018-03-23 22:05 ` [net 2/8] net/mlx5e: Use 32 bits to store VF representor SQ number Saeed Mahameed
2018-03-23 22:05 ` [net 3/8] net/mlx5: Make eswitch support to depend on switchdev Saeed Mahameed
2018-03-23 22:05 ` [net 4/8] net/mlx5e: Verify coalescing parameters in range Saeed Mahameed
2018-03-23 22:05 ` [net 5/8] net/mlx5e: Fix traffic being dropped on VF representor Saeed Mahameed
2018-03-23 22:05 ` [net 6/8] net/mlx5e: Fix memory usage issues in offloading TC flows Saeed Mahameed
2018-03-23 22:05 ` [net 7/8] net/mlx5e: Avoid using the ipv6 stub in the TC offload neigh update path Saeed Mahameed
2018-03-24  9:52   ` Sergei Shtylyov
2018-03-23 22:05 ` Saeed Mahameed [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180323220534.19353-9-saeedm@mellanox.com \
    --to=saeedm@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=shahark@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox