]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
RDMA: Connect between the mmap entry and the umap_priv structure
authorMichal Kalderon <michal.kalderon@marvell.com>
Wed, 30 Oct 2019 09:44:12 +0000 (11:44 +0200)
committerSeth Forshee <seth.forshee@canonical.com>
Fri, 20 Mar 2020 21:32:07 +0000 (16:32 -0500)
commit6d984a870c77aed3d173ad3f5aac4349135ee781
treedd471fb3aeaa60daf34058fa4732fd79a9bf5c31
parente77ff90b915d6ee361ca69087e804c9394ea238e
RDMA: Connect between the mmap entry and the umap_priv structure

BugLink: https://launchpad.net/bugs/1859269
The rdma_user_mmap_io interface created a common interface for drivers to
correctly map hw resources and zap them once the ucontext is destroyed
enabling the drivers to safely free the hw resources.

However, this meant the drivers need to delay freeing the resource to the
ucontext destroy phase to ensure they were no longer mapped.  The new
mechanism for a common way of handling user/driver address mapping enabled
notifying the driver if all umap_priv mappings were removed, and enabled
freeing the hw resources when they are done with and not delay it until
ucontext destroy.

Since not all drivers use the mechanism, NULL can be sent to the
rdma_user_mmap_io interface to continue working as before.  Drivers that
use the mmap_xa interface can pass the entry being mapped to the
rdma_user_mmap_io function to be linked together.

Link: https://lore.kernel.org/r/20191030094417.16866-4-michal.kalderon@marvell.com
Signed-off-by: Ariel Elior <ariel.elior@marvell.com>
Signed-off-by: Michal Kalderon <michal.kalderon@marvell.com>
Reviewed-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
(cherry picked from commit c043ff2cfb7f6fdd9a1cb1a7ba3800f19b70bf65)
Signed-off-by: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
drivers/infiniband/core/core_priv.h
drivers/infiniband/core/ib_core_uverbs.c
drivers/infiniband/core/uverbs_main.c
drivers/infiniband/hw/efa/efa_verbs.c
drivers/infiniband/hw/hns/hns_roce_main.c
drivers/infiniband/hw/mlx4/main.c
drivers/infiniband/hw/mlx5/main.c
include/rdma/ib_verbs.h