aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core/uverbs_cmd.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_cmd.c
parentRDMA/core: Properly increment and decrement QP usecnts (diff)
downloadlinux-dev-d2b10794fc1312f856d67d0a6454aaa3ae96c595.tar.xz
linux-dev-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_cmd.c')
-rw-r--r--drivers/infiniband/core/uverbs_cmd.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c
index 62cafd768d89..740e6b2efe0e 100644
--- a/drivers/infiniband/core/uverbs_cmd.c
+++ b/drivers/infiniband/core/uverbs_cmd.c
@@ -1435,23 +1435,14 @@ static int create_qp(struct uverbs_attr_bundle *attrs,
attr.source_qpn = cmd->source_qpn;
}
- if (cmd->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;
}
ib_qp_usecnt_inc(qp);
- if (cmd->qp_type == IB_QPT_XRC_TGT) {
- /* It is done in _ib_create_qp for other QP types */
- qp->uobject = obj;
- }
-
obj->uevent.uobject.object = qp;
obj->uevent.event_file = READ_ONCE(attrs->ufile->default_async_file);
if (obj->uevent.event_file)