]> git.baikalelectronics.ru Git - kernel.git/commit
IB/mlx5: Fix device memory flows
authorYishai Hadas <yishaih@mellanox.com>
Thu, 12 Dec 2019 10:02:37 +0000 (12:02 +0200)
committerDoug Ledford <dledford@redhat.com>
Thu, 12 Dec 2019 21:55:36 +0000 (16:55 -0500)
commit1bb6731d02b69b01fa84b99f61a4342dedb5d9d1
treee114c03c6c585709ba9e95d26cd6033f5c841fbf
parentc9ed6c1446b6a7119abd83859dab452c4fcc600b
IB/mlx5: Fix device memory flows

Fix device memory flows so that only once there will be no live mmaped
VA to a given allocation the matching object will be destroyed.

This prevents a potential scenario that existing VA that was mmaped by
one process might still be used post its deallocation despite that it's
owned now by other process.

The above is achieved by integrating with IB core APIs to manage
mmap/munmap. Only once the refcount will become 0 the DM object and its
underlay area will be freed.

Fixes: 7b177816dcbe ("IB/mlx5: Support device memory type attribute")
Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Link: https://lore.kernel.org/r/20191212100237.330654-3-leon@kernel.org
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/mlx5/cmd.c
drivers/infiniband/hw/mlx5/cmd.h
drivers/infiniband/hw/mlx5/main.c
drivers/infiniband/hw/mlx5/mlx5_ib.h