public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
* [RESEND PATCH V3 for-next 0/3] HW Device hot-removal support
@ 2015-05-13 11:10 Yishai Hadas
       [not found] ` <1431515438-24042-1-git-send-email-yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 23+ messages in thread
From: Yishai Hadas @ 2015-05-13 11:10 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, yishaih-VPRAkNaXOzVWk0Htik3J/w,
	jackm-VPRAkNaXOzVWk0Htik3J/w, raindel-VPRAkNaXOzVWk0Htik3J/w

Currently, if there is any user space application using an IB device,
it is impossible to unload the HW device driver for this device.

Similarly, if the device is hot-unplugged or reset, the device driver
hardware removal flow blocks until all user contexts are destroyed.

This patchset removes the above limitations from both uverbs and ucma.

The IB-core and uverbs layers are still required to remain loaded as
long as there are user applications using the verbs API. However, the
hardware device drivers are not blocked any more by the user space
activity.

To support this, the hardware device needs to expose a new kernel API
named 'disassociate_ucontext'. The device driver is given a ucontext
to detach from, and it should block this user context from any future
hardware access. In the IB-core level, we use this interface to
deactivate all ucontext that address a specific device when handling a
remove_one callback for it.

In the RDMA-CM layer, a similar change is needed in the ucma module,
to prevent blocking of the remove_one operation. This allows for
hot-removal of devices with RDMA-CM users in the user space.

The first patch introduces the new API between the HW device driver and
the IB core. For devices which implement the functionality, IB core
will use it in remove_one, disassociating any active ucontext from the
hardware device. Other drivers that didn't implement it will behave as
today, remove_one will block until all ucontexts referring the device
are destroyed before returning.

The second patch provides implementation of this API for the mlx4
driver.

The third patch extends ucma to avoid blocking remove_one operation in
the cma module. When such device removal event is received, ucma is
turning all user contexts to zombie contexts. This is done by
releasing all underlying resources and preventing any further user
operations on the context.

Changes from V2:
patch #1: Rebase over ODP patches.

Changes from V1:
patch #1: Use uverbs flags instead of disassociate support, drop fatal_event_raised flag.
patch #3: Add support in ucma for handling device removal.

Changes from V0:
patch #1: ib_uverbs_close, reduced mutex scope to enable tasks run in parallel.

Yishai Hadas (3):
  IB/uverbs: Enable device removal when there are active user space
    applications
  IB/mlx4_ib: Disassociate support
  IB/ucma: HW Device hot-removal support

 drivers/infiniband/core/ucma.c        |  130 ++++++++++++-
 drivers/infiniband/core/uverbs.h      |   12 ++
 drivers/infiniband/core/uverbs_cmd.c  |    8 +
 drivers/infiniband/core/uverbs_main.c |  325 +++++++++++++++++++++++++++------
 drivers/infiniband/hw/mlx4/main.c     |  125 +++++++++++++-
 drivers/infiniband/hw/mlx4/mlx4_ib.h  |   12 ++
 include/rdma/ib_verbs.h               |    1 +
 7 files changed, 545 insertions(+), 68 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2015-05-29 17:06 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-13 11:10 [RESEND PATCH V3 for-next 0/3] HW Device hot-removal support Yishai Hadas
     [not found] ` <1431515438-24042-1-git-send-email-yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-05-13 11:10   ` [PATCH V3 for-next 1/3] IB/uverbs: Enable device removal when there are active user space applications Yishai Hadas
     [not found]     ` <1431515438-24042-2-git-send-email-yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-05-25 16:54       ` Jason Gunthorpe
     [not found]         ` <20150525165449.GA4379-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2015-05-27 16:04           ` Doug Ledford
     [not found]             ` <1432742669.28905.228.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-05-27 17:43               ` Jason Gunthorpe
     [not found]                 ` <20150527174332.GC9909-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2015-05-27 21:36                   ` Or Gerlitz
     [not found]                     ` <CAJ3xEMiYbrr2mkXuywNcyYu1v0dqeM+6Lks-CL0U6fSnx=DQ+Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-05-28  0:51                       ` Doug Ledford
2015-05-27 20:47               ` Yishai Hadas
     [not found]                 ` <55662D63.3030806-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2015-05-28  6:19                   ` Jason Gunthorpe
     [not found]                     ` <20150528061923.GA4054-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2015-05-29 10:30                       ` Shachar Raindel
     [not found]                         ` <AM3PR05MB0935AB183EA8764FD83C36A0DCC90-LOZWmgKjnYgQouBfZGh8ttqRiQSDpxhJvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2015-05-29 17:06                           ` Jason Gunthorpe
2015-05-13 11:10   ` [PATCH V3 for-next 2/3] IB/mlx4_ib: Disassociate support Yishai Hadas
2015-05-13 11:10   ` [PATCH V3 for-next 3/3] IB/ucma: HW Device hot-removal support Yishai Hadas
2015-05-13 20:55   ` [RESEND PATCH V3 for-next 0/3] " Hefty, Sean
     [not found]     ` <1828884A29C6694DAF28B7E6B8A82373A8FDA36D-P5GAC/sN6hkd3b2yrw5b5LfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-05-14 11:28       ` Yishai Hadas
     [not found]         ` <555486CA.8080409-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2015-05-14 16:50           ` Hefty, Sean
     [not found]             ` <1828884A29C6694DAF28B7E6B8A82373A8FDA931-P5GAC/sN6hkd3b2yrw5b5LfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-05-17 10:33               ` Yishai Hadas
     [not found]                 ` <55586E5D.1030801-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2015-05-18 18:21                   ` Hefty, Sean
     [not found]                     ` <1828884A29C6694DAF28B7E6B8A82373A8FDC9A4-P5GAC/sN6hkd3b2yrw5b5LfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-05-19 16:17                       ` Liran Liss
     [not found]                         ` <HE1PR05MB1418D0CE0E031DA35E3DDEBAB1C30-eBadYZ65MZ87O8BmmlM1zNqRiQSDpxhJvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2015-05-25 14:01                           ` Yishai Hadas
2015-05-27 16:12                           ` Doug Ledford
     [not found]                             ` <1432743174.28905.231.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-05-28 15:58                               ` Liran Liss
2015-05-28 16:08                               ` Liran Liss

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox