aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Pirko <jiri@mellanox.com>2018-04-01 10:34:56 -0400
committerDavid S. Miller <davem@davemloft.net>2018-04-01 10:56:43 -0400
commit110d2d2141d9671d4b4467ead06d1dc7288d0e9a (patch)
treee592f4b161e51b56ae6168e5fe6448fa47e2a564
parent64f4588821776ce08c1ff0271630fcaada138705 (diff)
mlxsw: Move "used_kvd_sizes" check to mlxsw_pci_config_profile
The check should be done directly in mlxsw_pci_config_profile, as for other profile items. Also, be consistent in naming with the rest and rename to "used_kvd_sizes". 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.h3
-rw-r--r--drivers/net/ethernet/mellanox/mlxsw/pci.c2
-rw-r--r--drivers/net/ethernet/mellanox/mlxsw/spectrum.c5
3 files changed, 4 insertions, 6 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.h b/drivers/net/ethernet/mellanox/mlxsw/core.h
index 0d6452699364..ff9daa09341d 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/core.h
+++ b/drivers/net/ethernet/mellanox/mlxsw/core.h
@@ -235,8 +235,7 @@ struct mlxsw_config_profile {
235 used_max_pkey:1, 235 used_max_pkey:1,
236 used_ar_sec:1, 236 used_ar_sec:1,
237 used_adaptive_routing_group_cap:1, 237 used_adaptive_routing_group_cap:1,
238 used_kvd_split_data:1; /* indicate for the kvd's values */ 238 used_kvd_sizes:1;
239
240 u8 max_vepa_channels; 239 u8 max_vepa_channels;
241 u16 max_mid; 240 u16 max_mid;
242 u16 max_pgt; 241 u16 max_pgt;
diff --git a/drivers/net/ethernet/mellanox/mlxsw/pci.c b/drivers/net/ethernet/mellanox/mlxsw/pci.c
index e30c6ce3dcb4..5ab068aec033 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/pci.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/pci.c
@@ -1164,7 +1164,7 @@ static int mlxsw_pci_config_profile(struct mlxsw_pci *mlxsw_pci, char *mbox,
1164 mlxsw_cmd_mbox_config_profile_adaptive_routing_group_cap_set( 1164 mlxsw_cmd_mbox_config_profile_adaptive_routing_group_cap_set(
1165 mbox, profile->adaptive_routing_group_cap); 1165 mbox, profile->adaptive_routing_group_cap);
1166 } 1166 }
1167 if (MLXSW_RES_VALID(res, KVD_SIZE)) { 1167 if (profile->used_kvd_sizes && MLXSW_RES_VALID(res, KVD_SIZE)) {
1168 err = mlxsw_pci_profile_get_kvd_sizes(mlxsw_pci, profile, res); 1168 err = mlxsw_pci_profile_get_kvd_sizes(mlxsw_pci, profile, res);
1169 if (err) 1169 if (err)
1170 return err; 1170 return err;
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
index d503cdbeae29..12062aab13c5 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
@@ -3793,7 +3793,7 @@ static const struct mlxsw_config_profile mlxsw_sp_config_profile = {
3793 .max_ib_mc = 0, 3793 .max_ib_mc = 0,
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_sizes = 1,
3797 .kvd_hash_single_parts = 59, 3797 .kvd_hash_single_parts = 59,
3798 .kvd_hash_double_parts = 41, 3798 .kvd_hash_double_parts = 41,
3799 .kvd_linear_size = MLXSW_SP_KVD_LINEAR_SIZE, 3799 .kvd_linear_size = MLXSW_SP_KVD_LINEAR_SIZE,
@@ -3934,8 +3934,7 @@ static int mlxsw_sp_kvd_sizes_get(struct mlxsw_core *mlxsw_core,
3934 int err; 3934 int err;
3935 3935
3936 if (!MLXSW_CORE_RES_VALID(mlxsw_core, KVD_SINGLE_MIN_SIZE) || 3936 if (!MLXSW_CORE_RES_VALID(mlxsw_core, KVD_SINGLE_MIN_SIZE) ||
3937 !MLXSW_CORE_RES_VALID(mlxsw_core, KVD_DOUBLE_MIN_SIZE) || 3937 !MLXSW_CORE_RES_VALID(mlxsw_core, KVD_DOUBLE_MIN_SIZE))
3938 !profile->used_kvd_split_data)
3939 return -EIO; 3938 return -EIO;
3940 3939
3941 /* The hash part is what left of the kvd without the 3940 /* The hash part is what left of the kvd without the