From: Saeed Mahameed <saeed@kernel.org>
To: "David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>
Cc: netdev@vger.kernel.org, Tariq Toukan <tariqt@nvidia.com>,
Leon Romanovsky <leonro@nvidia.com>,
Dima Chumak <dchumak@nvidia.com>, Roi Dayan <roid@nvidia.com>,
Saeed Mahameed <saeedm@nvidia.com>
Subject: [net 10/16] net/mlx5e: Fix multipath lag activation
Date: Tue, 18 May 2021 23:05:17 -0700 [thread overview]
Message-ID: <20210519060523.17875-11-saeed@kernel.org> (raw)
In-Reply-To: <20210519060523.17875-1-saeed@kernel.org>
From: Dima Chumak <dchumak@nvidia.com>
When handling FIB_EVENT_ENTRY_REPLACE event for a new multipath route,
lag activation can be missed if a stale (struct lag_mp)->mfi pointer
exists, which was associated with an older multipath route that had been
removed.
Normally, when a route is removed, it triggers mlx5_lag_fib_event(),
which handles FIB_EVENT_ENTRY_DEL and clears mfi pointer. But, if
mlx5_lag_check_prereq() condition isn't met, for example when eswitch is
in legacy mode, the fib event is skipped and mfi pointer becomes stale.
Fix by resetting mfi pointer to NULL every time mlx5_lag_mp_init() is
called.
Fixes: 544fe7c2e654 ("net/mlx5e: Activate HW multipath and handle port affinity based on FIB events")
Signed-off-by: Dima Chumak <dchumak@nvidia.com>
Reviewed-by: Roi Dayan <roid@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
drivers/net/ethernet/mellanox/mlx5/core/lag_mp.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lag_mp.c b/drivers/net/ethernet/mellanox/mlx5/core/lag_mp.c
index 2c41a6920264..fd6196b5e163 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/lag_mp.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/lag_mp.c
@@ -307,6 +307,11 @@ int mlx5_lag_mp_init(struct mlx5_lag *ldev)
struct lag_mp *mp = &ldev->lag_mp;
int err;
+ /* always clear mfi, as it might become stale when a route delete event
+ * has been missed
+ */
+ mp->mfi = NULL;
+
if (mp->fib_nb.notifier_call)
return 0;
@@ -335,4 +340,5 @@ void mlx5_lag_mp_cleanup(struct mlx5_lag *ldev)
unregister_fib_notifier(&init_net, &mp->fib_nb);
destroy_workqueue(mp->wq);
mp->fib_nb.notifier_call = NULL;
+ mp->mfi = NULL;
}
--
2.31.1
next prev parent reply other threads:[~2021-05-19 6:06 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-19 6:05 [pull request][net 00/16] mlx5 fixes 2021-05-18 Saeed Mahameed
2021-05-19 6:05 ` [net 01/16] {net, RDMA}/mlx5: Fix override of log_max_qp by other device Saeed Mahameed
2021-05-19 19:30 ` patchwork-bot+netdevbpf
2021-05-19 6:05 ` [net 02/16] net/mlx5e: Fix nullptr in add_vlan_push_action() Saeed Mahameed
2021-05-19 6:05 ` [net 03/16] net/mlx5: Set reformat action when needed for termination rules Saeed Mahameed
2021-05-19 6:05 ` [net 04/16] net/mlx5: Fix err prints and return when creating termination table Saeed Mahameed
2021-05-19 6:05 ` [net 05/16] net/mlx5: SF, Fix show state inactive when its inactivated Saeed Mahameed
2021-05-19 6:05 ` [net 06/16] net/mlx5e: Fix nullptr in mlx5e_tc_add_fdb_flow() Saeed Mahameed
2021-05-19 6:05 ` [net 07/16] net/mlx5e: Fix null deref accessing lag dev Saeed Mahameed
2021-05-19 6:05 ` [net 08/16] net/mlx5e: Make sure fib dev exists in fib event Saeed Mahameed
2021-05-19 6:05 ` [net 09/16] net/mlx5e: reset XPS on error flow if netdev isn't registered yet Saeed Mahameed
2021-05-19 6:05 ` Saeed Mahameed [this message]
2021-05-19 6:05 ` [net 11/16] net/mlx5e: Reject mirroring on source port change encap rules Saeed Mahameed
2021-05-19 6:05 ` [net 12/16] net/mlx5e: Fix error path of updating netdev queues Saeed Mahameed
2021-05-19 6:05 ` [net 13/16] {net,vdpa}/mlx5: Configure interface MAC into mpfs L2 table Saeed Mahameed
2021-05-19 6:05 ` [net 14/16] net/mlx5: Don't overwrite HCA capabilities when setting MSI-X count Saeed Mahameed
2021-05-19 6:05 ` [net 15/16] net/mlx5: Set term table as an unmanaged flow table Saeed Mahameed
2021-05-19 6:05 ` [net 16/16] mlx5e: add add missing BH locking around napi_schdule() Saeed Mahameed
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=20210519060523.17875-11-saeed@kernel.org \
--to=saeed@kernel.org \
--cc=davem@davemloft.net \
--cc=dchumak@nvidia.com \
--cc=kuba@kernel.org \
--cc=leonro@nvidia.com \
--cc=netdev@vger.kernel.org \
--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).