diff options
author | Arkadi Sharshevsky <arkadis@mellanox.com> | 2018-01-15 08:59:10 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-01-16 14:15:35 -0500 |
commit | e21d21ca31f2fec31f9359a2209929a32a5faf9f (patch) | |
tree | 3fdbcbe122c91df3ee0d232c91d2cac4288c80e2 /drivers/net/ethernet/mellanox/mlxsw/core.c | |
parent | afadc26b3aa3e94d1cedf9472889b4c32aecc6ac (diff) | |
download | linux-stable-e21d21ca31f2fec31f9359a2209929a32a5faf9f.tar.gz linux-stable-e21d21ca31f2fec31f9359a2209929a32a5faf9f.tar.bz2 linux-stable-e21d21ca31f2fec31f9359a2209929a32a5faf9f.zip |
mlxsw: pci: Add support for getting resource through devlink
Up until now the KVD partition was static. This patch introduces the
ability to get the resource sizes via devlink. In case the resource is not
available the default configuration is used.
Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlxsw/core.c')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlxsw/core.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.c b/drivers/net/ethernet/mellanox/mlxsw/core.c index 2488662aa35e..c93512b16121 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core.c @@ -1800,6 +1800,22 @@ void mlxsw_core_flush_owq(void) } EXPORT_SYMBOL(mlxsw_core_flush_owq); +int mlxsw_core_kvd_sizes_get(struct mlxsw_core *mlxsw_core, + const struct mlxsw_config_profile *profile, + u64 *p_single_size, u64 *p_double_size, + u64 *p_linear_size) +{ + struct mlxsw_driver *driver = mlxsw_core->driver; + + if (!driver->kvd_sizes_get) + return -EINVAL; + + return driver->kvd_sizes_get(mlxsw_core, profile, + p_single_size, p_double_size, + p_linear_size); +} +EXPORT_SYMBOL(mlxsw_core_kvd_sizes_get); + static int __init mlxsw_core_module_init(void) { int err; |