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

Commit 0304c005 authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller
Browse files

mlxsw: spectrum_kvdl: Pass entry_count to free function



For the Spectrum-2 KVD linear manager implementation, entry_count will be
needed even for the free function. So pass it down.

Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4b6b1869
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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,
+1 −1
Original line number Diff line number Diff line
@@ -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;
+4 −4
Original line number Diff line number Diff line
@@ -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
+3 −2
Original line number Diff line number Diff line
@@ -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,
+1 −1
Original line number Diff line number Diff line
@@ -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);
}

Loading