aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Pirko <jiri@mellanox.com>2018-04-01 10:34:54 -0400
committerDavid S. Miller <davem@davemloft.net>2018-04-01 10:56:42 -0400
commit72779c97cf8f8f446521b48b12f305b6cf952bec (patch)
treec17c9e0655a926826b7622dd987184c7446ca60e
parent4f8768befdea9d8004361f180ca559f22ce5346d (diff)
mlxsw: remove kvd_hash_granularity from config profile struct
This should not be part of the struct, as the struct fields are tightly coupled with the FW command payload of the same name. Just use the "granularity" define directly, as in other places. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/mellanox/mlxsw/core.h1
-rw-r--r--drivers/net/ethernet/mellanox/mlxsw/spectrum.c5
2 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.h b/drivers/net/ethernet/mellanox/mlxsw/core.h
index 5ddafd74dc00..fd30eaf40475 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/core.h
+++ b/drivers/net/ethernet/mellanox/mlxsw/core.h
@@ -256,7 +256,6 @@ struct mlxsw_config_profile {
256 u16 adaptive_routing_group_cap; 256 u16 adaptive_routing_group_cap;
257 u8 arn; 257 u8 arn;
258 u32 kvd_linear_size; 258 u32 kvd_linear_size;
259 u16 kvd_hash_granularity;
260 u8 kvd_hash_single_parts; 259 u8 kvd_hash_single_parts;
261 u8 kvd_hash_double_parts; 260 u8 kvd_hash_double_parts;
262 u8 resource_query_enable; 261 u8 resource_query_enable;
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
index 0e9ed41ce8bc..d503cdbeae29 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
@@ -3794,7 +3794,6 @@ static const struct mlxsw_config_profile mlxsw_sp_config_profile = {
3794 .used_max_pkey = 1, 3794 .used_max_pkey = 1,
3795 .max_pkey = 0, 3795 .max_pkey = 0,
3796 .used_kvd_split_data = 1, 3796 .used_kvd_split_data = 1,
3797 .kvd_hash_granularity = MLXSW_SP_KVD_GRANULARITY,
3798 .kvd_hash_single_parts = 59, 3797 .kvd_hash_single_parts = 59,
3799 .kvd_hash_double_parts = 41, 3798 .kvd_hash_double_parts = 41,
3800 .kvd_linear_size = MLXSW_SP_KVD_LINEAR_SIZE, 3799 .kvd_linear_size = MLXSW_SP_KVD_LINEAR_SIZE,
@@ -3902,7 +3901,7 @@ static int mlxsw_sp_resources_register(struct mlxsw_core *mlxsw_core)
3902 double_size *= profile->kvd_hash_double_parts; 3901 double_size *= profile->kvd_hash_double_parts;
3903 double_size /= profile->kvd_hash_double_parts + 3902 double_size /= profile->kvd_hash_double_parts +
3904 profile->kvd_hash_single_parts; 3903 profile->kvd_hash_single_parts;
3905 double_size = rounddown(double_size, profile->kvd_hash_granularity); 3904 double_size = rounddown(double_size, MLXSW_SP_KVD_GRANULARITY);
3906 err = devlink_resource_register(devlink, MLXSW_SP_RESOURCE_NAME_KVD_HASH_DOUBLE, 3905 err = devlink_resource_register(devlink, MLXSW_SP_RESOURCE_NAME_KVD_HASH_DOUBLE,
3907 double_size, 3906 double_size,
3908 MLXSW_SP_RESOURCE_KVD_HASH_DOUBLE, 3907 MLXSW_SP_RESOURCE_KVD_HASH_DOUBLE,
@@ -3962,7 +3961,7 @@ static int mlxsw_sp_kvd_sizes_get(struct mlxsw_core *mlxsw_core,
3962 double_size /= profile->kvd_hash_double_parts + 3961 double_size /= profile->kvd_hash_double_parts +
3963 profile->kvd_hash_single_parts; 3962 profile->kvd_hash_single_parts;
3964 *p_double_size = rounddown(double_size, 3963 *p_double_size = rounddown(double_size,
3965 profile->kvd_hash_granularity); 3964 MLXSW_SP_KVD_GRANULARITY);
3966 } 3965 }
3967 3966
3968 err = devlink_resource_size_get(devlink, 3967 err = devlink_resource_size_get(devlink,