Skip to content

Commit d1c95af

Browse files
idoschdavem330
authored andcommitted
mlxsw: spectrum_router: Do not unconditionally clear route offload indication
When mlxsw replaces (or deletes) a route it removes the offload indication from the replaced route. This is problematic for IPv4 routes, as the offload indication is stored in the fib_info which is usually shared between multiple routes. Instead of unconditionally clearing the offload indication, only clear it if no other route is using the fib_info. Fixes: 3984d1a ("mlxsw: spectrum_router: Provide offload indication using nexthop flags") Signed-off-by: Ido Schimmel <[email protected]> Reported-by: Alexander Petrovskiy <[email protected]> Tested-by: Alexander Petrovskiy <[email protected]> Signed-off-by: Jiri Pirko <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent cae6925 commit d1c95af

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3794,6 +3794,9 @@ mlxsw_sp_fib4_entry_offload_unset(struct mlxsw_sp_fib_entry *fib_entry)
37943794
struct mlxsw_sp_nexthop_group *nh_grp = fib_entry->nh_group;
37953795
int i;
37963796

3797+
if (!list_is_singular(&nh_grp->fib_list))
3798+
return;
3799+
37973800
for (i = 0; i < nh_grp->count; i++) {
37983801
struct mlxsw_sp_nexthop *nh = &nh_grp->nexthops[i];
37993802

0 commit comments

Comments
 (0)