Skip to content

Commit dc860b8

Browse files
idoschkuba-moo
authored andcommitted
mlxsw: spectrum_router: Ignore routes using a deleted nexthop object
Routes are currently processed from a workqueue whereas nexthop objects are processed in system call context. This can result in the driver not finding a suitable nexthop group for a route and issuing a warning [1]. Fix this by ignoring such routes earlier in the process. The subsequent deletion notification will be ignored as well. [1] WARNING: CPU: 2 PID: 7754 at drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c:4853 mlxsw_sp_router_fib_event_work+0x1112/0x1e00 [mlxsw_spectrum] [...] CPU: 2 PID: 7754 Comm: kworker/u8:0 Not tainted 5.11.0-rc6-cq-20210207-1 #16 Hardware name: Mellanox Technologies Ltd. MSN2100/SA001390, BIOS 5.6.5 05/24/2018 Workqueue: mlxsw_core_ordered mlxsw_sp_router_fib_event_work [mlxsw_spectrum] RIP: 0010:mlxsw_sp_router_fib_event_work+0x1112/0x1e00 [mlxsw_spectrum] Fixes: cdd6cfc ("mlxsw: spectrum_router: Allow programming routes with nexthop objects") Signed-off-by: Ido Schimmel <[email protected]> Reported-by: Alex Veber <[email protected]> Tested-by: Alex Veber <[email protected]> Reviewed-by: Petr Machata <[email protected]> Reviewed-by: Jiri Pirko <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent ae9b24d commit dc860b8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5951,6 +5951,10 @@ mlxsw_sp_router_fib4_replace(struct mlxsw_sp *mlxsw_sp,
59515951
if (mlxsw_sp->router->aborted)
59525952
return 0;
59535953

5954+
if (fen_info->fi->nh &&
5955+
!mlxsw_sp_nexthop_obj_group_lookup(mlxsw_sp, fen_info->fi->nh->id))
5956+
return 0;
5957+
59545958
fib_node = mlxsw_sp_fib_node_get(mlxsw_sp, fen_info->tb_id,
59555959
&fen_info->dst, sizeof(fen_info->dst),
59565960
fen_info->dst_len,
@@ -6601,6 +6605,9 @@ static int mlxsw_sp_router_fib6_replace(struct mlxsw_sp *mlxsw_sp,
66016605
if (mlxsw_sp_fib6_rt_should_ignore(rt))
66026606
return 0;
66036607

6608+
if (rt->nh && !mlxsw_sp_nexthop_obj_group_lookup(mlxsw_sp, rt->nh->id))
6609+
return 0;
6610+
66046611
fib_node = mlxsw_sp_fib_node_get(mlxsw_sp, rt->fib6_table->tb6_id,
66056612
&rt->fib6_dst.addr,
66066613
sizeof(rt->fib6_dst.addr),

0 commit comments

Comments
 (0)