diff mbox series

[v4,4/4] IB/hw: use rdma_is_user_pd instead of pd uobject pointer

Message ID 20181217151528.30743-5-shamir.rabinovitch@oracle.com (mailing list archive)
State Changes Requested
Delegated to: Jason Gunthorpe
Headers show
Series figure uverbs/kernel ib_pd w/o using ib_pd uobject | expand

Commit Message

Shamir Rabinovitch Dec. 17, 2018, 3:15 p.m. UTC
Now we have the ability to tell from ib_pd if ib_pd was
created by user/kernel verbs. Stop using the ib_pd->uobject
pointer for this. This patch prepare the ib_pb uobject pointer
removal that will happen in another patch.

Signed-off-by: Shamir Rabinovitch <shamir.rabinovitch@oracle.com>
---
 drivers/infiniband/hw/hns/hns_roce_hw_v1.c | 2 +-
 drivers/infiniband/hw/mthca/mthca_qp.c     | 3 ++-
 drivers/infiniband/hw/nes/nes_verbs.c      | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
index a35355fa7405..a6c581a3450b 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
@@ -3926,7 +3926,7 @@  int hns_roce_v1_destroy_qp(struct ib_qp *ibqp)
 	struct hns_roce_qp_work *qp_work;
 	struct hns_roce_v1_priv *priv;
 	struct hns_roce_cq *send_cq, *recv_cq;
-	bool is_user = ibqp->uobject;
+	bool is_user = rdma_is_user_pd(ibqp->pd);
 	int is_timeout = 0;
 	int ret;
 
diff --git a/drivers/infiniband/hw/mthca/mthca_qp.c b/drivers/infiniband/hw/mthca/mthca_qp.c
index 4e5b5cc17f1d..bf94d96e0b42 100644
--- a/drivers/infiniband/hw/mthca/mthca_qp.c
+++ b/drivers/infiniband/hw/mthca/mthca_qp.c
@@ -951,7 +951,8 @@  static int mthca_max_data_size(struct mthca_dev *dev, struct mthca_qp *qp, int d
 static inline int mthca_max_inline_data(struct mthca_pd *pd, int max_data_size)
 {
 	/* We don't support inline data for kernel QPs (yet). */
-	return pd->ibpd.uobject ? max_data_size - MTHCA_INLINE_HEADER_SIZE : 0;
+	return rdma_is_user_pd(&pd->ibpd) ?
+		max_data_size - MTHCA_INLINE_HEADER_SIZE : 0;
 }
 
 static void mthca_adjust_qp_caps(struct mthca_dev *dev,
diff --git a/drivers/infiniband/hw/nes/nes_verbs.c b/drivers/infiniband/hw/nes/nes_verbs.c
index 1f9dc4485f98..8af3ae34ab34 100644
--- a/drivers/infiniband/hw/nes/nes_verbs.c
+++ b/drivers/infiniband/hw/nes/nes_verbs.c
@@ -733,7 +733,7 @@  static int nes_dealloc_pd(struct ib_pd *ibpd)
 	struct nes_device *nesdev = nesvnic->nesdev;
 	struct nes_adapter *nesadapter = nesdev->nesadapter;
 
-	if ((ibpd->uobject) && (ibpd->uobject->context)) {
+	if (rdma_is_user_pd(ibpd) && (ibpd->uobject->context)) {
 		nesucontext = to_nesucontext(ibpd->uobject->context);
 		nes_debug(NES_DBG_PD, "Clearing bit %u from allocated doorbells\n",
 				nespd->mmap_db_index);