Skip to content

Commit 72afcf8

Browse files
mark-blochSaeed Mahameed
authored andcommitted
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 <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent 8e6efa3 commit 72afcf8

File tree

1 file changed

+3
-2
lines changed
  • drivers/infiniband/hw/mlx5

1 file changed

+3
-2
lines changed

drivers/infiniband/hw/mlx5/mr.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ static void clean_keys(struct mlx5_ib_dev *dev, int c)
587587

588588
static void mlx5_mr_cache_debugfs_cleanup(struct mlx5_ib_dev *dev)
589589
{
590-
if (!mlx5_debugfs_root)
590+
if (!mlx5_debugfs_root || dev->rep)
591591
return;
592592

593593
debugfs_remove_recursive(dev->cache.root);
@@ -600,7 +600,7 @@ static int mlx5_mr_cache_debugfs_init(struct mlx5_ib_dev *dev)
600600
struct mlx5_cache_ent *ent;
601601
int i;
602602

603-
if (!mlx5_debugfs_root)
603+
if (!mlx5_debugfs_root || dev->rep)
604604
return 0;
605605

606606
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)
690690
MLX5_IB_UMR_OCTOWORD;
691691
ent->access_mode = MLX5_MKC_ACCESS_MODE_MTT;
692692
if ((dev->mdev->profile->mask & MLX5_PROF_MASK_MR_CACHE) &&
693+
!dev->rep &&
693694
mlx5_core_is_pf(dev->mdev))
694695
ent->limit = dev->mdev->profile->mr_cache[i].limit;
695696
else

0 commit comments

Comments
 (0)