Skip to content

Commit 490f054

Browse files
idoschdavem330
authored andcommitted
mlxsw: spectrum_router: Clear offload indication from IPv6 nexthops on abort
Unlike IPv4, in IPv6 there is no unique structure to represent the nexthop and both the route and nexthop information are squashed to the same structure ('struct fib6_info'). In order to improve resource utilization the driver consolidates identical nexthop groups to the same internal representation of a nexthop group. Therefore, when the offload indication of a nexthop changes, the driver needs to iterate over all the linked fib6_info and toggle their offload flag accordingly. During abort, all the routes are removed from the device and unlinked from their nexthop group. The offload indication is cleared just before the group is destroyed, but by that time no fib6_info is linked to the group and the offload indication remains set. Fix this by clearing the offload indication just before dropping the reference from the nexthop. Fixes: ee5a044 ("mlxsw: spectrum_router: Set hardware flags for routes") Reported-by: Alex Kushnarov <[email protected]> Signed-off-by: Ido Schimmel <[email protected]> Acked-by: Jiri Pirko <[email protected]> Tested-by: Alex Kushnarov <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 6c05ca2 commit 490f054

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
@@ -4993,6 +4993,9 @@ static void mlxsw_sp_rt6_release(struct fib6_info *rt)
49934993

49944994
static void mlxsw_sp_rt6_destroy(struct mlxsw_sp_rt6 *mlxsw_sp_rt6)
49954995
{
4996+
struct fib6_nh *fib6_nh = mlxsw_sp_rt6->rt->fib6_nh;
4997+
4998+
fib6_nh->fib_nh_flags &= ~RTNH_F_OFFLOAD;
49964999
mlxsw_sp_rt6_release(mlxsw_sp_rt6->rt);
49975000
kfree(mlxsw_sp_rt6);
49985001
}

0 commit comments

Comments
 (0)