Skip to content

Commit a285d66

Browse files
pmachatakuba-moo
authored andcommitted
mlxsw: spectrum_router: Split nexthop finalization to two stages
Nexthop finalization consists of two steps: the part where the offload is removed, because the backing RIF is now gone; and the part where the association to the RIF is severed. Extract from mlxsw_sp_nexthop_type_fini() a helper that covers the unoffloading part, mlxsw_sp_nexthop_type_rif_gone(), so that it can later be called independently. Note that this swaps around the ordering of mlxsw_sp_nexthop_ipip_fini() vs. mlxsw_sp_nexthop_rif_fini(). The current ordering is more of a historical happenstance than a conscious decision. The two cleanups do not depend on each other, and this change should have no observable effects. Signed-off-by: Petr Machata <[email protected]> Reviewed-by: Danielle Ratson <[email protected]> Link: https://lore.kernel.org/r/7134559534c5f5c4807c3a1569fae56f8887e763.1687438411.git.petrm@nvidia.com Signed-off-by: Jakub Kicinski <[email protected]>
1 parent bdc0b78 commit a285d66

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

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

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4369,21 +4369,26 @@ static int mlxsw_sp_nexthop_type_init(struct mlxsw_sp *mlxsw_sp,
43694369
return err;
43704370
}
43714371

4372-
static void mlxsw_sp_nexthop_type_fini(struct mlxsw_sp *mlxsw_sp,
4373-
struct mlxsw_sp_nexthop *nh)
4372+
static void mlxsw_sp_nexthop_type_rif_gone(struct mlxsw_sp *mlxsw_sp,
4373+
struct mlxsw_sp_nexthop *nh)
43744374
{
43754375
switch (nh->type) {
43764376
case MLXSW_SP_NEXTHOP_TYPE_ETH:
43774377
mlxsw_sp_nexthop_neigh_fini(mlxsw_sp, nh);
4378-
mlxsw_sp_nexthop_rif_fini(nh);
43794378
break;
43804379
case MLXSW_SP_NEXTHOP_TYPE_IPIP:
4381-
mlxsw_sp_nexthop_rif_fini(nh);
43824380
mlxsw_sp_nexthop_ipip_fini(mlxsw_sp, nh);
43834381
break;
43844382
}
43854383
}
43864384

4385+
static void mlxsw_sp_nexthop_type_fini(struct mlxsw_sp *mlxsw_sp,
4386+
struct mlxsw_sp_nexthop *nh)
4387+
{
4388+
mlxsw_sp_nexthop_type_rif_gone(mlxsw_sp, nh);
4389+
mlxsw_sp_nexthop_rif_fini(nh);
4390+
}
4391+
43874392
static int mlxsw_sp_nexthop4_init(struct mlxsw_sp *mlxsw_sp,
43884393
struct mlxsw_sp_nexthop_group *nh_grp,
43894394
struct mlxsw_sp_nexthop *nh,

0 commit comments

Comments
 (0)