diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h index a67d1dd8a607364b06a8d5ef2a7424e0fffd5b34..25ea06dc8bffbea246db30eed9f5070193d9210a 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h @@ -467,7 +467,7 @@ struct mlxsw_sp_kvdl_ops { unsigned int entry_count, u32 *p_entry_index); void (*free)(struct mlxsw_sp *mlxsw_sp, void *priv, enum mlxsw_sp_kvdl_entry_type type, - int entry_index); + unsigned int entry_count, int entry_index); int (*alloc_size_query)(struct mlxsw_sp *mlxsw_sp, void *priv, enum mlxsw_sp_kvdl_entry_type type, unsigned int entry_count, @@ -482,7 +482,7 @@ int mlxsw_sp_kvdl_alloc(struct mlxsw_sp *mlxsw_sp, unsigned int entry_count, u32 *p_entry_index); void mlxsw_sp_kvdl_free(struct mlxsw_sp *mlxsw_sp, enum mlxsw_sp_kvdl_entry_type type, - int entry_index); + unsigned int entry_count, int entry_index); int mlxsw_sp_kvdl_alloc_count_query(struct mlxsw_sp *mlxsw_sp, enum mlxsw_sp_kvdl_entry_type type, unsigned int entry_count, diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum1_kvdl.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum1_kvdl.c index 86e0b993f8b37795d613296c1f7320ae8505d702..0d4583894a976b4ab3041a67893be50609f3c597 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum1_kvdl.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum1_kvdl.c @@ -194,7 +194,7 @@ static int mlxsw_sp1_kvdl_alloc(struct mlxsw_sp *mlxsw_sp, void *priv, static void mlxsw_sp1_kvdl_free(struct mlxsw_sp *mlxsw_sp, void *priv, enum mlxsw_sp_kvdl_entry_type type, - int entry_index) + unsigned int entry_count, int entry_index) { struct mlxsw_sp1_kvdl *kvdl = priv; struct mlxsw_sp1_kvdl_part *part; diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_actions.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_actions.c index f98fb2c76cd8efc4355c304e58b82d0c920c6aca..6a7c3406b72494913bfd5ee8e84dc6c3ce134258 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_actions.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_actions.c @@ -64,7 +64,7 @@ static int mlxsw_sp_act_kvdl_set_add(void *priv, u32 *p_kvdl_index, err_pefa_write: mlxsw_sp_kvdl_free(mlxsw_sp, MLXSW_SP_KVDL_ENTRY_TYPE_ACTSET, - kvdl_index); + 1, kvdl_index); return err; } @@ -76,7 +76,7 @@ static void mlxsw_sp_act_kvdl_set_del(void *priv, u32 kvdl_index, if (is_first) return; mlxsw_sp_kvdl_free(mlxsw_sp, MLXSW_SP_KVDL_ENTRY_TYPE_ACTSET, - kvdl_index); + 1, kvdl_index); } static int mlxsw_sp_act_kvdl_fwd_entry_add(void *priv, u32 *p_kvdl_index, @@ -100,7 +100,7 @@ static int mlxsw_sp_act_kvdl_fwd_entry_add(void *priv, u32 *p_kvdl_index, err_ppbs_write: mlxsw_sp_kvdl_free(mlxsw_sp, MLXSW_SP_KVDL_ENTRY_TYPE_PBS, - kvdl_index); + 1, kvdl_index); return err; } @@ -109,7 +109,7 @@ static void mlxsw_sp_act_kvdl_fwd_entry_del(void *priv, u32 kvdl_index) struct mlxsw_sp *mlxsw_sp = priv; mlxsw_sp_kvdl_free(mlxsw_sp, MLXSW_SP_KVDL_ENTRY_TYPE_PBS, - kvdl_index); + 1, kvdl_index); } static int diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_kvdl.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_kvdl.c index 3f9130afe5eaab1dd54787288dffda091514f530..fd557585514d50def8762283dd3afa86c10d0194 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_kvdl.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_kvdl.c @@ -86,11 +86,12 @@ int mlxsw_sp_kvdl_alloc(struct mlxsw_sp *mlxsw_sp, void mlxsw_sp_kvdl_free(struct mlxsw_sp *mlxsw_sp, enum mlxsw_sp_kvdl_entry_type type, - int entry_index) + unsigned int entry_count, int entry_index) { struct mlxsw_sp_kvdl *kvdl = mlxsw_sp->kvdl; - kvdl->kvdl_ops->free(mlxsw_sp, kvdl->priv, type, entry_index); + kvdl->kvdl_ops->free(mlxsw_sp, kvdl->priv, type, + entry_count, entry_index); } int mlxsw_sp_kvdl_alloc_count_query(struct mlxsw_sp *mlxsw_sp, diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c index d1fd85ade4250b5cd7bbd1de38a3b16d65c5a3e4..87d9423dacdc2ac1badc0eb061dda51b1c0d45c5 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c @@ -111,7 +111,7 @@ mlxsw_sp_mr_erif_sublist_destroy(struct mlxsw_sp *mlxsw_sp, { list_del(&erif_sublist->list); mlxsw_sp_kvdl_free(mlxsw_sp, MLXSW_SP_KVDL_ENTRY_TYPE_MCRIGR, - erif_sublist->rigr2_kvdl_index); + 1, erif_sublist->rigr2_kvdl_index); kfree(erif_sublist); } diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c index fb5980e92e3b61eb6e4044c69ffd69a733d349f3..b4126db695ddc842e1f22ed357dd887ba7d36bd2 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c @@ -1124,7 +1124,7 @@ static void mlxsw_sp_fib_entry_decap_fini(struct mlxsw_sp *mlxsw_sp, fib_entry->decap.ipip_entry->decap_fib_entry = NULL; fib_entry->decap.ipip_entry = NULL; mlxsw_sp_kvdl_free(mlxsw_sp, MLXSW_SP_KVDL_ENTRY_TYPE_ADJ, - fib_entry->decap.tunnel_index); + 1, fib_entry->decap.tunnel_index); } static struct mlxsw_sp_fib_node * @@ -3315,7 +3315,7 @@ mlxsw_sp_nexthop_group_refresh(struct mlxsw_sp *mlxsw_sp, err = mlxsw_sp_adj_index_mass_update(mlxsw_sp, nh_grp, old_adj_index, old_ecmp_size); mlxsw_sp_kvdl_free(mlxsw_sp, MLXSW_SP_KVDL_ENTRY_TYPE_ADJ, - old_adj_index); + old_ecmp_size, old_adj_index); if (err) { dev_warn(mlxsw_sp->bus_info->dev, "Failed to mass-update adjacency index for nexthop group.\n"); goto set_trap; @@ -3338,7 +3338,7 @@ mlxsw_sp_nexthop_group_refresh(struct mlxsw_sp *mlxsw_sp, dev_warn(mlxsw_sp->bus_info->dev, "Failed to set traps for fib entries.\n"); if (old_adj_index_valid) mlxsw_sp_kvdl_free(mlxsw_sp, MLXSW_SP_KVDL_ENTRY_TYPE_ADJ, - nh_grp->adj_index); + nh_grp->ecmp_size, nh_grp->adj_index); } static void __mlxsw_sp_nexthop_neigh_update(struct mlxsw_sp_nexthop *nh,