diff options
author | Leon Romanovsky <leonro@nvidia.com> | 2023-02-02 12:03:06 +0300 |
---|---|---|
committer | Leon Romanovsky <leon@kernel.org> | 2023-02-06 16:44:10 +0300 |
commit | 828cf5936bea2438c21a3a6c303b34a2a1f6c3c2 (patch) | |
tree | 1c7a4d239eaf015c5ec277dd511141c9ad3e1316 /drivers/infiniband | |
parent | 65a8fc30fb6722fc25adec6d7dd5b53b0bb85820 (diff) | |
download | linux-828cf5936bea2438c21a3a6c303b34a2a1f6c3c2.tar.xz |
RDMA/mlx5: Fix MR cache debugfs error in IB representors mode
Block MR cache debugfs creation for IB representor flow as MR cache shouldn't be used
at all in that mode. As part of this change, add missing debugfs cleanup in error path
too.
This change fixes the following debugfs errors:
bond0: (slave enp8s0f1): Enslaving as a backup interface with an up link
mlx5_core 0000:08:00.0: lag map: port 1:1 port 2:1
mlx5_core 0000:08:00.0: shared_fdb:1 mode:queue_affinity
mlx5_core 0000:08:00.0: Operation mode is single FDB
debugfs: Directory '2' with parent '/' already present!
...
debugfs: Directory '22' with parent '/' already present!
Fixes: 73d09b2fe833 ("RDMA/mlx5: Introduce mlx5r_cache_rb_key")
Signed-off-by: Michael Guralnik <michaelgur@nvidia.com>
Link: https://lore.kernel.org/r/482a78c54acbcfa1742a0e06a452546428900ffa.1675328463.git.leon@kernel.org
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/hw/mlx5/mr.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/mlx5/mr.c b/drivers/infiniband/hw/mlx5/mr.c index c396b942d0c8..a9808e022b1f 100644 --- a/drivers/infiniband/hw/mlx5/mr.c +++ b/drivers/infiniband/hw/mlx5/mr.c @@ -845,6 +845,9 @@ static void mlx5_mkey_cache_debugfs_add_ent(struct mlx5_ib_dev *dev, int order = order_base_2(ent->rb_key.ndescs); struct dentry *dir; + if (!mlx5_debugfs_root || dev->is_rep) + return; + if (ent->rb_key.access_mode == MLX5_MKC_ACCESS_MODE_KSM) order = MLX5_IMR_KSM_CACHE_ENTRY + 2; @@ -1003,6 +1006,7 @@ int mlx5_mkey_cache_init(struct mlx5_ib_dev *dev) err: mutex_unlock(&cache->rb_lock); + mlx5_mkey_cache_debugfs_cleanup(dev); mlx5_ib_warn(dev, "failed to create mkey cache entry\n"); return ret; } |