History

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.

Petr Machata committed 3 years ago

Commit a285d661 parent bdc0b781 file · +9 −4Browse files

Unified · Split

drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c+9−4
@@ -4369,21 +4369,26 @@ err_neigh_init: · 4368 unmodified lines
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,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t