Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 63dd00fa authored by Ido Schimmel's avatar Ido Schimmel Committed by David S. Miller
Browse files

mlxsw: spectrum_router: Add batch neighbour deletion



In commit 4a3c67a6 ("mlxsw: spectrum_router: Don't batch neighbour
deletion") I removed the support for batch deletion of neighbours on a
router interface (RIF) since at that time the firmware did not support
it for IPv6 neighbours.

This is now supported by the version enforced by the driver, so there is
no reason to delete neighbours one by one anymore.

Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2f53fbd5
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -2416,17 +2416,26 @@ static void mlxsw_sp_neigh_fini(struct mlxsw_sp *mlxsw_sp)
	rhashtable_destroy(&mlxsw_sp->router->neigh_ht);
}

static int mlxsw_sp_neigh_rif_flush(struct mlxsw_sp *mlxsw_sp,
				    const struct mlxsw_sp_rif *rif)
{
	char rauht_pl[MLXSW_REG_RAUHT_LEN];

	mlxsw_reg_rauht_pack(rauht_pl, MLXSW_REG_RAUHT_OP_WRITE_DELETE_ALL,
			     rif->rif_index, rif->addr);
	return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(rauht), rauht_pl);
}

static void mlxsw_sp_neigh_rif_gone_sync(struct mlxsw_sp *mlxsw_sp,
					 struct mlxsw_sp_rif *rif)
{
	struct mlxsw_sp_neigh_entry *neigh_entry, *tmp;

	mlxsw_sp_neigh_rif_flush(mlxsw_sp, rif);
	list_for_each_entry_safe(neigh_entry, tmp, &rif->neigh_list,
				 rif_list_node) {
		mlxsw_sp_neigh_entry_update(mlxsw_sp, neigh_entry, false);
				 rif_list_node)
		mlxsw_sp_neigh_entry_destroy(mlxsw_sp, neigh_entry);
}
}

enum mlxsw_sp_nexthop_type {
	MLXSW_SP_NEXTHOP_TYPE_ETH,