aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/infiniband/core/uverbs_std_types_qp.c
diff options
context:
space:
mode:
authorLeon Romanovsky <leonro@nvidia.com>2021-08-03 21:20:38 +0300
committerJason Gunthorpe <jgg@nvidia.com>2021-08-03 15:26:19 -0300
commitd2b10794fc1312f856d67d0a6454aaa3ae96c595 (patch)
tree13e2f2bda19a1b6fef49bb53af7d93b5a821546e /drivers/infiniband/core/uverbs_std_types_qp.c
parentRDMA/core: Properly increment and decrement QP usecnts (diff)
downloadwireguard-linux-d2b10794fc1312f856d67d0a6454aaa3ae96c595.tar.xz
wireguard-linux-d2b10794fc1312f856d67d0a6454aaa3ae96c595.zip
RDMA/core: Create clean QP creations interface for uverbs
Unify create QP creation interface to make clean approach to create XRC_TGT and regular QPs. Link: https://lore.kernel.org/r/5cd50e7d8ad9112545a1a61dea62799a5cb3224a.1628014762.git.leonro@nvidia.com Signed-off-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'drivers/infiniband/core/uverbs_std_types_qp.c')
-rw-r--r--drivers/infiniband/core/uverbs_std_types_qp.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/infiniband/core/uverbs_std_types_qp.c b/drivers/infiniband/core/uverbs_std_types_qp.c
index a0e734735ba5..dd1075466f61 100644
--- a/drivers/infiniband/core/uverbs_std_types_qp.c
+++ b/drivers/infiniband/core/uverbs_std_types_qp.c
@@ -248,12 +248,8 @@ static int UVERBS_HANDLER(UVERBS_METHOD_QP_CREATE)(
set_caps(&attr, &cap, true);
mutex_init(&obj->mcast_lock);
- if (attr.qp_type == IB_QPT_XRC_TGT)
- qp = ib_create_qp(pd, &attr);
- else
- qp = _ib_create_qp(device, pd, &attr, &attrs->driver_udata, obj,
- NULL);
-
+ qp = ib_create_qp_user(device, pd, &attr, &attrs->driver_udata, obj,
+ KBUILD_MODNAME);
if (IS_ERR(qp)) {
ret = PTR_ERR(qp);
goto err_put;
@@ -264,8 +260,6 @@ static int UVERBS_HANDLER(UVERBS_METHOD_QP_CREATE)(
obj->uxrcd = container_of(xrcd_uobj, struct ib_uxrcd_object,
uobject);
atomic_inc(&obj->uxrcd->refcnt);
- /* It is done in _ib_create_qp for other QP types */
- qp->uobject = obj;
}
obj->uevent.uobject.object = qp;