mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH for-next 1/9] RDMA/core: get rid of create_user_ah
@ 2022-03-08 14:35 Yajun Deng
  0 siblings, 0 replies; only message in thread
From: Yajun Deng @ 2022-03-08 14:35 UTC (permalink / raw)
  To: jgg, selvin.xavier, galpress, sleybo, liangwenpeng, liweihang,
	mustafa.ismail, shiraz.saleem, leonro, dennis.dalessandro,
	mike.marciniszyn, zyjzyj2000
  Cc: linux-rdma, linux-kernel, Yajun Deng

The two members create_user_ah and create_ah in struct ib_device_ops
are very similar. we can use create_ah for all case. so get rid of
create_user_ah.

Signed-off-by: Yajun Deng <yajun.deng@linux.dev>
---
 drivers/infiniband/core/device.c     | 1 -
 drivers/infiniband/core/uverbs_cmd.c | 2 +-
 drivers/infiniband/core/verbs.c      | 7 ++-----
 include/rdma/ib_verbs.h              | 2 --
 4 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c
index a311df07b1bd..9a473d855b3a 100644
--- a/drivers/infiniband/core/device.c
+++ b/drivers/infiniband/core/device.c
@@ -2617,7 +2617,6 @@ void ib_set_device_ops(struct ib_device *dev, const struct ib_device_ops *ops)
 	SET_DEVICE_OP(dev_ops, create_qp);
 	SET_DEVICE_OP(dev_ops, create_rwq_ind_table);
 	SET_DEVICE_OP(dev_ops, create_srq);
-	SET_DEVICE_OP(dev_ops, create_user_ah);
 	SET_DEVICE_OP(dev_ops, create_wq);
 	SET_DEVICE_OP(dev_ops, dealloc_dm);
 	SET_DEVICE_OP(dev_ops, dealloc_driver);
diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c
index 4437f834c0a7..fb0733e233f9 100644
--- a/drivers/infiniband/core/uverbs_cmd.c
+++ b/drivers/infiniband/core/uverbs_cmd.c
@@ -3724,7 +3724,7 @@ const struct uapi_definition uverbs_def_write_intf[] = {
 			IB_USER_VERBS_CMD_DESTROY_AH,
 			ib_uverbs_destroy_ah,
 			UAPI_DEF_WRITE_I(struct ib_uverbs_destroy_ah)),
-		UAPI_DEF_OBJ_NEEDS_FN(create_user_ah),
+		UAPI_DEF_OBJ_NEEDS_FN(create_ah),
 		UAPI_DEF_OBJ_NEEDS_FN(destroy_ah)),
 
 	DECLARE_UVERBS_OBJECT(
diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c
index bc9a83f1ca2d..5471f13a2443 100644
--- a/drivers/infiniband/core/verbs.c
+++ b/drivers/infiniband/core/verbs.c
@@ -510,7 +510,7 @@ static struct ib_ah *_rdma_create_ah(struct ib_pd *pd,
 
 	might_sleep_if(flags & RDMA_CREATE_AH_SLEEPABLE);
 
-	if (!udata && !device->ops.create_ah)
+	if (!device->ops.create_ah)
 		return ERR_PTR(-EOPNOTSUPP);
 
 	ah = rdma_zalloc_drv_obj_gfp(
@@ -527,10 +527,7 @@ static struct ib_ah *_rdma_create_ah(struct ib_pd *pd,
 	init_attr.flags = flags;
 	init_attr.xmit_slave = xmit_slave;
 
-	if (udata)
-		ret = device->ops.create_user_ah(ah, &init_attr, udata);
-	else
-		ret = device->ops.create_ah(ah, &init_attr, NULL);
+	ret = device->ops.create_ah(ah, &init_attr, udata);
 	if (ret) {
 		kfree(ah);
 		return ERR_PTR(ret);
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 69d883f7fb41..8e4ded24494c 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -2428,8 +2428,6 @@ struct ib_device_ops {
 	int (*dealloc_pd)(struct ib_pd *pd, struct ib_udata *udata);
 	int (*create_ah)(struct ib_ah *ah, struct rdma_ah_init_attr *attr,
 			 struct ib_udata *udata);
-	int (*create_user_ah)(struct ib_ah *ah, struct rdma_ah_init_attr *attr,
-			      struct ib_udata *udata);
 	int (*modify_ah)(struct ib_ah *ah, struct rdma_ah_attr *ah_attr);
 	int (*query_ah)(struct ib_ah *ah, struct rdma_ah_attr *ah_attr);
 	int (*destroy_ah)(struct ib_ah *ah, u32 flags);
-- 
2.25.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-03-08 14:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-08 14:35 [PATCH for-next 1/9] RDMA/core: get rid of create_user_ah Yajun Deng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®