netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeed@kernel.org>
To: "David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Eric Dumazet <edumazet@google.com>
Cc: Saeed Mahameed <saeedm@nvidia.com>,
	netdev@vger.kernel.org, Tariq Toukan <tariqt@nvidia.com>,
	Chris Mi <cmi@nvidia.com>, Roi Dayan <roid@nvidia.com>
Subject: [net 09/10] net/mlx5: E-switch, Fix switchdev mode after devlink reload
Date: Wed, 18 Jan 2023 00:04:13 -0800	[thread overview]
Message-ID: <20230118080414.77902-10-saeed@kernel.org> (raw)
In-Reply-To: <20230118080414.77902-1-saeed@kernel.org>

From: Chris Mi <cmi@nvidia.com>

The cited commit removes eswitch mode none. So after devlink reload
in switchdev mode, eswitch mode is not changed. But actually eswitch
is disabled during devlink reload.

Fix it by setting eswitch mode to legacy when disabling eswitch
which is called by reload_down.

Fixes: f019679ea5f2 ("net/mlx5: E-switch, Remove dependency between sriov and eswitch mode")
Signed-off-by: Chris Mi <cmi@nvidia.com>
Reviewed-by: Roi Dayan <roid@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/eswitch.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
index 0dfd5742c6fe..9daf55e90367 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
@@ -1464,6 +1464,7 @@ void mlx5_eswitch_disable(struct mlx5_eswitch *esw)
 	mlx5_lag_disable_change(esw->dev);
 	down_write(&esw->mode_lock);
 	mlx5_eswitch_disable_locked(esw);
+	esw->mode = MLX5_ESWITCH_LEGACY;
 	up_write(&esw->mode_lock);
 	mlx5_lag_enable_change(esw->dev);
 }
-- 
2.39.0


  parent reply	other threads:[~2023-01-18  8:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-18  8:04 [pull request][net 00/10] mlx5 fixes 2023-01-18 Saeed Mahameed
2023-01-18  8:04 ` [net 01/10] net/mlx5: fix missing mutex_unlock in mlx5_fw_fatal_reporter_err_work() Saeed Mahameed
2023-01-19 14:50   ` patchwork-bot+netdevbpf
2023-01-18  8:04 ` [net 02/10] net/mlx5e: Avoid false lock dependency warning on tc_ht even more Saeed Mahameed
2023-01-18  8:04 ` [net 03/10] net/mlx5e: Remove redundant xsk pointer check in mlx5e_mpwrq_validate_xsk Saeed Mahameed
2023-01-18  8:04 ` [net 04/10] net/mlx5: E-switch, Fix setting of reserved fields on MODIFY_SCHEDULING_ELEMENT Saeed Mahameed
2023-01-18  8:04 ` [net 05/10] net/mlx5e: QoS, Fix wrongfully setting parent_element_id " Saeed Mahameed
2023-01-18  8:04 ` [net 06/10] net/mlx5e: Set decap action based on attr for sample Saeed Mahameed
2023-01-18  8:04 ` [net 07/10] net/mlx5e: Remove optimization which prevented update of ESN state Saeed Mahameed
2023-01-18  8:04 ` [net 08/10] net/mlx5e: Protect global IPsec ASO Saeed Mahameed
2023-01-18  8:04 ` Saeed Mahameed [this message]
2023-01-18  8:04 ` [net 10/10] net: mlx5: eliminate anonymous module_init & module_exit Saeed Mahameed
2023-01-19  4:55 ` [pull request][net 00/10] mlx5 fixes 2023-01-18 Jakub Kicinski

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=20230118080414.77902-10-saeed@kernel.org \
    --to=saeed@kernel.org \
    --cc=cmi@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=roid@nvidia.com \
    --cc=saeedm@nvidia.com \
    --cc=tariqt@nvidia.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;
as well as URLs for NNTP newsgroup(s).