]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
mlxsw: remove kvd_hash_granularity from config profile struct
authorJiri Pirko <jiri@mellanox.com>
Sun, 1 Apr 2018 14:34:54 +0000 (17:34 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sun, 1 Apr 2018 14:56:42 +0000 (10:56 -0400)
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>
drivers/net/ethernet/mellanox/mlxsw/core.h
drivers/net/ethernet/mellanox/mlxsw/spectrum.c

index 5ddafd74dc00b48783e88c8d40e8f4667670f85c..fd30eaf404751a283cd3e6025a1f5e75839fb368 100644 (file)
@@ -256,7 +256,6 @@ struct mlxsw_config_profile {
        u16     adaptive_routing_group_cap;
        u8      arn;
        u32     kvd_linear_size;
-       u16     kvd_hash_granularity;
        u8      kvd_hash_single_parts;
        u8      kvd_hash_double_parts;
        u8      resource_query_enable;
index 0e9ed41ce8bc6b7e5dc59f4e96ccfcdac15a6734..d503cdbeae297ed7fabebc75016c3f3ee98bfd30 100644 (file)
@@ -3794,7 +3794,6 @@ static const struct mlxsw_config_profile mlxsw_sp_config_profile = {
        .used_max_pkey                  = 1,
        .max_pkey                       = 0,
        .used_kvd_split_data            = 1,
-       .kvd_hash_granularity           = MLXSW_SP_KVD_GRANULARITY,
        .kvd_hash_single_parts          = 59,
        .kvd_hash_double_parts          = 41,
        .kvd_linear_size                = MLXSW_SP_KVD_LINEAR_SIZE,
@@ -3902,7 +3901,7 @@ static int mlxsw_sp_resources_register(struct mlxsw_core *mlxsw_core)
        double_size *= profile->kvd_hash_double_parts;
        double_size /= profile->kvd_hash_double_parts +
                       profile->kvd_hash_single_parts;
-       double_size = rounddown(double_size, profile->kvd_hash_granularity);
+       double_size = rounddown(double_size, MLXSW_SP_KVD_GRANULARITY);
        err = devlink_resource_register(devlink, MLXSW_SP_RESOURCE_NAME_KVD_HASH_DOUBLE,
                                        double_size,
                                        MLXSW_SP_RESOURCE_KVD_HASH_DOUBLE,
@@ -3962,7 +3961,7 @@ static int mlxsw_sp_kvd_sizes_get(struct mlxsw_core *mlxsw_core,
                double_size /= profile->kvd_hash_double_parts +
                               profile->kvd_hash_single_parts;
                *p_double_size = rounddown(double_size,
-                                          profile->kvd_hash_granularity);
+                                          MLXSW_SP_KVD_GRANULARITY);
        }
 
        err = devlink_resource_size_get(devlink,