aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIdo Schimmel <idosch@mellanox.com>2016-12-23 03:32:50 -0500
committerDavid S. Miller <davem@davemloft.net>2016-12-23 12:31:19 -0500
commit58312125da5806308bd69e075fedae30f8cf7794 (patch)
treef82056ea3aae09a9a74e3960b5ced4dcfd901527
parent93a87e5e794fb71a51f97fbde6c0010680b62d70 (diff)
mlxsw: spectrum_router: Correctly remove nexthop groups
At the end of the nexthop initialization process we determine whether the nexthop should be offloaded or not based on the NUD state of the neighbour representing it. After all the nexthops were initialized we refresh the nexthop group and potentially offload it to the device, in case some of the nexthops were resolved. Make the destruction of a nexthop group symmetric with its creation by marking all nexthops as invalid and then refresh the nexthop group to make sure it was removed from the device's tables. Fixes: b2157149b0b0 ("mlxsw: spectrum_router: Add the nexthop neigh activity update") Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
index a0f9742f62df..01d0efa9c5c7 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
@@ -1396,6 +1396,7 @@ static void mlxsw_sp_nexthop_fini(struct mlxsw_sp *mlxsw_sp,
1396{ 1396{
1397 struct mlxsw_sp_neigh_entry *neigh_entry = nh->neigh_entry; 1397 struct mlxsw_sp_neigh_entry *neigh_entry = nh->neigh_entry;
1398 1398
1399 __mlxsw_sp_nexthop_neigh_update(nh, true);
1399 list_del(&nh->neigh_list_node); 1400 list_del(&nh->neigh_list_node);
1400 1401
1401 /* If that is the last nexthop connected to that neigh, remove from 1402 /* If that is the last nexthop connected to that neigh, remove from
@@ -1454,6 +1455,8 @@ mlxsw_sp_nexthop_group_destroy(struct mlxsw_sp *mlxsw_sp,
1454 nh = &nh_grp->nexthops[i]; 1455 nh = &nh_grp->nexthops[i];
1455 mlxsw_sp_nexthop_fini(mlxsw_sp, nh); 1456 mlxsw_sp_nexthop_fini(mlxsw_sp, nh);
1456 } 1457 }
1458 mlxsw_sp_nexthop_group_refresh(mlxsw_sp, nh_grp);
1459 WARN_ON_ONCE(nh_grp->adj_index_valid);
1457 kfree(nh_grp); 1460 kfree(nh_grp);
1458} 1461}
1459 1462