diff options
author | Eli Cohen <eli@mellanox.com> | 2016-11-27 08:18:21 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-01-26 02:24:34 -0500 |
commit | 4db097fe49ea9dc608e614fbf46bc7463be0eb76 (patch) | |
tree | eabf1c6940aa6e9c352f5528df829411a80f2265 | |
parent | 45f3a7eb2ca05a8cd0e56889fba96b548077f7a3 (diff) |
IB/mlx5: Avoid system crash when enabling many VFs
commit afd02cd3a9b6c04b41d946b5d7f6e17b3fc30c6b upstream.
When enabling many VFs, the total amount of DMA mappings increase
significantly. This causes DMA allocations to take a lot of time
since they are serialized in the kernel.
As a result the driver enters into fatal condition due to
timeout and the system hangs. To recover from this we disable
MR cache for VFs.
PFs will still have a full cache and VFs cache can be manipulated
as usual after driver load.
Fixes: e126ba97dba9 ('mlx5: Add driver for Mellanox Connect-IB adapters')
Signed-off-by: Eli Cohen <eli@mellanox.com>
Signed-off-by: Maor Gottlieb <maorg@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/infiniband/hw/mlx5/mr.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/mlx5/mr.c b/drivers/infiniband/hw/mlx5/mr.c index 4e9012463c37..501af9eab6ec 100644 --- a/drivers/infiniband/hw/mlx5/mr.c +++ b/drivers/infiniband/hw/mlx5/mr.c | |||
@@ -628,7 +628,8 @@ int mlx5_mr_cache_init(struct mlx5_ib_dev *dev) | |||
628 | ent->order = i + 2; | 628 | ent->order = i + 2; |
629 | ent->dev = dev; | 629 | ent->dev = dev; |
630 | 630 | ||
631 | if (dev->mdev->profile->mask & MLX5_PROF_MASK_MR_CACHE) | 631 | if ((dev->mdev->profile->mask & MLX5_PROF_MASK_MR_CACHE) && |
632 | (mlx5_core_is_pf(dev->mdev))) | ||
632 | limit = dev->mdev->profile->mr_cache[i].limit; | 633 | limit = dev->mdev->profile->mr_cache[i].limit; |
633 | else | 634 | else |
634 | limit = 0; | 635 | limit = 0; |