Commit 47116712 authored by Amit Cohen's avatar Amit Cohen Committed by Jakub Kicinski

mlxsw: spectrum_acl_bloom_filter: Reorder functions to make the code more aesthetic

Currently, mlxsw_sp_acl_bf_rule_count_index_get() is implemented before
mlxsw_sp_acl_bf_index_get() but is used after it.

Adding a new function for Spectrum-4 would make them further apart still.
Fix by moving them around.
Signed-off-by: default avatarAmit Cohen <amcohen@nvidia.com>
Reviewed-by: default avatarPetr Machata <petrm@nvidia.com>
Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 07ff1359
...@@ -142,14 +142,6 @@ mlxsw_sp_acl_bf_key_encode(struct mlxsw_sp_acl_atcam_region *aregion, ...@@ -142,14 +142,6 @@ mlxsw_sp_acl_bf_key_encode(struct mlxsw_sp_acl_atcam_region *aregion,
*len = chunk_count * MLXSW_BLOOM_KEY_CHUNK_BYTES; *len = chunk_count * MLXSW_BLOOM_KEY_CHUNK_BYTES;
} }
static unsigned int
mlxsw_sp_acl_bf_rule_count_index_get(struct mlxsw_sp_acl_bf *bf,
unsigned int erp_bank,
unsigned int bf_index)
{
return erp_bank * bf->bank_size + bf_index;
}
static unsigned int static unsigned int
mlxsw_sp_acl_bf_index_get(struct mlxsw_sp_acl_bf *bf, mlxsw_sp_acl_bf_index_get(struct mlxsw_sp_acl_bf *bf,
struct mlxsw_sp_acl_atcam_region *aregion, struct mlxsw_sp_acl_atcam_region *aregion,
...@@ -162,6 +154,14 @@ mlxsw_sp_acl_bf_index_get(struct mlxsw_sp_acl_bf *bf, ...@@ -162,6 +154,14 @@ mlxsw_sp_acl_bf_index_get(struct mlxsw_sp_acl_bf *bf,
return mlxsw_sp_acl_bf_crc(bf_key, bf_size); return mlxsw_sp_acl_bf_crc(bf_key, bf_size);
} }
static unsigned int
mlxsw_sp_acl_bf_rule_count_index_get(struct mlxsw_sp_acl_bf *bf,
unsigned int erp_bank,
unsigned int bf_index)
{
return erp_bank * bf->bank_size + bf_index;
}
int int
mlxsw_sp_acl_bf_entry_add(struct mlxsw_sp *mlxsw_sp, mlxsw_sp_acl_bf_entry_add(struct mlxsw_sp *mlxsw_sp,
struct mlxsw_sp_acl_bf *bf, struct mlxsw_sp_acl_bf *bf,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment