linux/drivers/infiniband/hw/mlx5
Maor Gottlieb e899389029 RDMA/mlx5: Fix MR cache memory leak
If the MR cache entry invalidation failed, then we detach this entry from
the cache, therefore we must to free the memory as well.

Allcation backtrace for the leaker:

    [<00000000d8e423b0>] alloc_cache_mr+0x23/0xc0 [mlx5_ib]
    [<000000001f21304c>] create_cache_mr+0x3f/0xf0 [mlx5_ib]
    [<000000009d6b45dc>] mlx5_ib_alloc_implicit_mr+0x41/0×210 [mlx5_ib]
    [<00000000879d0d68>] mlx5_ib_reg_user_mr+0x9e/0×6e0 [mlx5_ib]
    [<00000000be74bf89>] create_qp+0x2fc/0xf00 [ib_uverbs]
    [<000000001a532d22>] ib_uverbs_handler_UVERBS_METHOD_COUNTERS_READ+0x1d9/0×230 [ib_uverbs]
    [<0000000070f46001>] rdma_alloc_commit_uobject+0xb5/0×120 [ib_uverbs]
    [<000000006d8a0b38>] uverbs_alloc+0x2b/0xf0 [ib_uverbs]
    [<00000000075217c9>] ksysioctl+0x234/0×7d0
    [<00000000eb5c120b>] __x64_sys_ioctl+0x16/0×20
    [<00000000db135b48>] do_syscall_64+0x59/0×2e0

Fixes: 1769c4c575 ("RDMA/mlx5: Always remove MRs from the cache before destroying them")
Link: https://lore.kernel.org/r/20201213132940.345554-2-leon@kernel.org
Signed-off-by: Maor Gottlieb <maorg@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
2020-12-14 15:14:27 -04:00
..
ah.c RDMA: Restore ability to fail on AH destroy 2020-09-09 13:57:22 -03:00
cmd.c RDMA: Convert RWQ table logic to ib_core allocation scheme 2020-09-17 14:04:33 -03:00
cmd.h RDMA: Convert RWQ table logic to ib_core allocation scheme 2020-09-17 14:04:33 -03:00
cong.c RDMA/mlx5: Update mlx5_ib to use new cmd interface 2020-05-06 17:42:45 -03:00
counters.c RDMA/mlx5: Fix type warning of sizeof in __mlx5_ib_alloc_counters() 2020-09-25 09:17:42 -03:00
counters.h RDMA/mlx5: Separate counters from main.c 2020-07-07 14:05:51 -03:00
cq.c RDMA/mlx5: mlx5_umem_find_best_quantized_pgoff() for CQ 2020-11-16 16:53:30 -04:00
devx.c RDMA/uverbs: Check ODP in ib_check_mr_access() as well 2020-12-07 14:06:23 -04:00
devx.h RDMA/mlx5: Cleanup DEVX initialization flow 2020-07-07 14:05:51 -03:00
doorbell.c IB: Allow calls to ib_umem_get from kernel ULPs 2020-01-16 16:14:28 +02:00
fs.c RDMA/core: Postpone uobject cleanup on failure till FD close 2020-11-12 12:32:17 -04:00
fs.h RDMA/mlx5: Separate flow steering logic from main.c 2020-07-07 14:05:51 -03:00
gsi.c RDMA/mlx5: Delete not needed GSI QP signal QP type 2020-09-29 13:09:49 -03:00
ib_rep.c IB/mlx5: Rename profile and init methods 2019-11-11 12:15:29 -08:00
ib_rep.h RDMA/mlx5: Assign profile before calling stages 2020-05-06 17:52:01 -03:00
ib_virt.c net/mlx5: Update vport.c to new cmd interface 2020-04-23 21:42:02 +03:00
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
mad.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
main.c Merge branch 'for-rc' into rdma.git 2020-11-17 15:20:26 -04:00
Makefile RDMA/mlx5: Separate flow steering logic from main.c 2020-07-07 14:05:51 -03:00
mem.c RDMA/mlx5: Silence the overflow warning while building offset mask 2020-11-26 15:49:05 -04:00
mlx5_ib.h RDMA/mlx5: Assign dev to DM MR 2020-12-07 15:52:54 -04:00
mr.c RDMA/mlx5: Fix MR cache memory leak 2020-12-14 15:14:27 -04:00
odp.c RDMA/mlx5: Assign dev to DM MR 2020-12-07 15:52:54 -04:00
qos.c RDMA/core: Allow the ioctl layer to abort a fully created uobject 2020-05-21 20:10:46 -03:00
qp.c RDMA/mlx5: Remove unneeded semicolon 2020-12-10 12:00:27 -04:00
qp.h RDMA: Restore ability to return error for destroy WQ 2020-09-09 14:14:29 -03:00
qpc.c RDMA: Restore ability to return error for destroy WQ 2020-09-09 14:14:29 -03:00
restrack.c RDMA/mlx5: Assign dev to DM MR 2020-12-07 15:52:54 -04:00
restrack.h RDMA/mlx5: Separate restrack callbacks initialization from main.c 2020-07-07 14:05:51 -03:00
srq_cmd.c RDMA/mlx5: Lower setting the umem's PAS for SRQ 2020-11-16 16:53:30 -04:00
srq.c RDMA/mlx5: Lower setting the umem's PAS for SRQ 2020-11-16 16:53:30 -04:00
srq.h RDMA/mlx5: Lower setting the umem's PAS for SRQ 2020-11-16 16:53:30 -04:00
std_types.c RDMA/mlx5: Introduce UAPI to query PD attributes 2020-07-06 19:50:34 -03:00
wr.c RDMA/mlx5: Clarify what the UMR is for when creating MRs 2020-09-18 13:02:43 -03:00
wr.h RDMA/mlx5: Move all WR logic from qp.c to separate file 2020-05-06 17:42:45 -03:00