Skip to content

Commit 97817fc

Browse files
chumakdSaeed Mahameed
authored andcommitted
net/mlx5e: Fix multipath lag activation
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: 544fe7c ("net/mlx5e: Activate HW multipath and handle port affinity based on FIB events") Signed-off-by: Dima Chumak <[email protected]> Reviewed-by: Roi Dayan <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent 77ecd10 commit 97817fc

File tree

1 file changed

+6
-0
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core

1 file changed

+6
-0
lines changed

drivers/net/ethernet/mellanox/mlx5/core/lag_mp.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,11 @@ int mlx5_lag_mp_init(struct mlx5_lag *ldev)
307307
struct lag_mp *mp = &ldev->lag_mp;
308308
int err;
309309

310+
/* always clear mfi, as it might become stale when a route delete event
311+
* has been missed
312+
*/
313+
mp->mfi = NULL;
314+
310315
if (mp->fib_nb.notifier_call)
311316
return 0;
312317

@@ -335,4 +340,5 @@ void mlx5_lag_mp_cleanup(struct mlx5_lag *ldev)
335340
unregister_fib_notifier(&init_net, &mp->fib_nb);
336341
destroy_workqueue(mp->wq);
337342
mp->fib_nb.notifier_call = NULL;
343+
mp->mfi = NULL;
338344
}

0 commit comments

Comments
 (0)