summaryrefslogtreecommitdiff
path: root/drivers/infiniband/core/uverbs_main.c
diff options
context:
space:
mode:
authorSean Hefty <sean.hefty@intel.com>2011-08-09 02:31:51 +0400
committerRoland Dreier <roland@purestorage.com>2011-10-13 20:49:51 +0400
commit0e0ec7e0638ef48e0c661873dfcc8caccab984c6 (patch)
tree54314a25a402244036a5417f098c70af441a56a8 /drivers/infiniband/core/uverbs_main.c
parent0a1405da9952a72dd587829a3321695adde7dca1 (diff)
downloadlinux-0e0ec7e0638ef48e0c661873dfcc8caccab984c6.tar.xz
RDMA/core: Export ib_open_qp() to share XRC TGT QPs
XRC TGT QPs are shared resources among multiple processes. Since the creating process may exit, allow other processes which share the same XRC domain to open an existing QP. This allows us to transfer ownership of an XRC TGT QP to another process. Signed-off-by: Sean Hefty <sean.hefty@intel.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband/core/uverbs_main.c')
-rw-r--r--drivers/infiniband/core/uverbs_main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c
index 0cb69e039f75..9c877e24eb60 100644
--- a/drivers/infiniband/core/uverbs_main.c
+++ b/drivers/infiniband/core/uverbs_main.c
@@ -206,8 +206,8 @@ static int ib_uverbs_cleanup_ucontext(struct ib_uverbs_file *file,
container_of(uobj, struct ib_uqp_object, uevent.uobject);
idr_remove_uobj(&ib_uverbs_qp_idr, uobj);
- if (qp->qp_type == IB_QPT_XRC_TGT) {
- ib_release_qp(qp);
+ if (qp != qp->real_qp) {
+ ib_close_qp(qp);
} else {
ib_uverbs_detach_umcast(qp, uqp);
ib_destroy_qp(qp);