IB/mlx5: Don't expose MR cache in switchdev mode

When enabling many VFs and switching to switchdev mode, the total amount
of mkeys we try to allocate when loading representors is very large and
may cause timeouts on allocations, the same issues was observed on VFs
and we employ the same fix that was done for them. We avoid allocating
the full MR cache on load but still allow it to be manipulated once the
IB device is loaded.

Signed-off-by: Mark Bloch <markb@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
This commit is contained in:
Mark Bloch 2018-01-22 15:29:44 +00:00 committed by Saeed Mahameed
parent 8e6efa3a31
commit 72afcf8247
1 changed files with 3 additions and 2 deletions

View File

@ -587,7 +587,7 @@ static void clean_keys(struct mlx5_ib_dev *dev, int c)
static void mlx5_mr_cache_debugfs_cleanup(struct mlx5_ib_dev *dev) static void mlx5_mr_cache_debugfs_cleanup(struct mlx5_ib_dev *dev)
{ {
if (!mlx5_debugfs_root) if (!mlx5_debugfs_root || dev->rep)
return; return;
debugfs_remove_recursive(dev->cache.root); debugfs_remove_recursive(dev->cache.root);
@ -600,7 +600,7 @@ static int mlx5_mr_cache_debugfs_init(struct mlx5_ib_dev *dev)
struct mlx5_cache_ent *ent; struct mlx5_cache_ent *ent;
int i; int i;
if (!mlx5_debugfs_root) if (!mlx5_debugfs_root || dev->rep)
return 0; return 0;
cache->root = debugfs_create_dir("mr_cache", dev->mdev->priv.dbg_root); cache->root = debugfs_create_dir("mr_cache", dev->mdev->priv.dbg_root);
@ -690,6 +690,7 @@ int mlx5_mr_cache_init(struct mlx5_ib_dev *dev)
MLX5_IB_UMR_OCTOWORD; MLX5_IB_UMR_OCTOWORD;
ent->access_mode = MLX5_MKC_ACCESS_MODE_MTT; ent->access_mode = MLX5_MKC_ACCESS_MODE_MTT;
if ((dev->mdev->profile->mask & MLX5_PROF_MASK_MR_CACHE) && if ((dev->mdev->profile->mask & MLX5_PROF_MASK_MR_CACHE) &&
!dev->rep &&
mlx5_core_is_pf(dev->mdev)) mlx5_core_is_pf(dev->mdev))
ent->limit = dev->mdev->profile->mr_cache[i].limit; ent->limit = dev->mdev->profile->mr_cache[i].limit;
else else