RDMA: Cleanup undesired pd->uobject usage
Drivers should be using udata to determine if a method is invoked from user space or kernel space. A pd does not necessarily say a different objects is kernel or user. Transforming the tests to use udata eliminates a large number of uobject references from the drivers. Signed-off-by: Shamir Rabinovitch <shamir.rabinovitch@oracle.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
This commit is contained in:

committed by
Jason Gunthorpe

parent
af8d70375d
commit
e00b64f7c5
@@ -1136,7 +1136,8 @@ static inline int get_gid_info_from_table(struct ib_qp *ibqp,
|
||||
}
|
||||
|
||||
static int qedr_check_qp_attrs(struct ib_pd *ibpd, struct qedr_dev *dev,
|
||||
struct ib_qp_init_attr *attrs)
|
||||
struct ib_qp_init_attr *attrs,
|
||||
struct ib_udata *udata)
|
||||
{
|
||||
struct qedr_device_attr *qattr = &dev->attr;
|
||||
|
||||
@@ -1177,7 +1178,7 @@ static int qedr_check_qp_attrs(struct ib_pd *ibpd, struct qedr_dev *dev,
|
||||
}
|
||||
|
||||
/* Unprivileged user space cannot create special QP */
|
||||
if (ibpd->uobject && attrs->qp_type == IB_QPT_GSI) {
|
||||
if (udata && attrs->qp_type == IB_QPT_GSI) {
|
||||
DP_ERR(dev,
|
||||
"create qp: userspace can't create special QPs of type=0x%x\n",
|
||||
attrs->qp_type);
|
||||
@@ -1540,7 +1541,7 @@ int qedr_destroy_srq(struct ib_srq *ibsrq)
|
||||
in_params.srq_id = srq->srq_id;
|
||||
dev->ops->rdma_destroy_srq(dev->rdma_ctx, &in_params);
|
||||
|
||||
if (ibsrq->pd->uobject)
|
||||
if (ibsrq->uobject)
|
||||
qedr_free_srq_user_params(srq);
|
||||
else
|
||||
qedr_free_srq_kernel_params(srq);
|
||||
@@ -1993,7 +1994,7 @@ struct ib_qp *qedr_create_qp(struct ib_pd *ibpd,
|
||||
DP_DEBUG(dev, QEDR_MSG_QP, "create qp: called from %s, pd=%p\n",
|
||||
udata ? "user library" : "kernel", pd);
|
||||
|
||||
rc = qedr_check_qp_attrs(ibpd, dev, attrs);
|
||||
rc = qedr_check_qp_attrs(ibpd, dev, attrs, udata);
|
||||
if (rc)
|
||||
return ERR_PTR(rc);
|
||||
|
||||
|
Reference in New Issue
Block a user