All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 for-next 0/2] RDMA: Provide an API for drivers to disassociate mmap pages
@ 2024-08-28  6:46 Junxian Huang
  2024-08-28  6:46 ` [PATCH v3 for-next 1/2] RDMA/core: Provide rdma_user_mmap_disassociate() " Junxian Huang
  2024-08-28  6:46 ` [PATCH v3 for-next 2/2] RDMA/hns: Disassociate mmap pages for all uctx when HW is being reset Junxian Huang
  0 siblings, 2 replies; 7+ messages in thread
From: Junxian Huang @ 2024-08-28  6:46 UTC (permalink / raw)
  To: jgg, leon; +Cc: linux-rdma, linuxarm, linux-kernel, huangjunxian6

Provide an API rdma_user_mmap_disassociate() for drivers to disassociate
mmap pages. Use this API in hns to prevent userspace from ringing doorbell
when HW is reset.

v2 -> v3:
* Walk all ufiles of a device in rdma_user_mmap_disassociate() as Jason
  commented, so drivers don't need to maintain their own list of ucontexts.
* Add a disassociation_lock in uverbs_user_mmap_disassociate() as Jason
  commented to avoid racing between different threads.
* Add a disassociated flag indicating whether mmaps have been disabled
  to prevent new mmap after the disassociation.

v1 -> v2:
* Keep uverbs_user_mmap_disassociate() in uverbs_main.c. The new api
  rdma_user_mmap_disassociate() is also moved to this file.
* Add "#if IS_ENABLED(CONFIG_INFINIBAND_USER_ACCESS)" to hns's
  rdma_user_mmap_disassociate() call.

Chengchang Tang (2):
  RDMA/core: Provide rdma_user_mmap_disassociate() to disassociate mmap
    pages
  RDMA/hns: Disassociate mmap pages for all uctx when HW is being reset

 drivers/infiniband/core/uverbs.h           |  3 ++
 drivers/infiniband/core/uverbs_main.c      | 45 +++++++++++++++++++++-
 drivers/infiniband/hw/hns/hns_roce_hw_v2.c |  9 +++++
 include/rdma/ib_verbs.h                    |  8 ++++
 4 files changed, 63 insertions(+), 2 deletions(-)

--
2.33.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-09-04 16:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-28  6:46 [PATCH v3 for-next 0/2] RDMA: Provide an API for drivers to disassociate mmap pages Junxian Huang
2024-08-28  6:46 ` [PATCH v3 for-next 1/2] RDMA/core: Provide rdma_user_mmap_disassociate() " Junxian Huang
2024-09-02  6:57   ` Leon Romanovsky
2024-09-02 13:32     ` Junxian Huang
2024-09-03  7:09       ` Leon Romanovsky
2024-09-04 16:04         ` Jason Gunthorpe
2024-08-28  6:46 ` [PATCH v3 for-next 2/2] RDMA/hns: Disassociate mmap pages for all uctx when HW is being reset Junxian Huang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.