]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
net/mlx5e: Fix multipath lag activation
authorDima Chumak <dchumak@nvidia.com>
Tue, 13 Apr 2021 19:43:08 +0000 (22:43 +0300)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 18 Jun 2021 13:02:46 +0000 (15:02 +0200)
BugLink: https://bugs.launchpad.net/bugs/1931166
commit 97817fcc684ed01497bd19d0cd4dea699665b9cf upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/net/ethernet/mellanox/mlx5/core/lag_mp.c

index 5d20d615663e789aace6ede20f67871a8ef3bc17..bdc7f915d80e312595701dae8237e26ccca3160d 100644 (file)
@@ -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;
 
@@ -328,4 +333,5 @@ void mlx5_lag_mp_cleanup(struct mlx5_lag *ldev)
 
        unregister_fib_notifier(&mp->fib_nb);
        mp->fib_nb.notifier_call = NULL;
+       mp->mfi = NULL;
 }